Skip to content

Commit 06de920

Browse files
authored
feat(iam): enable CLI generation (#2909)
1 parent 09f35a5 commit 06de920

13 files changed

+218
-4
lines changed
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+
Move a Virtual MAC from a given Flexible IP onto another Flexible IP.
4+
5+
USAGE:
6+
scw fip mac move [arg=value ...]
7+
8+
ARGS:
9+
fip-id
10+
[dst-fip-id]
11+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1)
12+
13+
FLAGS:
14+
-h, --help help for move
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

cmd/scw/testdata/test-all-usage-fip-mac-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ AVAILABLE COMMANDS:
99
create Generate a virtual MAC on a given Flexible IP
1010
delete Remove a virtual MAC from a Flexible IP
1111
duplicate Duplicate a Virtual MAC
12+
move Move a virtual MAC
1213

1314
FLAGS:
1415
-h, --help help for mac
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+
Overwrite users and applications configuration in a group. Any information that you add using this command will overwrite the previous configuration.
4+
5+
USAGE:
6+
scw iam group set-members [arg=value ...]
7+
8+
ARGS:
9+
group-id
10+
user-ids.{index}
11+
application-ids.{index}
12+
13+
FLAGS:
14+
-h, --help help for set-members
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
21+
22+
SEE ALSO:
23+
# Remove a group member
24+
scw iam group remove-member
25+
26+
# Create a group
27+
scw iam group create

cmd/scw/testdata/test-all-usage-iam-group-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AVAILABLE COMMANDS:
1212
get Get a group
1313
list List groups
1414
remove-member Remove a user or an application from a group
15+
set-members Overwrite users and applications of a group
1516
update Update a group
1617

1718
FLAGS:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Clone a policy. You must define specify the `policy_id` parameter in your request.
4+
5+
USAGE:
6+
scw iam policy clone [arg=value ...]
7+
8+
ARGS:
9+
policy-id
10+
11+
FLAGS:
12+
-h, --help help for clone
13+
14+
GLOBAL FLAGS:
15+
-c, --config string The path to the config file
16+
-D, --debug Enable debug mode
17+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
18+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-iam-policy-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ USAGE:
66
scw iam policy <command>
77

88
AVAILABLE COMMANDS:
9+
clone Clone a policy
910
create Create a new policy
1011
delete Delete a policy
1112
get Get an existing policy

docs/commands/fip.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Flexible IP API.
1414
- [Generate a virtual MAC on a given Flexible IP](#generate-a-virtual-mac-on-a-given-flexible-ip)
1515
- [Remove a virtual MAC from a Flexible IP](#remove-a-virtual-mac-from-a-flexible-ip)
1616
- [Duplicate a Virtual MAC](#duplicate-a-virtual-mac)
17+
- [Move a virtual MAC](#move-a-virtual-mac)
1718

1819

1920
## Flexible IP management commands
@@ -244,3 +245,24 @@ scw fip mac duplicate [arg=value ...]
244245

245246

246247

248+
### Move a virtual MAC
249+
250+
Move a Virtual MAC from a given Flexible IP onto another Flexible IP.
251+
252+
**Usage:**
253+
254+
```
255+
scw fip mac move [arg=value ...]
256+
```
257+
258+
259+
**Args:**
260+
261+
| Name | | Description |
262+
|------|---|-------------|
263+
| fip-id | Required | |
264+
| dst-fip-id | | |
265+
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |
266+
267+
268+

docs/commands/iam.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ IAM API.
2121
- [Get a group](#get-a-group)
2222
- [List groups](#list-groups)
2323
- [Remove a user or an application from a group](#remove-a-user-or-an-application-from-a-group)
24+
- [Overwrite users and applications of a group](#overwrite-users-and-applications-of-a-group)
2425
- [Update a group](#update-a-group)
2526
- [JWTs management commands](#jwts-management-commands)
2627
- [Delete a JWT](#delete-a-jwt)
@@ -29,6 +30,7 @@ IAM API.
2930
- [Permission sets management commands](#permission-sets-management-commands)
3031
- [List permission sets](#list-permission-sets)
3132
- [Policies management commands](#policies-management-commands)
33+
- [Clone a policy](#clone-a-policy)
3234
- [Create a new policy](#create-a-new-policy)
3335
- [Delete a policy](#delete-a-policy)
3436
- [Get an existing policy](#get-an-existing-policy)
@@ -433,6 +435,27 @@ scw iam group remove-member <group-id ...> [arg=value ...]
433435

434436

435437

438+
### Overwrite users and applications of a group
439+
440+
Overwrite users and applications configuration in a group. Any information that you add using this command will overwrite the previous configuration.
441+
442+
**Usage:**
443+
444+
```
445+
scw iam group set-members [arg=value ...]
446+
```
447+
448+
449+
**Args:**
450+
451+
| Name | | Description |
452+
|------|---|-------------|
453+
| group-id | Required | |
454+
| user-ids.{index} | Required | |
455+
| application-ids.{index} | Required | |
456+
457+
458+
436459
### Update a group
437460

438461
Update the parameters of group, including `name` and `description`.
@@ -548,6 +571,25 @@ scw iam permission-set list [arg=value ...]
548571
Policies management commands.
549572

550573

574+
### Clone a policy
575+
576+
Clone a policy. You must define specify the `policy_id` parameter in your request.
577+
578+
**Usage:**
579+
580+
```
581+
scw iam policy clone [arg=value ...]
582+
```
583+
584+
585+
**Args:**
586+
587+
| Name | | Description |
588+
|------|---|-------------|
589+
| policy-id | Required | |
590+
591+
592+
551593
### Create a new policy
552594

553595
Create a new application. You must define the `name` parameter in the request. You can specify parameters such as `user_id`, `groups_id`, `application_id`, `no_principal`, `rules` and its child attributes.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/moby/buildkit v0.11.4
2222
github.com/opencontainers/go-digest v1.0.0
2323
github.com/pkg/errors v0.9.1
24-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230322094918-cd420ebc2d11
24+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230322175238-aa881483e689
2525
github.com/spf13/cobra v1.6.1
2626
github.com/spf13/pflag v1.0.5
2727
github.com/stretchr/testify v1.8.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
192192
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
193193
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
194194
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
195-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230322094918-cd420ebc2d11 h1:tZBnGI0NIyTUV9+UYQrTFw1gqIcY/TcUBCfLrC/IvKY=
196-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230322094918-cd420ebc2d11/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
195+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230322175238-aa881483e689 h1:QPpApIAOwB3/9ZPu+SOu5bjoN7keDalTCpyCf2VYx4w=
196+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230322175238-aa881483e689/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
197197
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
198198
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
199199
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=

0 commit comments

Comments
 (0)