{"modulePath":"github.com/hostinger/api-cli","version":"v1.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package wordpress\n\n## Variables\n\n```go\nvar GroupCmd = \u0026cobra.Command{\n\tUse:   \"wordpress\",\n\tShort: \"Wordpress commands\",\n}\n```\n\n```go\nvar InstallCmd = \u0026cobra.Command{\n\tUse:   \"install \u003cusername\u003e\",\n\tShort: \"Install WordPress\",\n\tLong:  \"Install WordPress on an existing website.\\n\\nThe website must already exist before calling this endpoint. To create a new\\nwebsite first, use POST /api/hosting/v1/websites and poll\\nGET /api/hosting/v1/websites until it appears.\\n\\nCall GET /api/hosting/v1/wordpress/installations filtered by username and\\ndomain before proceeding to check whether WordPress is already installed on\\nthe target domain/path. If WordPress already exists and `overwrite` is false\\n(the default), the async job will fail.\\n\\nThis operation is asynchronous: a successful response only means the install\\njob has been queued, not that WordPress is ready. Installation typically\\ntakes 1-2 minutes. Poll GET /api/hosting/v1/wordpress/installations filtered\\nby username and domain to track progress. When the installation appears in\\nthat list, WordPress is ready.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(1)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tutils.EnumCheck(cmd, \"auto-updates\", []string{\"all\", \"none\", \"minor\"})\n\t\tpayload, err := json.Marshal(installBody(cmd))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tr, err := api.Request().HostingInstallWordPressV1WithBodyWithResponse(context.TODO(), args[0], \"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 ListInstallationsCmd = \u0026cobra.Command{\n\tUse:   \"list-installations\",\n\tShort: \"List WordPress installations\",\n\tLong:  \"List WordPress installations accessible to the authenticated client.\\n\\nUse this endpoint to discover existing WordPress installations and to poll\\nfor installation status after calling the install endpoint. When a newly\\nrequested installation appears in this list, WordPress is ready. Filter by\\nusername and domain to narrow results to a specific website.\\n\\nEach installation includes a `valid` flag and, when invalid, a\\n`validationError` describing why.\",\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tutils.EnumCheck(cmd, \"ownership\", []string{\"owned\", \"managed\", \"all\"})\n\t\tr, err := api.Request().HostingListWordPressInstallationsV1WithResponse(context.TODO(), listInstallationsParams(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/wordpress","name":"wordpress","synopsis":"","isRedistributable":true}
