Skip to content

Commit acc6495

Browse files
feat(partner): add support for CLI generation (#5408)
Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent cacfaf4 commit acc6495

13 files changed

+688
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create a new organization.
4+
5+
USAGE:
6+
scw partner organization create [arg=value ...]
7+
8+
ARGS:
9+
partner-id Your personal `partner_id`. This is the same as your Organization ID.
10+
email The email of the new organization owner
11+
organization-name The name of the organization you want to create. Usually the company name
12+
owner-firstname The first name of the new organization owner
13+
owner-lastname The last name of the new organization owner
14+
[phone-number] The phone number of the new organization owner
15+
customer-id A custom ID for the customer in your own infrastructure
16+
[siren-number] A SIREN number for the customer
17+
18+
FLAGS:
19+
-h, --help help for create
20+
--list-sub-commands List all subcommands
21+
22+
GLOBAL FLAGS:
23+
-c, --config string The path to the config file
24+
-D, --debug Enable debug mode
25+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
26+
-p, --profile string The config profile to use
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+
Get an organization.
4+
5+
USAGE:
6+
scw partner organization get [arg=value ...]
7+
8+
ARGS:
9+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
10+
11+
FLAGS:
12+
-h, --help help for get
13+
--list-sub-commands List all subcommands
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
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+
List Organizations.
4+
5+
USAGE:
6+
scw partner organization list [arg=value ...]
7+
8+
ARGS:
9+
[order-by] (created_at_asc | created_at_desc)
10+
[status] Only list organizations with this status (unknown_status | opened | locked | closed)
11+
[email] Only list organizations created with this email
12+
[customer-id] Only list organizations attached to this Customer ID
13+
[locked-by] Only list organizations locked by a certain entity (unknown_locked_by | partner | scaleway)
14+
15+
FLAGS:
16+
-h, --help help for list
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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Lock an organization.
4+
5+
USAGE:
6+
scw partner organization lock [arg=value ...]
7+
8+
ARGS:
9+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
10+
11+
FLAGS:
12+
-h, --help help for lock
13+
--list-sub-commands List all subcommands
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
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+
Unlock an organization.
4+
5+
USAGE:
6+
scw partner organization unlock [arg=value ...]
7+
8+
ARGS:
9+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
10+
11+
FLAGS:
12+
-h, --help help for unlock
13+
--list-sub-commands List all subcommands
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
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Update an organization.
4+
5+
USAGE:
6+
scw partner organization update [arg=value ...]
7+
8+
ARGS:
9+
[email] The new email
10+
[name] The new name
11+
[owner-firstname] The first name of the new owner
12+
[owner-lastname] The last name of the new owner
13+
[phone-number] The phone number of the new owner
14+
[customer-id] Customer ID associated with this organization
15+
[comment] A comment about the organization
16+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
17+
18+
FLAGS:
19+
-h, --help help for update
20+
--list-sub-commands List all subcommands
21+
22+
GLOBAL FLAGS:
23+
-c, --config string The path to the config file
24+
-D, --debug Enable debug mode
25+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
26+
-p, --profile string The config profile to use
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Organization management commands.
4+
5+
USAGE:
6+
scw partner organization <command>
7+
8+
AVAILABLE COMMANDS:
9+
create Create a new organization
10+
get Get an organization
11+
list List Organizations
12+
lock Lock an organization
13+
unlock Unlock an organization
14+
update Update an organization
15+
16+
FLAGS:
17+
-h, --help help for organization
18+
--list-sub-commands List all subcommands
19+
20+
GLOBAL FLAGS:
21+
-c, --config string The path to the config file
22+
-D, --debug Enable debug mode
23+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
24+
-p, --profile string The config profile to use
25+
26+
Use "scw partner organization [command] --help" for more information about a command.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Scaleway Partner API ( for partner only ).
4+
5+
USAGE:
6+
scw partner <command>
7+
8+
AVAILABLE COMMANDS:
9+
organization Organization management commands
10+
11+
FLAGS:
12+
-h, --help help for partner
13+
--list-sub-commands List all subcommands
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
20+
21+
Use "scw partner [command] --help" for more information about a command.

cmd/scw/testdata/test-main-usage-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ SECURITY COMMANDS:
6767
audit-trail This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
6868
iam This API allows you to manage Identity and Access Management (IAM) across your Scaleway Organizations, Projects and resources
6969
keymanager Key Manager API
70+
partner Scaleway Partner API ( for partner only )
7071
secret Secret Manager API
7172

7273
SERVERLESS COMMANDS:

commands/commands.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import (
4242
mnq "github.com/scaleway/scaleway-cli/v2/internal/namespaces/mnq/v1beta1"
4343
mongodb "github.com/scaleway/scaleway-cli/v2/internal/namespaces/mongodb/v1alpha1"
4444
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/object/v1"
45+
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/partner/v1"
4546
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1"
4647
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/redis/v1"
4748
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/registry/v1"
@@ -118,6 +119,7 @@ func GetCommands() *core.Commands {
118119
searchdb.GetCommands(),
119120
datalab.GetCommands(),
120121
datawarehouse.GetCommands(),
122+
partner.GetCommands(),
121123
)
122124

123125
if beta {

0 commit comments

Comments
 (0)