Skip to content

Commit ee39395

Browse files
fix(webhosting): fix CLI configuration for webhosting (#2894)
Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent 9c3f4e3 commit ee39395

7 files changed

+238
-49
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Delete a hosting with the given ID.
4+
5+
USAGE:
6+
scw webhosting hosting delete [arg=value ...]
7+
8+
EXAMPLES:
9+
Delete a Hosting with the given ID
10+
scw webhosting hosting delete hosting-id=a3244331-5d32-4e36-9bf9-b60233e201c7
11+
12+
ARGS:
13+
hosting-id Hosting ID
14+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
15+
16+
FLAGS:
17+
-h, --help help for delete
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
The set of DNS record of a specific domain associated to a hosting.
4+
5+
USAGE:
6+
scw webhosting hosting get-dns-records [arg=value ...]
7+
8+
EXAMPLES:
9+
Get DNS records associated to the given domain
10+
scw webhosting hosting get-dns-records domain=foo.com
11+
12+
ARGS:
13+
domain Domain associated to the DNS records
14+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
15+
16+
FLAGS:
17+
-h, --help help for get-dns-records
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Restore a hosting with the given ID.
4+
5+
USAGE:
6+
scw webhosting hosting restore [arg=value ...]
7+
8+
EXAMPLES:
9+
Restore a Hosting with the given ID
10+
scw webhosting hosting restore hosting-id=a3244331-5d32-4e36-9bf9-b60233e201c7
11+
12+
ARGS:
13+
hosting-id Hosting ID
14+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
15+
16+
FLAGS:
17+
-h, --help help for restore
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-webhosting-hosting-usage.golden

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ USAGE:
66
scw webhosting hosting <command>
77

88
AVAILABLE COMMANDS:
9-
create Create a hosting
10-
get Get a hosting
11-
list List all hostings
12-
update Update a hosting
9+
create Create a hosting
10+
delete Delete a hosting
11+
get Get a hosting
12+
get-dns-records Get the DNS records
13+
list List all hostings
14+
restore Restore a hosting
15+
update Update a hosting
1316

1417
FLAGS:
1518
-h, --help help for hosting

cmd/scw/testdata/test-all-usage-webhosting-usage.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ USAGE:
66
scw webhosting <command>
77

88
AVAILABLE COMMANDS:
9-
dns-record DNS record management commands
109
hosting Hosting management commands
1110
offer Offer management commands
1211

docs/commands/webhosting.md

Lines changed: 83 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,109 +2,134 @@
22
# Documentation for `scw webhosting`
33
Webhosting API.
44

5-
- [DNS record management commands](#dns-record-management-commands)
6-
- [Get the DNS records](#get-the-dns-records)
75
- [Hosting management commands](#hosting-management-commands)
86
- [Create a hosting](#create-a-hosting)
7+
- [Delete a hosting](#delete-a-hosting)
98
- [Get a hosting](#get-a-hosting)
9+
- [Get the DNS records](#get-the-dns-records)
1010
- [List all hostings](#list-all-hostings)
11+
- [Restore a hosting](#restore-a-hosting)
1112
- [Update a hosting](#update-a-hosting)
1213
- [Offer management commands](#offer-management-commands)
1314
- [List all offers](#list-all-offers)
1415

1516

16-
## DNS record management commands
17+
## Hosting management commands
1718

18-
The set of DNS record of a specific domain associated to a hosting.
19+
A Scaleway web hosting associated with a domain name.
1920

2021

2122

22-
### Get the DNS records
23+
### Create a hosting
2324

24-
Get the DNS records of a specified domain.
25+
Create a hosting.
2526

2627
**Usage:**
2728

2829
```
29-
scw webhosting dns-record get [arg=value ...]
30+
scw webhosting hosting create [arg=value ...]
3031
```
3132

3233

3334
**Args:**
3435

3536
| Name | | Description |
3637
|------|---|-------------|
37-
| domain | Required | Domain associated to the DNS records |
38+
| offer-id | | ID of the selected offer for the hosting |
39+
| project-id | | Project ID to use. If none is passed the default project ID will be used |
40+
| email | | Contact email of the client for the hosting |
41+
| tags.{index} | | The tags of the hosting |
42+
| domain | | The domain name of the hosting |
43+
| option-ids.{index} | | IDs of the selected options for the hosting |
3844
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
3945

4046

41-
**Examples:**
4247

48+
### Delete a hosting
49+
50+
Delete a hosting with the given ID.
51+
52+
**Usage:**
4353

44-
Get DNS records associated to the given domain
4554
```
46-
scw webhosting dns-record get domain=foo.com
55+
scw webhosting hosting delete [arg=value ...]
4756
```
4857

4958

59+
**Args:**
60+
61+
| Name | | Description |
62+
|------|---|-------------|
63+
| hosting-id | Required | Hosting ID |
64+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
65+
5066

67+
**Examples:**
5168

52-
## Hosting management commands
5369

54-
A Scaleway web hosting associated with a domain name.
70+
Delete a Hosting with the given ID
71+
```
72+
scw webhosting hosting delete hosting-id=a3244331-5d32-4e36-9bf9-b60233e201c7
73+
```
5574

5675

5776

58-
### Create a hosting
5977

60-
Create a hosting.
78+
### Get a hosting
79+
80+
Get the details of a Hosting with the given ID.
6181

6282
**Usage:**
6383

6484
```
65-
scw webhosting hosting create [arg=value ...]
85+
scw webhosting hosting get [arg=value ...]
6686
```
6787

6888

6989
**Args:**
7090

7191
| Name | | Description |
7292
|------|---|-------------|
73-
| offer-id | | ID of the selected offer for the hosting |
74-
| project-id | | Project ID to use. If none is passed the default project ID will be used |
75-
| email | | Contact email of the client for the hosting |
76-
| tags.{index} | | The tags of the hosting |
77-
| domain | | The domain name of the hosting |
78-
| option-ids.{index} | | IDs of the selected options for the hosting |
93+
| hosting-id | Required | Hosting ID |
7994
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
8095

8196

97+
**Examples:**
8298

83-
### Get a hosting
8499

85-
Get the details of a Hosting with the given ID.
100+
Get a Hosting with the given ID
101+
```
102+
scw webhosting hosting get hosting-id=a3244331-5d32-4e36-9bf9-b60233e201c7
103+
```
104+
105+
106+
107+
108+
### Get the DNS records
109+
110+
The set of DNS record of a specific domain associated to a hosting.
86111

87112
**Usage:**
88113

89114
```
90-
scw webhosting hosting get [arg=value ...]
115+
scw webhosting hosting get-dns-records [arg=value ...]
91116
```
92117

93118

94119
**Args:**
95120

96121
| Name | | Description |
97122
|------|---|-------------|
98-
| hosting-id | Required | Hosting ID |
123+
| domain | Required | Domain associated to the DNS records |
99124
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
100125

101126

102127
**Examples:**
103128

104129

105-
Get a Hosting with the given ID
130+
Get DNS records associated to the given domain
106131
```
107-
scw webhosting hosting get hosting-id=a3244331-5d32-4e36-9bf9-b60233e201c7
132+
scw webhosting hosting get-dns-records domain=foo.com
108133
```
109134

110135

@@ -145,6 +170,36 @@ scw webhosting hosting list project-id=a3244331-5d32-4e36-9bf9-b60233e201c7 orga
145170

146171

147172

173+
### Restore a hosting
174+
175+
Restore a hosting with the given ID.
176+
177+
**Usage:**
178+
179+
```
180+
scw webhosting hosting restore [arg=value ...]
181+
```
182+
183+
184+
**Args:**
185+
186+
| Name | | Description |
187+
|------|---|-------------|
188+
| hosting-id | Required | Hosting ID |
189+
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
190+
191+
192+
**Examples:**
193+
194+
195+
Restore a Hosting with the given ID
196+
```
197+
scw webhosting hosting restore hosting-id=a3244331-5d32-4e36-9bf9-b60233e201c7
198+
```
199+
200+
201+
202+
148203
### Update a hosting
149204

150205
Update a hosting.

0 commit comments

Comments
 (0)