{"modulePath":"github.com/hostinger/api-cli","version":"v1.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package domains\n\n## Variables\n\n```go\nvar CreateWebsiteParkedCmd = \u0026cobra.Command{\n\tUse:   \"create-website-parked \u003cusername\u003e \u003cdomain\u003e\",\n\tShort: \"Create website parked domain\",\n\tLong:  \"Create a parked or alias domain for the selected website.\\n\\nProvide a domain name or IP address to park on the website so it serves the same content\\nas the parent domain.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(2)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tpayload, err := json.Marshal(createWebsiteParkedBody(cmd))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tr, err := api.Request().HostingCreateWebsiteParkedDomainV1WithBodyWithResponse(context.TODO(), args[0], 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 CreateWebsiteSubdomainCmd = \u0026cobra.Command{\n\tUse:   \"create-website-subdomain \u003cusername\u003e \u003cdomain\u003e\",\n\tShort: \"Create website subdomain\",\n\tLong:  \"Create a new subdomain for the selected website.\\n\\nProvide a subdomain prefix and, optionally, a custom directory or the\\nwebsite public directory to use as the subdomain root.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(2)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tpayload, err := json.Marshal(createWebsiteSubdomainBody(cmd))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tr, err := api.Request().HostingCreateWebsiteSubdomainV1WithBodyWithResponse(context.TODO(), args[0], 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 DeleteWebsiteParkedCmd = \u0026cobra.Command{\n\tUse:   \"delete-website-parked \u003cusername\u003e \u003cdomain\u003e \u003cparked-domain\u003e\",\n\tShort: \"Delete website parked domain\",\n\tLong:  \"Delete an existing parked or alias domain from the selected website.\\n\\nUse this endpoint to remove parked domains that are no longer needed.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(3)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().HostingDeleteWebsiteParkedDomainV1WithResponse(context.TODO(), args[0], args[1], args[2])\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 DeleteWebsiteSubdomainCmd = \u0026cobra.Command{\n\tUse:   \"delete-website-subdomain \u003cusername\u003e \u003cdomain\u003e \u003csubdomain\u003e\",\n\tShort: \"Delete website subdomain\",\n\tLong:  \"Delete an existing subdomain from the selected website.\\n\\nUse this endpoint to remove subdomains that are no longer needed.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(3)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().HostingDeleteWebsiteSubdomainV1WithResponse(context.TODO(), args[0], args[1], args[2])\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 GenerateFreeSubdomainCmd = \u0026cobra.Command{\n\tUse:   \"generate-free-subdomain\",\n\tShort: \"Generate a free subdomain\",\n\tLong:  \"Generate a unique free subdomain that can be used for hosting services without purchasing custom domains.\\nFree subdomains allow you to start using hosting services immediately\\nand you can always connect a custom domain to your site later.\",\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().HostingGenerateAFreeSubdomainV1WithResponse(context.TODO())\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:   \"domains\",\n\tShort: \"Domains commands\",\n}\n```\n\n```go\nvar ListWebsiteParkedCmd = \u0026cobra.Command{\n\tUse:   \"list-website-parked \u003cusername\u003e \u003cdomain\u003e\",\n\tShort: \"List website parked domains\",\n\tLong:  \"Retrieve all parked or alias domains created under the selected website.\\n\\nUse this endpoint to inspect parked domain configuration for a specific website,\\nincluding the parent domain and root directory assigned to each parked domain.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(2)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().HostingListWebsiteParkedDomainsV1WithResponse(context.TODO(), args[0], 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 ListWebsiteSubdomainsCmd = \u0026cobra.Command{\n\tUse:   \"list-website-subdomains \u003cusername\u003e \u003cdomain\u003e\",\n\tShort: \"List website subdomains\",\n\tLong:  \"Retrieve all subdomains created under the selected website.\\n\\nUse this endpoint to inspect subdomain configuration for a specific website,\\nincluding the parent domain and root directory assigned to each subdomain.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(2)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().HostingListWebsiteSubdomainsV1WithResponse(context.TODO(), args[0], 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 VerifyOwnershipCmd = \u0026cobra.Command{\n\tUse:   \"verify-ownership\",\n\tShort: \"Verify domain ownership\",\n\tLong:  \"Verify ownership of a single domain and return the verification status.\\n\\nUse this endpoint to check if a domain is accessible for you before using it for new websites.\\nIf the domain is accessible, the response will have `is_accessible: true`.\\nIf not, add the given TXT record to your domain's DNS records and try verifying again.\\nKeep in mind that it may take up to 10 minutes for new TXT DNS records to propagate.\\n\\nSkip this verification when using Hostinger's free subdomains (*.hostingersite.com).\",\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tpayload, err := json.Marshal(verifyOwnershipBody(cmd))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tr, err := api.Request().HostingVerifyDomainOwnershipV1WithBodyWithResponse(context.TODO(), \"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","path":"github.com/hostinger/api-cli/cmd/hosting/domains","name":"domains","synopsis":"","isRedistributable":true}
