Skip to content

Commit

Permalink
feat(mongodb): add support for CLI generation (scaleway#4203)
Browse files Browse the repository at this point in the history
Co-authored-by: Rémy Léone <[email protected]>
  • Loading branch information
scaleway-bot and remyleone authored Oct 21, 2024
1 parent 7ae177a commit 452b95a
Show file tree
Hide file tree
Showing 31 changed files with 1,377 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create a new MongoDB™ Database Instance.

USAGE:
scw mongodb instance create [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[name] Name of the Database Instance
version Version of the MongoDB™ engine
[tags.{index}] Tags to apply to the Database Instance
node-number Number of node to use for the Database Instance
node-type Type of node to use for the Database Instance
user-name Username created when the Database Instance is created
password Password of the initial user
[volume.volume-size] Volume size
[volume.volume-type] Type of volume where data is stored (unknown_type | sbs_5k | sbs_15k)
[endpoints.{index}.private-network.private-network-id] UUID of the private network
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for create

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a given MongoDB™ Database Instance, specified by the `region` and `instance_id` parameters. Deleting a MongoDB™ Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost.

USAGE:
scw mongodb instance delete <instance-id ...> [arg=value ...]

ARGS:
instance-id UUID of the Database Instance to delete
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for delete

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve the certificate of a given Database Instance, specified by the `instance_id` parameter.

USAGE:
scw mongodb instance get-certificate <instance-id ...> [arg=value ...]

ARGS:
instance-id UUID of the Database Instance
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for get-certificate

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-instance-get-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve information about a given MongoDB™ Database Instance, specified by the `region` and `instance_id` parameters. Its full details, including name, status, IP address and port, are returned in the response object.

USAGE:
scw mongodb instance get <instance-id ...> [arg=value ...]

ARGS:
instance-id UUID of the Database Instance
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for get

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
23 changes: 23 additions & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-instance-list-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List all MongoDB™ Database Instances in the specified region, for a given Scaleway Project. By default, the MongoDB™ Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.

USAGE:
scw mongodb instance list [arg=value ...]

ARGS:
[tags.{index}] List Database Instances that have a given tag
[name] Lists Database Instances that match a name pattern
[order-by] Criteria to use when ordering Database Instance listings (created_at_asc | created_at_desc | name_asc | name_desc | status_asc | status_desc)
[project-id] Project ID to list the Database Instance of
[organization-id] Organization ID the Database Instance belongs to
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)

FLAGS:
-h, --help help for list

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update the parameters of a MongoDB™ Database Instance.

USAGE:
scw mongodb instance update <instance-id ...> [arg=value ...]

ARGS:
instance-id UUID of the Database Instance to update
[name] Name of the Database Instance
[tags.{index}] Tags of a Database Instance
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for update

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Upgrade your current Database Instance specifications like volume size.

USAGE:
scw mongodb instance upgrade <instance-id ...> [arg=value ...]

ARGS:
instance-id UUID of the Database Instance you want to upgrade
[volume-size] Increase your block storage volume size
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for upgrade

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
26 changes: 26 additions & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-instance-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
A Managed Database for MongoDB instance is composed of one or multiple dedicated compute nodes running a single database engine.

USAGE:
scw mongodb instance <command>

AVAILABLE COMMANDS:
create Create a MongoDB™ Database Instance
delete Delete a MongoDB™ Database Instance
get Get a MongoDB™ Database Instance
get-certificate Get the certificate of a Database Instance
list List MongoDB™ Database Instances
update Update a MongoDB™ Database Instance
upgrade Upgrade a Database Instance

FLAGS:
-h, --help help for instance

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw mongodb instance [command] --help" for more information about a command.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List available node types.

USAGE:
scw mongodb node-type list [arg=value ...]

ARGS:
[include-disabled-types] Defines whether or not to include disabled types
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)

FLAGS:
-h, --help help for list

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
20 changes: 20 additions & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-node-type-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Node types powering your instance.

USAGE:
scw mongodb node-type <command>

AVAILABLE COMMANDS:
list List available node types

FLAGS:
-h, --help help for node-type

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw mongodb node-type [command] --help" for more information about a command.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create a new snapshot of a Database Instance. You must define the `name` and `instance_id` parameters in the request.

USAGE:
scw mongodb snapshot create <instance-id ...> [arg=value ...]

ARGS:
instance-id UUID of the Database Instance to snapshot
[name] Name of the snapshot
[expires-at] Expiration date of the snapshot (must follow the ISO 8601 format)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for create

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to delete.

USAGE:
scw mongodb snapshot delete <snapshot-id ...> [arg=value ...]

ARGS:
snapshot-id UUID of the snapshot
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for delete

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-snapshot-get-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to retrieve.

USAGE:
scw mongodb snapshot get <snapshot-id ...> [arg=value ...]

ARGS:
snapshot-id UUID of the snapshot
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for get

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
23 changes: 23 additions & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-snapshot-list-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List snapshots. You can include the `instance_id` or `project_id` in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.

USAGE:
scw mongodb snapshot list [arg=value ...]

ARGS:
[instance-id] Instance ID the snapshots belongs to
[name] Lists Database snapshots that match a name pattern
[order-by] Criteria to use when ordering snapshot listings (created_at_asc | created_at_desc | name_asc | name_desc | expires_at_asc | expires_at_desc)
[project-id] Project ID to list the snapshots of
[organization-id] Organization ID the snapshots belongs to
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)

FLAGS:
-h, --help help for list

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Restore a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to restore, the `instance_name` of the new Database Instance, `node_type` of the new Database Instance and `node_number` of the new Database Instance.

USAGE:
scw mongodb snapshot restore <snapshot-id ...> [arg=value ...]

ARGS:
snapshot-id UUID of the snapshot
instance-name Name of the new Database Instance
node-type Node type to use for the new Database Instance
node-number Number of nodes to use for the new Database Instance
[volume.volume-type] Type of volume where data is stored (unknown_type | sbs_5k | sbs_15k)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for restore

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
24 changes: 24 additions & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-snapshot-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Snapshots of your instance.

USAGE:
scw mongodb snapshot <command>

AVAILABLE COMMANDS:
create Create a Database Instance snapshot
delete Delete a Database Instance snapshot
get Get a Database Instance snapshot
list List snapshots
restore Restore a Database Instance snapshot

FLAGS:
-h, --help help for snapshot

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw mongodb snapshot [command] --help" for more information about a command.
24 changes: 24 additions & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
This API allows you to manage your Managed Databases for MongoDB.

USAGE:
scw mongodb <command>

AVAILABLE COMMANDS:
instance Instance management commands
node-type Node types management commands
snapshot Snapshot management commands
user User management commands
version MongoDB™ version management commands

FLAGS:
-h, --help help for mongodb

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw mongodb [command] --help" for more information about a command.
Loading

0 comments on commit 452b95a

Please sign in to comment.