{"modulePath":"github.com/hostinger/api-cli","version":"v1.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ptr\n\n## Variables\n\n```go\nvar CreateCmd = \u0026cobra.Command{\n\tUse:   \"create \u003cvirtual-machine-id\u003e \u003cip-address-id\u003e\",\n\tShort: \"Create PTR record\",\n\tLong:  \"Create or update a PTR (Pointer) record for a specified virtual machine.\\n\\nUse this endpoint to configure reverse DNS lookup for VPS IP addresses.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(2)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tpayload, err := json.Marshal(createBody(cmd))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tr, err := api.Request().VPSCreatePTRRecordV1WithBodyWithResponse(context.TODO(), utils.StringToInt(args[0]), utils.StringToInt(args[1]), \"application/json\", bytes.NewReader(payload))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\toutput.Format(cmd, r.Body, r.StatusCode())\n\t},\n}\n```\n\n```go\nvar DeleteCmd = \u0026cobra.Command{\n\tUse:   \"delete \u003cvirtual-machine-id\u003e \u003cip-address-id\u003e\",\n\tShort: \"Delete PTR record\",\n\tLong:  \"Delete a PTR (Pointer) record for a specified virtual machine.\\n\\nOnce deleted, reverse DNS lookups to the virtual machine's IP address will\\nno longer return the previously configured hostname.\\n\\nUse this endpoint to remove reverse DNS configuration from VPS instances.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(2)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().VPSDeletePTRRecordV1WithResponse(context.TODO(), utils.StringToInt(args[0]), utils.StringToInt(args[1]))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\toutput.Format(cmd, r.Body, r.StatusCode())\n\t},\n}\n```\n\n```go\nvar GroupCmd = \u0026cobra.Command{\n\tUse:   \"ptr\",\n\tShort: \"PTR records commands\",\n}\n```\n\n","path":"github.com/hostinger/api-cli/cmd/vps/ptr","name":"ptr","synopsis":"","isRedistributable":true}
