Skip to content

Commit

Permalink
feat(vpc): filter private_networks by ids and add support for nl-ams-…
Browse files Browse the repository at this point in the history
…2 and pl-waw-2 (#2685)

Co-authored-by: Rémy Léone <rleone@scaleway.com>
  • Loading branch information
scaleway-bot and remyleone committed Dec 27, 2022
1 parent 15fa7a9 commit 6b45df6
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[tags.{index}] The private networks tags
[subnets.{index}] Private network subnets CIDR
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)
[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 | pl-waw-2)

FLAGS:
-h, --help help for create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USAGE:

ARGS:
private-network-id The private network ID
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)
[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 | pl-waw-2)

FLAGS:
-h, --help help for delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USAGE:

ARGS:
private-network-id The private network id
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)
[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 | pl-waw-2)

FLAGS:
-h, --help help for get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ USAGE:
scw vpc private-network list [arg=value ...]

ARGS:
[order-by] The sort order of the returned private networks (created_at_asc | created_at_desc | name_asc | name_desc)
[name] Filter private networks with names containing this string
[tags.{index}] Filter private networks with one or more matching tags
[project-id] The project ID on which to filter the returned private networks
[organization-id] The organization ID on which to filter the returned private networks
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)
[order-by] The sort order of the returned private networks (created_at_asc | created_at_desc | name_asc | name_desc)
[name] Filter private networks with names containing this string
[tags.{index}] Filter private networks with one or more matching tags
[project-id] The project ID on which to filter the returned private networks
[private-network-ids.{index}] The PrivateNetwork IDs on which to filter the returned private networks
[organization-id] The organization ID on which to filter the returned private networks
[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 | pl-waw-2)

FLAGS:
-h, --help help for list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ARGS:
[name] The name of the private network
[tags.{index}] The private networks tags
[subnets.{index}] Private network subnets CIDR
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)
[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 | pl-waw-2)

FLAGS:
-h, --help help for update
Expand Down
11 changes: 6 additions & 5 deletions docs/commands/vpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ scw vpc private-network create [arg=value ...]
| project-id | | Project ID to use. If none is passed the default project ID will be used |
| tags.{index} | | The private networks tags |
| subnets.{index} | | Private network subnets CIDR |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -61,7 +61,7 @@ scw vpc private-network delete <private-network-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| private-network-id | Required | The private network ID |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -81,7 +81,7 @@ scw vpc private-network get <private-network-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| private-network-id | Required | The private network id |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -104,8 +104,9 @@ scw vpc private-network list [arg=value ...]
| name | | Filter private networks with names containing this string |
| tags.{index} | | Filter private networks with one or more matching tags |
| project-id | | The project ID on which to filter the returned private networks |
| private-network-ids.{index} | | The PrivateNetwork IDs on which to filter the returned private networks |
| organization-id | | The organization ID on which to filter the returned private networks |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -128,7 +129,7 @@ scw vpc private-network update <private-network-id ...> [arg=value ...]
| name | | The name of the private network |
| tags.{index} | | The private networks tags |
| subnets.{index} | | Private network subnets CIDR |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config |



17 changes: 12 additions & 5 deletions internal/namespaces/vpc/v1/vpc_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,21 @@ func vpcPrivateNetworkList() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "private-network-ids.{index}",
Short: `The PrivateNetwork IDs on which to filter the returned private networks`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "organization-id",
Short: `The organization ID on which to filter the returned private networks`,
Required: false,
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*vpc.ListPrivateNetworksRequest)
Expand Down Expand Up @@ -148,7 +155,7 @@ func vpcPrivateNetworkCreate() *core.Command {
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*vpc.CreatePrivateNetworkRequest)
Expand Down Expand Up @@ -178,7 +185,7 @@ func vpcPrivateNetworkGet() *core.Command {
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*vpc.GetPrivateNetworkRequest)
Expand Down Expand Up @@ -229,7 +236,7 @@ func vpcPrivateNetworkUpdate() *core.Command {
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*vpc.UpdatePrivateNetworkRequest)
Expand Down Expand Up @@ -259,7 +266,7 @@ func vpcPrivateNetworkDelete() *core.Command {
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*vpc.DeletePrivateNetworkRequest)
Expand Down

0 comments on commit 6b45df6

Please sign in to comment.