Skip to content

Commit c0be288

Browse files
committed
feat: update generated APIs
1 parent 7304607 commit c0be288

File tree

8 files changed

+90
-4
lines changed

8 files changed

+90
-4
lines changed

cmd/scw/testdata/test-all-usage-audit-trail-event-list-usage.golden

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ USAGE:
88
ARGS:
99
[project-id] (Optional) ID of the Project containing the Audit Trail events
1010
[resource-type] (Optional) Returns a paginated list of Scaleway resources' features (unknown_type | secm_secret | secm_secret_version | kube_cluster | kube_pool | kube_node | kube_acl | keym_key | iam_user | iam_application | iam_group | iam_policy | iam_api_key | iam_ssh_key | secret_manager_secret | secret_manager_version | key_manager_key)
11-
[method-name] (Optional) Name of the method or the API call performed
11+
[method-name] (Optional) Name of the method of the API call performed
1212
[status] (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied
1313
[recorded-after] (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default
1414
[recorded-before] (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default
1515
[order-by] (recorded_at_desc | recorded_at_asc)
1616
[page-size]
1717
[page-token]
1818
[product-name] (Optional) Name of the Scaleway resource in a hyphenated format
19+
[service-name] (Optional) Name of the service of the API call performed
1920
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
2021
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
2122

cmd/scw/testdata/test-all-usage-billing-discount-list-usage.golden

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
List all discounts for your organization and usable categories, products, offers, references, regions and zones where the discount can be applied.
3+
List all discounts for your Organization and usable categories, products, offers, references, regions and zones where the discount can be applied. As a reseller:
4+
- If you do not specify an `organization_id` you will list the discounts applied to your own Organization and your customers
5+
- If you indicate your `organization_id` you will list only the discounts applied to your Organization
6+
- If you indicate `the organization_id` of one of your customers, you will list the discounts applied to their Organization.
47

58
USAGE:
69
scw billing discount list [arg=value ...]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Put a Public Gateway in IPAM mode, so that it can be used with the Public Gateways API v2. This call is idempotent.
4+
5+
USAGE:
6+
scw vpc-gw gateway migrate-to-v2 <gateway-id ...> [arg=value ...]
7+
8+
ARGS:
9+
gateway-id ID of the gateway to put into IPAM mode
10+
[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 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
11+
12+
FLAGS:
13+
-h, --help help for migrate-to-v2
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ AVAILABLE COMMANDS:
1111
enable-ip-mobility Upgrade a Public Gateway to IP mobility
1212
get Get a Public Gateway
1313
list List Public Gateways
14+
migrate-to-v2 Put a Public Gateway in IPAM mode
1415
refresh-ssh-keys Refresh a Public Gateway's SSH keys
1516
update Update a Public Gateway
1617
upgrade Upgrade a Public Gateway to the latest version and/or to a different commercial offer type

docs/commands/audit-trail.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ scw audit-trail event list [arg=value ...]
3030
|------|---|-------------|
3131
| project-id | | (Optional) ID of the Project containing the Audit Trail events |
3232
| resource-type | One of: `unknown_type`, `secm_secret`, `secm_secret_version`, `kube_cluster`, `kube_pool`, `kube_node`, `kube_acl`, `keym_key`, `iam_user`, `iam_application`, `iam_group`, `iam_policy`, `iam_api_key`, `iam_ssh_key`, `secret_manager_secret`, `secret_manager_version`, `key_manager_key` | (Optional) Returns a paginated list of Scaleway resources' features |
33-
| method-name | | (Optional) Name of the method or the API call performed |
33+
| method-name | | (Optional) Name of the method of the API call performed |
3434
| status | | (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied |
3535
| recorded-after | | (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default |
3636
| recorded-before | | (Optional) The `recorded_before` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns `now` by default |
3737
| order-by | One of: `recorded_at_desc`, `recorded_at_asc` | |
3838
| page-size | | |
3939
| page-token | | |
4040
| product-name | | (Optional) Name of the Scaleway resource in a hyphenated format |
41+
| service-name | | (Optional) Name of the service of the API call performed |
4142
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
4243
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams` | Region to target. If none is passed will use default region from the config |
4344

docs/commands/billing.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ Discount management commands.
7070

7171
### List discounts
7272

73-
List all discounts for your organization and usable categories, products, offers, references, regions and zones where the discount can be applied.
73+
List all discounts for your Organization and usable categories, products, offers, references, regions and zones where the discount can be applied. As a reseller:
74+
- If you do not specify an `organization_id` you will list the discounts applied to your own Organization and your customers
75+
- If you indicate your `organization_id` you will list only the discounts applied to your Organization
76+
- If you indicate `the organization_id` of one of your customers, you will list the discounts applied to their Organization.
7477

7578
**Usage:**
7679

docs/commands/vpc-gw.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ This API allows you to manage your Public Gateways.
2121
- [Upgrade a Public Gateway to IP mobility](#upgrade-a-public-gateway-to-ip-mobility)
2222
- [Get a Public Gateway](#get-a-public-gateway)
2323
- [List Public Gateways](#list-public-gateways)
24+
- [Put a Public Gateway in IPAM mode](#put-a-public-gateway-in-ipam-mode)
2425
- [Refresh a Public Gateway's SSH keys](#refresh-a-public-gateway's-ssh-keys)
2526
- [Update a Public Gateway](#update-a-public-gateway)
2627
- [Upgrade a Public Gateway to the latest version and/or to a different commercial offer type](#upgrade-a-public-gateway-to-the-latest-version-andor-to-a-different-commercial-offer-type)
@@ -438,6 +439,26 @@ scw vpc-gw gateway list [arg=value ...]
438439

439440

440441

442+
### Put a Public Gateway in IPAM mode
443+
444+
Put a Public Gateway in IPAM mode, so that it can be used with the Public Gateways API v2. This call is idempotent.
445+
446+
**Usage:**
447+
448+
```
449+
scw vpc-gw gateway migrate-to-v2 <gateway-id ...> [arg=value ...]
450+
```
451+
452+
453+
**Args:**
454+
455+
| Name | | Description |
456+
|------|---|-------------|
457+
| gateway-id | Required | ID of the gateway to put into IPAM mode |
458+
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `nl-ams-3`, `pl-waw-1`, `pl-waw-2`, `pl-waw-3` | Zone to target. If none is passed will use default zone from the config |
459+
460+
461+
441462
### Refresh a Public Gateway's SSH keys
442463

443464
Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself.

internal/namespaces/vpcgw/v1/vpcgw_cli.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func GetGeneratedCommands() *core.Commands {
6363
vpcGwIPUpdate(),
6464
vpcGwIPDelete(),
6565
vpcGwGatewayRefreshSSHKeys(),
66+
vpcGwGatewayMigrateToV2(),
6667
)
6768
}
6869
func vpcGwRoot() *core.Command {
@@ -2259,3 +2260,39 @@ func vpcGwGatewayRefreshSSHKeys() *core.Command {
22592260
},
22602261
}
22612262
}
2263+
2264+
func vpcGwGatewayMigrateToV2() *core.Command {
2265+
return &core.Command{
2266+
Short: `Put a Public Gateway in IPAM mode`,
2267+
Long: `Put a Public Gateway in IPAM mode, so that it can be used with the Public Gateways API v2. This call is idempotent.`,
2268+
Namespace: "vpc-gw",
2269+
Resource: "gateway",
2270+
Verb: "migrate-to-v2",
2271+
// Deprecated: false,
2272+
ArgsType: reflect.TypeOf(vpcgw.MigrateToV2Request{}),
2273+
ArgSpecs: core.ArgSpecs{
2274+
{
2275+
Name: "gateway-id",
2276+
Short: `ID of the gateway to put into IPAM mode`,
2277+
Required: true,
2278+
Deprecated: false,
2279+
Positional: true,
2280+
},
2281+
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
2282+
},
2283+
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
2284+
request := args.(*vpcgw.MigrateToV2Request)
2285+
2286+
client := core.ExtractClient(ctx)
2287+
api := vpcgw.NewAPI(client)
2288+
e = api.MigrateToV2(request)
2289+
if e != nil {
2290+
return nil, e
2291+
}
2292+
return &core.SuccessResult{
2293+
Resource: "gateway",
2294+
Verb: "migrate-to-v2",
2295+
}, nil
2296+
},
2297+
}
2298+
}

0 commit comments

Comments
 (0)