Skip to content

Commit bc8b081

Browse files
scaleway-botCodelax
authored andcommitted
feat: update generated APIs
1 parent 9ad6f81 commit bc8b081

File tree

4 files changed

+110
-0
lines changed

4 files changed

+110
-0
lines changed
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+
Update one or more parameter/s to a given private NIC.
4+
5+
USAGE:
6+
scw instance private-nic update [arg=value ...]
7+
8+
EXAMPLES:
9+
Update tags of a private NIC
10+
scw instance private-nic update server-id=11111111-1111-1111-1111-111111111111 private-nic-id=11111111-1111-1111-1111-111111111111 tags.0=foo tags.1=bar
11+
12+
ARGS:
13+
server-id UUID of the server the private NIC will be attached to
14+
private-nic-id The private NIC unique ID
15+
[tags.{index}] Tags used to select private NIC/s
16+
[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)
17+
18+
FLAGS:
19+
-h, --help help for update
20+
21+
GLOBAL FLAGS:
22+
-c, --config string The path to the config file
23+
-D, --debug Enable debug mode
24+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
25+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-instance-private-nic-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AVAILABLE COMMANDS:
1212
delete Delete a private NIC
1313
get Get a private NIC
1414
list List all private NICs
15+
update Update a private NIC
1516

1617
FLAGS:
1718
-h, --help help for private-nic

docs/commands/instance.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Instance API
2828
- [Delete a private NIC](#delete-a-private-nic)
2929
- [Get a private NIC](#get-a-private-nic)
3030
- [List all private NICs](#list-all-private-nics)
31+
- [Update a private NIC](#update-a-private-nic)
3132
- [Security group management commands](#security-group-management-commands)
3233
- [Remove all rules of a security group](#remove-all-rules-of-a-security-group)
3334
- [Create a security group](#create-a-security-group)
@@ -930,6 +931,38 @@ scw instance private-nic list server-id=my_server_id
930931

931932

932933

934+
### Update a private NIC
935+
936+
Update one or more parameter/s to a given private NIC.
937+
938+
**Usage:**
939+
940+
```
941+
scw instance private-nic update [arg=value ...]
942+
```
943+
944+
945+
**Args:**
946+
947+
| Name | | Description |
948+
|------|---|-------------|
949+
| server-id | Required | UUID of the server the private NIC will be attached to |
950+
| private-nic-id | Required | The private NIC unique ID |
951+
| tags.{index} | | Tags used to select private NIC/s |
952+
| 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 |
953+
954+
955+
**Examples:**
956+
957+
958+
Update tags of a private NIC
959+
```
960+
scw instance private-nic update server-id=11111111-1111-1111-1111-111111111111 private-nic-id=11111111-1111-1111-1111-111111111111 tags.0=foo tags.1=bar
961+
```
962+
963+
964+
965+
933966
## Security group management commands
934967

935968
A security group is a set of firewall rules on a set of instances.

internal/namespaces/instance/v1/instance_cli.go

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ func GetGeneratedCommands() *core.Commands {
7171
instancePrivateNicList(),
7272
instancePrivateNicCreate(),
7373
instancePrivateNicGet(),
74+
instancePrivateNicUpdate(),
7475
instancePrivateNicDelete(),
7576
)
7677
}
@@ -2876,6 +2877,56 @@ func instancePrivateNicGet() *core.Command {
28762877
}
28772878
}
28782879

2880+
func instancePrivateNicUpdate() *core.Command {
2881+
return &core.Command{
2882+
Short: `Update a private NIC`,
2883+
Long: `Update one or more parameter/s to a given private NIC.`,
2884+
Namespace: "instance",
2885+
Resource: "private-nic",
2886+
Verb: "update",
2887+
// Deprecated: false,
2888+
ArgsType: reflect.TypeOf(instance.UpdatePrivateNICRequest{}),
2889+
ArgSpecs: core.ArgSpecs{
2890+
{
2891+
Name: "server-id",
2892+
Short: `UUID of the server the private NIC will be attached to`,
2893+
Required: true,
2894+
Deprecated: false,
2895+
Positional: false,
2896+
},
2897+
{
2898+
Name: "private-nic-id",
2899+
Short: `The private NIC unique ID`,
2900+
Required: true,
2901+
Deprecated: false,
2902+
Positional: false,
2903+
},
2904+
{
2905+
Name: "tags.{index}",
2906+
Short: `Tags used to select private NIC/s`,
2907+
Required: false,
2908+
Deprecated: false,
2909+
Positional: false,
2910+
},
2911+
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
2912+
},
2913+
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
2914+
request := args.(*instance.UpdatePrivateNICRequest)
2915+
2916+
client := core.ExtractClient(ctx)
2917+
api := instance.NewAPI(client)
2918+
return api.UpdatePrivateNIC(request)
2919+
2920+
},
2921+
Examples: []*core.Example{
2922+
{
2923+
Short: "Update tags of a private NIC",
2924+
ArgsJSON: `{"private_nic_id":"11111111-1111-1111-1111-111111111111","server_id":"11111111-1111-1111-1111-111111111111","tags":["foo","bar"]}`,
2925+
},
2926+
},
2927+
}
2928+
}
2929+
28792930
func instancePrivateNicDelete() *core.Command {
28802931
return &core.Command{
28812932
Short: `Delete a private NIC`,

0 commit comments

Comments
 (0)