{"modulePath":"github.com/hostinger/api-cli","version":"v1.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package websites\n\n## Variables\n\n```go\nvar CreateCmd = \u0026cobra.Command{\n\tUse:   \"create\",\n\tShort: \"Create website\",\n\tLong:  \"Create a new website for the authenticated client.\\n\\nProvide the domain name and associated order ID to create a new website.\\nThe datacenter_code parameter is required when creating the first website\\non a new hosting plan - this will set up and configure new hosting account\\nin the selected datacenter.\\n\\nSubsequent websites will be hosted on the same datacenter automatically.\\n\\nWebsite creation takes up to a few minutes to complete. Check the\\nwebsites list endpoint to see when your new website becomes available.\",\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().HostingCreateWebsiteV1WithBodyWithResponse(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```go\nvar GroupCmd = \u0026cobra.Command{\n\tUse:   \"websites\",\n\tShort: \"Websites commands\",\n}\n```\n\n```go\nvar ListCmd = \u0026cobra.Command{\n\tUse:   \"list\",\n\tShort: \"List websites\",\n\tLong:  \"Retrieve a paginated list of websites (main and addon types) accessible to the authenticated client.\\n\\nThis endpoint returns websites from your hosting accounts as well as\\nwebsites from other client hosting accounts that have shared access\\nwith you.\\n\\nUse the available query parameters to filter results by username,\\norder ID, enabled status, or domain name for more targeted results.\",\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().HostingListWebsitesV1WithResponse(context.TODO(), listParams(cmd))\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/websites","name":"websites","synopsis":"","isRedistributable":true}
