Skip to content

Commit 39bfae2

Browse files
feat: regenerate CLI from OpenAPI spec
1 parent 1ab0fa8 commit 39bfae2

3 files changed

Lines changed: 5 additions & 37 deletions

File tree

‎client/client.gen.go‎

Lines changed: 2 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/agency_hosting/website_setups/create.go‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var CreateCmd = &cobra.Command{
1818
Long: "Provisions a new website on one of your Agency Plan hosting orders.\n\nChoose the datacenter, stack (`flavor`), and PHP version for the site. Optionally attach\nyour own `domain` — omit it, set it to `null`, or leave it unavailable and a free\n`*.hostingersite.com` subdomain is generated instead — and/or install WordPress by\nsupplying the `wordpress` details (admin account, site title, and language).\n\nCommon setups:\n- **Plain PHP site**: `flavor` set to `php-fpm`, with `settings.php.version`; omit\n `wordpress` and `type`.\n- **WordPress site**: `flavor` set to the desired WordPress version (e.g. `wp-7.0`), plus\n the `wordpress` block (admin account, title, language).\n- **Static/Node.js frontend app**: `flavor` set to `php-fpm` and `type` set to\n `node-static`.\n\nProvisioning runs in the background, so the response returns immediately with a setup UUID\nthat identifies the job. The new website becomes reachable once provisioning finishes.",
1919
Args: cobra.MatchAll(cobra.ExactArgs(1)),
2020
Run: func(cmd *cobra.Command, args []string) {
21-
utils.EnumCheck(cmd, "type", []string{"horizons", "node-static"})
21+
utils.EnumCheck(cmd, "type", []string{"node-static"})
2222
payload, err := json.Marshal(createBody(cmd))
2323
if err != nil {
2424
log.Fatal(err)
@@ -33,13 +33,11 @@ var CreateCmd = &cobra.Command{
3333
}
3434

3535
func init() {
36-
CreateCmd.Flags().StringP("clone", "", "", "Clone the new website from an existing website (JSON)")
3736
CreateCmd.Flags().StringP("datacenter-code", "", "", "Datacenter code where the website should be provisioned. Available codes depend on live capacity and are not a fixed set.")
38-
CreateCmd.Flags().StringP("derive-domain", "", "", "Derive the domain from an existing vhost (JSON)")
3937
CreateCmd.Flags().StringP("domain", "", "", "Primary domain to attach to the website. Omit or set to null to get a free auto-generated *.hostingersite.com subdomain instead.")
4038
CreateCmd.Flags().StringP("flavor", "", "", "Setup flavor: a specific WordPress version in the format `wp-<major>.<minor>` or `wp-<major>.<minor>.<patch>` (e.g. `wp-6.8.2`), or `php-fpm` for a plain PHP stack. Generic versions like `wp-latest` are not allowed.")
4139
CreateCmd.Flags().StringP("settings", "", "", "Website settings (JSON)")
42-
CreateCmd.Flags().StringP("type", "", "", "Website type (one of: horizons, node-static)")
40+
CreateCmd.Flags().StringP("type", "", "", "Website type (one of: node-static)")
4341
CreateCmd.Flags().StringP("wordpress", "", "", "WordPress installation options (JSON)")
4442
CreateCmd.MarkFlagRequired("datacenter-code")
4543
CreateCmd.MarkFlagRequired("flavor")
@@ -48,16 +46,8 @@ func init() {
4846

4947
func createBody(cmd *cobra.Command) map[string]any {
5048
body := map[string]any{}
51-
if cmd.Flags().Changed("clone") {
52-
v, _ := cmd.Flags().GetString("clone")
53-
body["clone"] = utils.JSONValue(v, "clone")
54-
}
5549
datacenterCodeVal, _ := cmd.Flags().GetString("datacenter-code")
5650
body["datacenter_code"] = datacenterCodeVal
57-
if cmd.Flags().Changed("derive-domain") {
58-
v, _ := cmd.Flags().GetString("derive-domain")
59-
body["derive_domain"] = utils.JSONValue(v, "derive-domain")
60-
}
6151
if cmd.Flags().Changed("domain") {
6252
v, _ := cmd.Flags().GetString("domain")
6353
body["domain"] = v

‎docs/hostinger_agency-hosting_website-setups_create.md‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ hostinger agency-hosting website-setups create <order_id> [flags]
2929
### Options
3030

3131
```
32-
--clone string Clone the new website from an existing website (JSON)
3332
--datacenter-code string Datacenter code where the website should be provisioned. Available codes depend on live capacity and are not a fixed set.
34-
--derive-domain string Derive the domain from an existing vhost (JSON)
3533
--domain string Primary domain to attach to the website. Omit or set to null to get a free auto-generated *.hostingersite.com subdomain instead.
3634
--flavor wp-<major>.<minor> Setup flavor: a specific WordPress version in the format wp-<major>.<minor> or `wp-<major>.<minor>.<patch>` (e.g. `wp-6.8.2`), or `php-fpm` for a plain PHP stack. Generic versions like `wp-latest` are not allowed.
3735
-h, --help help for create
3836
--settings string Website settings (JSON)
39-
--type string Website type (one of: horizons, node-static)
37+
--type string Website type (one of: node-static)
4038
--wordpress string WordPress installation options (JSON)
4139
```
4240

0 commit comments

Comments
 (0)