Skip to content

Commit 89a9d1f

Browse files
feat(vpc): add support for subnets (#2302)
Co-authored-by: Rémy Léone <[email protected]>
1 parent 1942024 commit 89a9d1f

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ USAGE:
66
scw vpc private-network create [arg=value ...]
77

88
ARGS:
9-
name=<generated> The name of the private network
10-
[project-id] Project ID to use. If none is passed the default project ID will be used
11-
[tags.{index}] The private networks tags
12-
[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+
name=<generated> The name of the private network
10+
[project-id] Project ID to use. If none is passed the default project ID will be used
11+
[tags.{index}] The private networks tags
12+
[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)
1314

1415
FLAGS:
1516
-h, --help help for create

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ARGS:
99
private-network-id The private network ID
1010
[name] The name of the private network
1111
[tags.{index}] The private networks tags
12+
[subnets.{index}] Private network subnets CIDR
1213
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)
1314

1415
FLAGS:

docs/commands/vpc.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ scw vpc private-network create [arg=value ...]
4040
| name | Required<br />Default: `<generated>` | The name of the private network |
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 |
43+
| subnets.{index} | | Private network subnets CIDR |
4344
| 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 |
4445

4546

@@ -126,6 +127,7 @@ scw vpc private-network update <private-network-id ...> [arg=value ...]
126127
| private-network-id | Required | The private network ID |
127128
| name | | The name of the private network |
128129
| tags.{index} | | The private networks tags |
130+
| subnets.{index} | | Private network subnets CIDR |
129131
| 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 |
130132

131133

internal/namespaces/vpc/v1/vpc_cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ func vpcPrivateNetworkCreate() *core.Command {
141141
Deprecated: false,
142142
Positional: false,
143143
},
144+
{
145+
Name: "subnets.{index}",
146+
Short: `Private network subnets CIDR`,
147+
Required: false,
148+
Deprecated: false,
149+
Positional: false,
150+
},
144151
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
145152
},
146153
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -215,6 +222,13 @@ func vpcPrivateNetworkUpdate() *core.Command {
215222
Deprecated: false,
216223
Positional: false,
217224
},
225+
{
226+
Name: "subnets.{index}",
227+
Short: `Private network subnets CIDR`,
228+
Required: false,
229+
Deprecated: false,
230+
Positional: false,
231+
},
218232
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneNlAms1),
219233
},
220234
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)