Skip to content

Commit 6b45df6

Browse files
feat(vpc): filter private_networks by ids and add support for nl-ams-2 and pl-waw-2 (#2685)
Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent 15fa7a9 commit 6b45df6

7 files changed

+29
-20
lines changed

cmd/scw/testdata/test-all-usage-vpc-private-network-create-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARGS:
1010
[project-id] Project ID to use. If none is passed the default project ID will be used
1111
[tags.{index}] The private networks tags
1212
[subnets.{index}] Private network subnets CIDR
13-
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)
13+
[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)
1414

1515
FLAGS:
1616
-h, --help help for create

cmd/scw/testdata/test-all-usage-vpc-private-network-delete-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ USAGE:
77

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

1212
FLAGS:
1313
-h, --help help for delete

cmd/scw/testdata/test-all-usage-vpc-private-network-get-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ USAGE:
77

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

1212
FLAGS:
1313
-h, --help help for get

cmd/scw/testdata/test-all-usage-vpc-private-network-list-usage.golden

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ USAGE:
66
scw vpc private-network list [arg=value ...]
77

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

1617
FLAGS:
1718
-h, --help help for list

cmd/scw/testdata/test-all-usage-vpc-private-network-update-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARGS:
1010
[name] The name of the private network
1111
[tags.{index}] The private networks tags
1212
[subnets.{index}] Private network subnets CIDR
13-
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)
13+
[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)
1414

1515
FLAGS:
1616
-h, --help help for update

docs/commands/vpc.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ scw vpc private-network create [arg=value ...]
4141
| project-id | | Project ID to use. If none is passed the default project ID will be used |
4242
| tags.{index} | | The private networks tags |
4343
| subnets.{index} | | Private network subnets CIDR |
44-
| 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 |
44+
| 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 |
4545

4646

4747

@@ -61,7 +61,7 @@ scw vpc private-network delete <private-network-id ...> [arg=value ...]
6161
| Name | | Description |
6262
|------|---|-------------|
6363
| private-network-id | Required | The private network ID |
64-
| 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 |
64+
| 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 |
6565

6666

6767

@@ -81,7 +81,7 @@ scw vpc private-network get <private-network-id ...> [arg=value ...]
8181
| Name | | Description |
8282
|------|---|-------------|
8383
| private-network-id | Required | The private network id |
84-
| 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 |
84+
| 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 |
8585

8686

8787

@@ -104,8 +104,9 @@ scw vpc private-network list [arg=value ...]
104104
| name | | Filter private networks with names containing this string |
105105
| tags.{index} | | Filter private networks with one or more matching tags |
106106
| project-id | | The project ID on which to filter the returned private networks |
107+
| private-network-ids.{index} | | The PrivateNetwork IDs on which to filter the returned private networks |
107108
| organization-id | | The organization ID on which to filter the returned private networks |
108-
| 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 |
109+
| 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 |
109110

110111

111112

@@ -128,7 +129,7 @@ scw vpc private-network update <private-network-id ...> [arg=value ...]
128129
| name | | The name of the private network |
129130
| tags.{index} | | The private networks tags |
130131
| subnets.{index} | | Private network subnets CIDR |
131-
| 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 |
132+
| 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 |
132133

133134

134135

internal/namespaces/vpc/v1/vpc_cli.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,21 @@ func vpcPrivateNetworkList() *core.Command {
9191
Deprecated: false,
9292
Positional: false,
9393
},
94+
{
95+
Name: "private-network-ids.{index}",
96+
Short: `The PrivateNetwork IDs on which to filter the returned private networks`,
97+
Required: false,
98+
Deprecated: false,
99+
Positional: false,
100+
},
94101
{
95102
Name: "organization-id",
96103
Short: `The organization ID on which to filter the returned private networks`,
97104
Required: false,
98105
Deprecated: false,
99106
Positional: false,
100107
},
101-
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
108+
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
102109
},
103110
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
104111
request := args.(*vpc.ListPrivateNetworksRequest)
@@ -148,7 +155,7 @@ func vpcPrivateNetworkCreate() *core.Command {
148155
Deprecated: false,
149156
Positional: false,
150157
},
151-
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
158+
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
152159
},
153160
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
154161
request := args.(*vpc.CreatePrivateNetworkRequest)
@@ -178,7 +185,7 @@ func vpcPrivateNetworkGet() *core.Command {
178185
Deprecated: false,
179186
Positional: true,
180187
},
181-
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
188+
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
182189
},
183190
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
184191
request := args.(*vpc.GetPrivateNetworkRequest)
@@ -229,7 +236,7 @@ func vpcPrivateNetworkUpdate() *core.Command {
229236
Deprecated: false,
230237
Positional: false,
231238
},
232-
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
239+
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
233240
},
234241
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
235242
request := args.(*vpc.UpdatePrivateNetworkRequest)
@@ -259,7 +266,7 @@ func vpcPrivateNetworkDelete() *core.Command {
259266
Deprecated: false,
260267
Positional: true,
261268
},
262-
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
269+
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
263270
},
264271
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
265272
request := args.(*vpc.DeletePrivateNetworkRequest)

0 commit comments

Comments
 (0)