Skip to content

Commit 4e753a1

Browse files
authored
feat(vpc/v2): add property to enable or disable routing in a VPC (#3688)
1 parent 8118b2e commit 4e753a1

File tree

6 files changed

+21
-3
lines changed

6 files changed

+21
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ARGS:
99
name=<generated> Name for the VPC
1010
[project-id] Project ID to use. If none is passed the default project ID will be used
1111
[tags.{index}] Tags for the VPC
12+
[enable-routing] Enable routing between Private Networks in the VPC
1213
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1314

1415
FLAGS:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ARGS:
1111
[tags.{index}] Tags to filter for. Only VPCs with one more more matching tags will be returned
1212
[project-id] Project ID to filter for. Only VPCs belonging to this Project will be returned
1313
[is-default] Defines whether to filter only for VPCs which are the default one for their Project
14+
[routing-enabled] Defines whether to filter only for VPCs which route traffic between their Private Networks
1415
[organization-id] Organization ID to filter for. Only VPCs belonging to this Organization will be returned
1516
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
1617

docs/commands/vpc.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ scw vpc vpc create [arg=value ...]
221221
| name | Required<br />Default: `<generated>` | Name for the VPC |
222222
| project-id | | Project ID to use. If none is passed the default project ID will be used |
223223
| tags.{index} | | Tags for the VPC |
224+
| enable-routing | | Enable routing between Private Networks in the VPC |
224225
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
225226

226227

@@ -285,6 +286,7 @@ scw vpc vpc list [arg=value ...]
285286
| tags.{index} | | Tags to filter for. Only VPCs with one more more matching tags will be returned |
286287
| project-id | | Project ID to filter for. Only VPCs belonging to this Project will be returned |
287288
| is-default | | Defines whether to filter only for VPCs which are the default one for their Project |
289+
| routing-enabled | | Defines whether to filter only for VPCs which route traffic between their Private Networks |
288290
| organization-id | | Organization ID to filter for. Only VPCs belonging to this Organization will be returned |
289291
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |
290292

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.11.6
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/pkg/errors v0.9.1
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.24.0.20240220132654-d9816b542928
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.24.0.20240228154852-9a8334dbced6
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.8.0
3030
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
392392
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
393393
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
394394
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
395-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.24.0.20240220132654-d9816b542928 h1:E9j40l0wkkxGH5eRsCWm4PMK8deMx9MRxCWIBsjkXWk=
396-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.24.0.20240220132654-d9816b542928/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
395+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.24.0.20240228154852-9a8334dbced6 h1:jTy1BMbYctq8zg2CjywIBbc1uETiZ5Iagr1hpLFI+Co=
396+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.24.0.20240228154852-9a8334dbced6/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
397397
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
398398
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
399399
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/vpc/v2/vpc_cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ func vpcVpcList() *core.Command {
123123
Deprecated: false,
124124
Positional: false,
125125
},
126+
{
127+
Name: "routing-enabled",
128+
Short: `Defines whether to filter only for VPCs which route traffic between their Private Networks`,
129+
Required: false,
130+
Deprecated: false,
131+
Positional: false,
132+
},
126133
{
127134
Name: "organization-id",
128135
Short: `Organization ID to filter for. Only VPCs belonging to this Organization will be returned`,
@@ -178,6 +185,13 @@ func vpcVpcCreate() *core.Command {
178185
Deprecated: false,
179186
Positional: false,
180187
},
188+
{
189+
Name: "enable-routing",
190+
Short: `Enable routing between Private Networks in the VPC`,
191+
Required: false,
192+
Deprecated: false,
193+
Positional: false,
194+
},
181195
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
182196
},
183197
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)