Skip to content

Commit 8e3fc76

Browse files
chore: regenerate CLI from OpenAPI spec
1 parent 80ae264 commit 8e3fc76

8 files changed

Lines changed: 233 additions & 0 deletions

client/client.gen.go

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

cmd/agency_hosting/agency_hosting.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package agency_hosting
22

33
import (
4+
"github.com/hostinger/api-cli/cmd/agency_hosting/cache"
45
"github.com/hostinger/api-cli/cmd/agency_hosting/cron_jobs"
56
"github.com/hostinger/api-cli/cmd/agency_hosting/datacenters"
67
"github.com/hostinger/api-cli/cmd/agency_hosting/domains"
@@ -17,6 +18,7 @@ var GroupCmd = &cobra.Command{
1718
}
1819

1920
func init() {
21+
GroupCmd.AddCommand(cache.GroupCmd)
2022
GroupCmd.AddCommand(cron_jobs.GroupCmd)
2123
GroupCmd.AddCommand(datacenters.GroupCmd)
2224
GroupCmd.AddCommand(domains.GroupCmd)

cmd/agency_hosting/cache/cache.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package cache
2+
3+
import (
4+
"github.com/spf13/cobra"
5+
)
6+
7+
var GroupCmd = &cobra.Command{
8+
Use: "cache",
9+
Short: "Cache commands",
10+
}
11+
12+
func init() {
13+
GroupCmd.AddCommand(ClearPlanWebsiteCmd)
14+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cache
2+
3+
import (
4+
"context"
5+
"log"
6+
7+
"github.com/hostinger/api-cli/api"
8+
"github.com/hostinger/api-cli/output"
9+
"github.com/spf13/cobra"
10+
)
11+
12+
var ClearPlanWebsiteCmd = &cobra.Command{
13+
Use: "clear-plan-website <website_uid>",
14+
Short: "Clear Agency Plan website cache",
15+
Long: "Clears cache for all domains associated with an Agency Plan website, including its preview domain.\n\nThis operation clears all cache types for the website.",
16+
Args: cobra.MatchAll(cobra.ExactArgs(1)),
17+
Run: func(cmd *cobra.Command, args []string) {
18+
r, err := api.Request().AgencyHostingClearAgencyPlanWebsiteCacheV1WithResponse(context.TODO(), args[0])
19+
if err != nil {
20+
log.Fatal(err)
21+
}
22+
23+
output.Format(cmd, r.Body, r.StatusCode())
24+
},
25+
}

docs/hostinger_agency-hosting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Agency Hosting commands
1818
### SEE ALSO
1919

2020
* [hostinger](hostinger.md) - Hostinger API Command Line Interface
21+
* [hostinger agency-hosting cache](hostinger_agency-hosting_cache.md) - Cache commands
2122
* [hostinger agency-hosting cron-jobs](hostinger_agency-hosting_cron-jobs.md) - Cron Jobs commands
2223
* [hostinger agency-hosting datacenters](hostinger_agency-hosting_datacenters.md) - Datacenters commands
2324
* [hostinger agency-hosting domains](hostinger_agency-hosting_domains.md) - Domains commands
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## hostinger agency-hosting cache
2+
3+
Cache commands
4+
5+
### Options
6+
7+
```
8+
-h, --help help for cache
9+
```
10+
11+
### Options inherited from parent commands
12+
13+
```
14+
--config string Config file (default is $HOME/.hostinger.yaml)
15+
--format string Output format type (json|table|tree), default: table
16+
```
17+
18+
### SEE ALSO
19+
20+
* [hostinger agency-hosting](hostinger_agency-hosting.md) - Agency Hosting commands
21+
* [hostinger agency-hosting cache clear-plan-website](hostinger_agency-hosting_cache_clear-plan-website.md) - Clear Agency Plan website cache
22+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## hostinger agency-hosting cache clear-plan-website
2+
3+
Clear Agency Plan website cache
4+
5+
### Synopsis
6+
7+
Clears cache for all domains associated with an Agency Plan website, including its preview domain.
8+
9+
This operation clears all cache types for the website.
10+
11+
```
12+
hostinger agency-hosting cache clear-plan-website <website_uid> [flags]
13+
```
14+
15+
### Options
16+
17+
```
18+
-h, --help help for clear-plan-website
19+
```
20+
21+
### Options inherited from parent commands
22+
23+
```
24+
--config string Config file (default is $HOME/.hostinger.yaml)
25+
--format string Output format type (json|table|tree), default: table
26+
```
27+
28+
### SEE ALSO
29+
30+
* [hostinger agency-hosting cache](hostinger_agency-hosting_cache.md) - Cache commands
31+

manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@
359359
"method": "PUT",
360360
"path": "/api/agency-hosting/v1/websites/{website_uid}/domains/{from_domain}"
361361
},
362+
"agency-hosting_clearAgencyPlanWebsiteCacheV1": {
363+
"command": "hostinger agency-hosting cache clear-plan-website",
364+
"method": "DELETE",
365+
"path": "/api/agency-hosting/v1/websites/{website_uid}/cache"
366+
},
362367
"agency-hosting_createAgencyPlanWebsiteCronJobV1": {
363368
"command": "hostinger agency-hosting cron-jobs create-plan-website",
364369
"method": "POST",

0 commit comments

Comments
 (0)