Skip to content

Commit cb09597

Browse files
authored
feat(webhosting): update list offer with hosting id and its available offers (#2853)
1 parent 75ed180 commit cb09597

7 files changed

Lines changed: 15 additions & 6 deletions

File tree

cmd/scw/testdata/test-all-usage-config-set-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ARGS:
2121
[default-organization-id] A default Scaleway organization id
2222
[default-project-id] A default Scaleway project id
2323
[default-region] A default Scaleway region (fr-par | nl-ams | pl-waw)
24-
[default-zone] A default Scaleway zone (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2)
24+
[default-zone] A default Scaleway zone (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2)
2525
[send-telemetry] Set to false to disable telemetry
2626

2727
FLAGS:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ ARGS:
1919
[order-by] Define the order of the returned hostings (price_asc)
2020
[without-options] Select only offers, no options
2121
[only-options] Select only options
22+
[hosting-id] Define a specific hosting id (optional)
2223
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
2324

2425
FLAGS:

docs/commands/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ scw config set [arg=value ...]
214214
| default-organization-id | | A default Scaleway organization id |
215215
| default-project-id | | A default Scaleway project id |
216216
| default-region | One of: `fr-par`, `nl-ams`, `pl-waw` | A default Scaleway region |
217-
| default-zone | One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | A default Scaleway zone |
217+
| default-zone | One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `nl-ams-3`, `pl-waw-1`, `pl-waw-2` | A default Scaleway zone |
218218
| send-telemetry | | Set to false to disable telemetry |
219219

220220

docs/commands/webhosting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ scw webhosting offer list [arg=value ...]
213213
| order-by | One of: `price_asc` | Define the order of the returned hostings |
214214
| without-options | | Select only offers, no options |
215215
| only-options | | Select only options |
216+
| hosting-id | | Define a specific hosting id (optional) |
216217
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
217218

218219

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/kubernetes-client/go-base v0.0.0-20190205182333-3d0e39759d98
1919
github.com/mattn/go-colorable v0.1.13
2020
github.com/mattn/go-isatty v0.0.17
21-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.13.0.20230306133533-4d68c6d85168
21+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.14
2222
github.com/spf13/cobra v1.6.1
2323
github.com/spf13/pflag v1.0.5
2424
github.com/stretchr/testify v1.8.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw
7070
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
7171
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
7272
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
73-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.13.0.20230306133533-4d68c6d85168 h1:bUf4bR8Ye8gjF6i7ZyPLmmIQ9C4U2G/5PopVCY0LYUo=
74-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.13.0.20230306133533-4d68c6d85168/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
73+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.14 h1:yFl3jyaSVLNYXlnNYM5z2pagEk1dYQhfr1p20T1NyKY=
74+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.14/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
7575
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
7676
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
7777
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=

internal/namespaces/webhosting/v1alpha1/webhosting_cli.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,13 @@ func webhostingOfferList() *core.Command {
386386
Deprecated: false,
387387
Positional: false,
388388
},
389+
{
390+
Name: "hosting-id",
391+
Short: `Define a specific hosting id (optional)`,
392+
Required: false,
393+
Deprecated: false,
394+
Positional: false,
395+
},
389396
core.RegionArgSpec(scw.RegionFrPar),
390397
},
391398
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -399,7 +406,7 @@ func webhostingOfferList() *core.Command {
399406
Examples: []*core.Example{
400407
{
401408
Short: "List all offers available for purchase",
402-
ArgsJSON: `{"only_options":false,"without_options":false}`,
409+
ArgsJSON: `{"hosting_id":"a3244331-5d32-4e36-9bf9-b60233e201c7","only_options":false,"without_options":false}`,
403410
},
404411
{
405412
Short: "List only offers, no options",

0 commit comments

Comments
 (0)