From 72f06dd70b71e967ce931f1064ab61663d79efd8 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 7 Jul 2022 16:30:28 +0000 Subject: [PATCH 1/2] feat: update generated cli --- .../test-all-usage-instance-ip-get-usage.golden | 2 +- .../test-all-usage-instance-ip-list-usage.golden | 2 +- docs/commands/instance.md | 4 ++-- go.mod | 6 +----- go.sum | 4 ++-- internal/namespaces/instance/v1/instance_cli.go | 14 +++++++------- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/cmd/scw/testdata/test-all-usage-instance-ip-get-usage.golden b/cmd/scw/testdata/test-all-usage-instance-ip-get-usage.golden index 26480e3a0b..d9e87ab781 100644 --- a/cmd/scw/testdata/test-all-usage-instance-ip-get-usage.golden +++ b/cmd/scw/testdata/test-all-usage-instance-ip-get-usage.golden @@ -13,7 +13,7 @@ EXAMPLES: scw instance ip get 11111111-1111-1111-1111-111111111111 zone=fr-par-1 Get an IP using directly the given IP address - scw instance ip get + scw instance ip get 51.15.253.183 ARGS: ip The IP ID or address to get diff --git a/cmd/scw/testdata/test-all-usage-instance-ip-list-usage.golden b/cmd/scw/testdata/test-all-usage-instance-ip-list-usage.golden index 1901af137c..835ce79290 100644 --- a/cmd/scw/testdata/test-all-usage-instance-ip-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-instance-ip-list-usage.golden @@ -13,9 +13,9 @@ EXAMPLES: scw instance ip list zone=fr-par-1 ARGS: - [name] Filter on the IP address (Works as a LIKE operation on the IP address) [project-id] The project ID the IPs are reserved in [tags.{index}] Filter IPs with these exact tags (to filter with several tags, use commas to separate them) + [name] Filter on the IP address (Works as a LIKE operation on the IP address) [organization-id] The organization ID the IPs are reserved in [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | pl-waw-1) diff --git a/docs/commands/instance.md b/docs/commands/instance.md index 3a949ee907..206d08bbec 100644 --- a/docs/commands/instance.md +++ b/docs/commands/instance.md @@ -456,7 +456,7 @@ scw instance ip get 11111111-1111-1111-1111-111111111111 zone=fr-par-1 Get an IP using directly the given IP address ``` -scw instance ip get +scw instance ip get 51.15.253.183 ``` @@ -477,9 +477,9 @@ scw instance ip list [arg=value ...] | Name | | Description | |------|---|-------------| -| name | | Filter on the IP address (Works as a LIKE operation on the IP address) | | project-id | | The project ID the IPs are reserved in | | tags.{index} | | Filter IPs with these exact tags (to filter with several tags, use commas to separate them) | +| name | | Filter on the IP address (Works as a LIKE operation on the IP address) | | organization-id | | The organization ID the IPs are reserved in | | zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | diff --git a/go.mod b/go.mod index 7adf586bb9..4173a0bbd1 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/kubernetes-client/go-base v0.0.0-20190205182333-3d0e39759d98 github.com/mattn/go-colorable v0.1.12 github.com/mattn/go-isatty v0.0.14 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220707130308-7ec0786bddf2 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220707154924-556b07217bb3 github.com/spf13/cobra v1.5.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.0 @@ -32,12 +32,8 @@ require ( github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect github.com/chzyer/logex v1.2.0 // indirect github.com/chzyer/test v0.0.0-20210722231415-061457976a23 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/etdub/goparsetime v0.0.0-20160315173935-ea17b0ac3318 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/pkg/errors v0.8.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sergi/go-diff v1.2.0 // indirect golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index d811b0ce95..0b59cd2e53 100644 --- a/go.sum +++ b/go.sum @@ -57,8 +57,8 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220707130308-7ec0786bddf2 h1:whbV5sKu3tYwN11SGjH1jGQb2RxB4gCCeL9KRKfPwmg= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220707130308-7ec0786bddf2/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220707154924-556b07217bb3 h1:ySnHdnqH83uN6ZtKO/uKUsSLLx7K3UZPAv+C/fvAoHY= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220707154924-556b07217bb3/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= diff --git a/internal/namespaces/instance/v1/instance_cli.go b/internal/namespaces/instance/v1/instance_cli.go index 86c3026b37..c196de523b 100644 --- a/internal/namespaces/instance/v1/instance_cli.go +++ b/internal/namespaces/instance/v1/instance_cli.go @@ -2329,22 +2329,22 @@ func instanceIPList() *core.Command { ArgsType: reflect.TypeOf(instance.ListIPsRequest{}), ArgSpecs: core.ArgSpecs{ { - Name: "name", - Short: `Filter on the IP address (Works as a LIKE operation on the IP address)`, + Name: "project", + Short: `The project ID the IPs are reserved in`, Required: false, Deprecated: false, Positional: false, }, { - Name: "project", - Short: `The project ID the IPs are reserved in`, + Name: "tags.{index}", + Short: `Filter IPs with these exact tags (to filter with several tags, use commas to separate them)`, Required: false, Deprecated: false, Positional: false, }, { - Name: "tags.{index}", - Short: `Filter IPs with these exact tags (to filter with several tags, use commas to separate them)`, + Name: "name", + Short: `Filter on the IP address (Works as a LIKE operation on the IP address)`, Required: false, Deprecated: false, Positional: false, @@ -2503,7 +2503,7 @@ func instanceIPGet() *core.Command { }, { Short: "Get an IP using directly the given IP address", - ArgsJSON: `null`, + ArgsJSON: `{"ip":"51.15.253.183"}`, }, }, } From 089c7962cb9e779629f06021572f0e654c86fd64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Thu, 7 Jul 2022 19:01:16 +0200 Subject: [PATCH 2/2] Fix --- go.mod | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go.mod b/go.mod index 4173a0bbd1..22c3f577df 100644 --- a/go.mod +++ b/go.mod @@ -32,8 +32,12 @@ require ( github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect github.com/chzyer/logex v1.2.0 // indirect github.com/chzyer/test v0.0.0-20210722231415-061457976a23 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/etdub/goparsetime v0.0.0-20160315173935-ea17b0ac3318 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/pkg/errors v0.8.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sergi/go-diff v1.2.0 // indirect golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect )