Skip to content

Commit 9d69db3

Browse files
authored
feat(vpc): enable vpc connectors cli generation (#5423)
1 parent e096674 commit 9d69db3

11 files changed

+563
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ AVAILABLE COMMANDS:
1010
route Route management command
1111
rule Rule management command
1212
vpc VPC management command
13+
vpc-connector VPC connector management command
1314

1415
FLAGS:
1516
-h, --help help for vpc
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create a new VPC connector in the specified region.
4+
5+
USAGE:
6+
scw vpc vpc-connector create [arg=value ...]
7+
8+
ARGS:
9+
name=<generated> Name for the VPC connector
10+
[tags.{index}] Tags for the VPC connector
11+
[vpc-id] VPC ID to filter for. Only connectors belonging to this VPC will be returned
12+
[target-vpc-id] Target VPC ID to filter for. Only connectors belonging to this target VPC will be returned
13+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
14+
15+
FLAGS:
16+
-h, --help help for create
17+
--list-sub-commands List all subcommands
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Delete a VPC connector specified by its VPC connector ID.
4+
5+
USAGE:
6+
scw vpc vpc-connector delete <vpc-connector-id ...> [arg=value ...]
7+
8+
ARGS:
9+
vpc-connector-id VPC connector ID
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
11+
12+
FLAGS:
13+
-h, --help help for delete
14+
--list-sub-commands List all subcommands
15+
16+
GLOBAL FLAGS:
17+
-c, --config string The path to the config file
18+
-D, --debug Enable debug mode
19+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
20+
-p, --profile string The config profile to use
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Retrieve details of an existing VPC connector, specified by its VPC connector ID.
4+
5+
USAGE:
6+
scw vpc vpc-connector get <vpc-connector-id ...> [arg=value ...]
7+
8+
ARGS:
9+
vpc-connector-id VPC connector ID
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
11+
12+
FLAGS:
13+
-h, --help help for get
14+
--list-sub-commands List all subcommands
15+
16+
GLOBAL FLAGS:
17+
-c, --config string The path to the config file
18+
-D, --debug Enable debug mode
19+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
20+
-p, --profile string The config profile to use
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
List existing VPC connectors in the specified region.
4+
5+
USAGE:
6+
scw vpc vpc-connector list [arg=value ...]
7+
8+
ARGS:
9+
[order-by] Sort order of the returned VPC connectors (created_at_asc | created_at_desc | name_asc | name_desc)
10+
[name] Name to filter for. Only connectors with names containing this string will be returned
11+
[tags.{index}] Tags to filter for. Only connectors with one or more matching tags will be returned
12+
[project-id] Project ID to filter for. Only connectors belonging to this Project will be returned
13+
[vpc-id] VPC ID to filter for. Only connectors belonging to this VPC will be returned
14+
[target-vpc-id] Target VPC ID to filter for. Only connectors belonging to this target VPC will be returned
15+
[status] Status of the VPC connector (unknown_vpc_connector_status | orphan | peered | conflict)
16+
[organization-id] Organization ID to filter for. Only connectors belonging to this Organization will be returned
17+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
18+
19+
FLAGS:
20+
-h, --help help for list
21+
--list-sub-commands List all subcommands
22+
23+
GLOBAL FLAGS:
24+
-c, --config string The path to the config file
25+
-D, --debug Enable debug mode
26+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
27+
-p, --profile string The config profile to use
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Update parameters including name and tags of the specified VPC connector.
4+
5+
USAGE:
6+
scw vpc vpc-connector update <vpc-connector-id ...> [arg=value ...]
7+
8+
ARGS:
9+
vpc-connector-id VPC connector ID
10+
[name] Name for the VPC connector
11+
[tags.{index}] Tags for the VPC connector
12+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
13+
14+
FLAGS:
15+
-h, --help help for update
16+
--list-sub-commands List all subcommands
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
VPC peering connectors.
4+
5+
USAGE:
6+
scw vpc vpc-connector <command>
7+
8+
AVAILABLE COMMANDS:
9+
create Create a VPC connector
10+
delete Delete a VPC connector
11+
get Get a VPC connector
12+
list List VPC connectors
13+
update Update VPC connector
14+
15+
FLAGS:
16+
-h, --help help for vpc-connector
17+
--list-sub-commands List all subcommands
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use
24+
25+
Use "scw vpc vpc-connector [command] --help" for more information about a command.

docs/commands/vpc.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ This API allows you to manage your Virtual Private Clouds (VPCs) and Private Net
2626
- [Get a VPC](#get-a-vpc)
2727
- [List VPCs](#list-vpcs)
2828
- [Update VPC](#update-vpc)
29+
- [VPC connector management command](#vpc-connector-management-command)
30+
- [Create a VPC connector](#create-a-vpc-connector)
31+
- [Delete a VPC connector](#delete-a-vpc-connector)
32+
- [Get a VPC connector](#get-a-vpc-connector)
33+
- [List VPC connectors](#list-vpc-connectors)
34+
- [Update VPC connector](#update-vpc-connector)
2935

3036

3137
## Private network management command
@@ -515,3 +521,120 @@ scw vpc vpc update <vpc-id ...> [arg=value ...]
515521

516522

517523

524+
## VPC connector management command
525+
526+
VPC peering connectors.
527+
528+
529+
### Create a VPC connector
530+
531+
Create a new VPC connector in the specified region.
532+
533+
**Usage:**
534+
535+
```
536+
scw vpc vpc-connector create [arg=value ...]
537+
```
538+
539+
540+
**Args:**
541+
542+
| Name | | Description |
543+
|------|---|-------------|
544+
| name | Required<br />Default: `<generated>` | Name for the VPC connector |
545+
| tags.{index} | | Tags for the VPC connector |
546+
| vpc-id | | VPC ID to filter for. Only connectors belonging to this VPC will be returned |
547+
| target-vpc-id | | Target VPC ID to filter for. Only connectors belonging to this target VPC will be returned |
548+
| 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 |
549+
550+
551+
552+
### Delete a VPC connector
553+
554+
Delete a VPC connector specified by its VPC connector ID.
555+
556+
**Usage:**
557+
558+
```
559+
scw vpc vpc-connector delete <vpc-connector-id ...> [arg=value ...]
560+
```
561+
562+
563+
**Args:**
564+
565+
| Name | | Description |
566+
|------|---|-------------|
567+
| vpc-connector-id | Required | VPC connector ID |
568+
| 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 |
569+
570+
571+
572+
### Get a VPC connector
573+
574+
Retrieve details of an existing VPC connector, specified by its VPC connector ID.
575+
576+
**Usage:**
577+
578+
```
579+
scw vpc vpc-connector get <vpc-connector-id ...> [arg=value ...]
580+
```
581+
582+
583+
**Args:**
584+
585+
| Name | | Description |
586+
|------|---|-------------|
587+
| vpc-connector-id | Required | VPC connector ID |
588+
| 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 |
589+
590+
591+
592+
### List VPC connectors
593+
594+
List existing VPC connectors in the specified region.
595+
596+
**Usage:**
597+
598+
```
599+
scw vpc vpc-connector list [arg=value ...]
600+
```
601+
602+
603+
**Args:**
604+
605+
| Name | | Description |
606+
|------|---|-------------|
607+
| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | Sort order of the returned VPC connectors |
608+
| name | | Name to filter for. Only connectors with names containing this string will be returned |
609+
| tags.{index} | | Tags to filter for. Only connectors with one or more matching tags will be returned |
610+
| project-id | | Project ID to filter for. Only connectors belonging to this Project will be returned |
611+
| vpc-id | | VPC ID to filter for. Only connectors belonging to this VPC will be returned |
612+
| target-vpc-id | | Target VPC ID to filter for. Only connectors belonging to this target VPC will be returned |
613+
| status | One of: `unknown_vpc_connector_status`, `orphan`, `peered`, `conflict` | Status of the VPC connector |
614+
| organization-id | | Organization ID to filter for. Only connectors belonging to this Organization will be returned |
615+
| 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 |
616+
617+
618+
619+
### Update VPC connector
620+
621+
Update parameters including name and tags of the specified VPC connector.
622+
623+
**Usage:**
624+
625+
```
626+
scw vpc vpc-connector update <vpc-connector-id ...> [arg=value ...]
627+
```
628+
629+
630+
**Args:**
631+
632+
| Name | | Description |
633+
|------|---|-------------|
634+
| vpc-connector-id | Required | VPC connector ID |
635+
| name | | Name for the VPC connector |
636+
| tags.{index} | | Tags for the VPC connector |
637+
| 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 |
638+
639+
640+

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.28.0
2525
github.com/moby/go-archive v0.2.0
2626
github.com/opencontainers/go-digest v1.0.0
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260318153310-43bb17f8bec8
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260323144744-f9a0138f3588
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.10.2
3030
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
476476
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
477477
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
478478
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
479-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260318153310-43bb17f8bec8 h1:Q+nIbu4BcGVqzQrFI2ku0jJ29o99xoC1fbKIZCxGTxM=
480-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260318153310-43bb17f8bec8/go.mod h1:SKcIU6lqwljcpjOlTnSfMFfURd/XT+08spQyqN9OTWA=
479+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260323144744-f9a0138f3588 h1:h6Yk+vh+26TAP7l79AY6mP6SI5NH93BZ7FuHusAilYQ=
480+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260323144744-f9a0138f3588/go.mod h1:SKcIU6lqwljcpjOlTnSfMFfURd/XT+08spQyqN9OTWA=
481481
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
482482
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
483483
github.com/secure-systems-lab/go-securesystemslib v0.10.0 h1:l+H5ErcW0PAehBNrBxoGv1jjNpGYdZ9RcheFkB2WI14=

0 commit comments

Comments
 (0)