diff --git a/README.md b/README.md index 5c07ca6d6a..5f717d12f9 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ To enable beta features, you can set `SCW_ENABLE_BETA=1` in your environment. | `cockpit` | Cockpit API | [CLI](./docs/commands/cockpit.md) / [API](https://developers.scaleway.com/en/products/cockpit/api/) | | `config` | Config file management | [CLI](./docs/commands/config.md) | | `container` | Serverless Container API | [CLI](./docs/commands/container.md) / [API](https://developers.scaleway.com/en/products/containers/api/) | +| `documentdb` | DocumentDB API | [CLI](./docs/commands/document-db.md) / [API](https://www.scaleway.com/en/developers/api/document_db/) | | `dns` | DNS API | [CLI](./docs/commands/dns.md) / [API](https://developers.scaleway.com/en/products/domain/dns/api/) | | `feedback` | Send feedback to the Scaleway CLI Team! | [CLI](./docs/commands/feedback.md) | | `flexibleip` | Flexible IP API | [CLI](./docs/commands/fip.md) / [API](https://developers.scaleway.com/en/products/flexible-ip/api/) | diff --git a/cmd/scw/testdata/test-all-usage-document-db-acl-add-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-acl-add-usage.golden new file mode 100644 index 0000000000..542ae1f764 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-acl-add-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Add an additional ACL rule to a Database Instance. + +USAGE: + scw document-db acl add [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want to add ACL rules to + [rules.{index}.ip] + [rules.{index}.description] + [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 add + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-acl-delete-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-acl-delete-usage.golden new file mode 100644 index 0000000000..eda7eeaecf --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-acl-delete-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete one or more ACL rules of a Database Instance. + +USAGE: + scw document-db acl delete [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want to delete an ACL rule from + acl-rule-ips.{index} IP addresses defined in the ACL rules 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 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-acl-list-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-acl-list-usage.golden new file mode 100644 index 0000000000..7fa485803c --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-acl-list-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List the ACL rules for a given Database Instance. The response is an array of ACL objects, each one representing an ACL that denies, allows or redirects traffic based on certain conditions. + +USAGE: + scw document-db acl list [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 | 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-acl-set-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-acl-set-usage.golden new file mode 100644 index 0000000000..995bfd636f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-acl-set-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Replace all the ACL rules of a Database Instance. + +USAGE: + scw document-db acl set [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance where the ACL rules must be set + [rules.{index}.ip] + [rules.{index}.description] + [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 set + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-acl-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-acl-usage.golden new file mode 100644 index 0000000000..6b40f42148 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-acl-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Network Access Control Lists allow you to control incoming network traffic by setting up ACL rules. + +USAGE: + scw document-db acl + +AVAILABLE COMMANDS: + add Add an ACL rule to a Database Instance + delete Delete ACL rules of a Database Instance + list List ACL rules of a Database Instance + set Set ACL rules for a Database Instance + +FLAGS: + -h, --help help for acl + +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 document-db acl [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-database-create-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-database-create-usage.golden new file mode 100644 index 0000000000..f25ed2b6b6 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-database-create-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new database. You must define the `name` parameter in the request. + +USAGE: + scw document-db database create [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance where to create the database + [name] Name of the database + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-database-delete-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-database-delete-usage.golden new file mode 100644 index 0000000000..a2332df7cb --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-database-delete-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a given database on a Database Instance. You must specify, in the endpoint, the `region`, `instance_id` and `name` parameters of the database you want to delete. + +USAGE: + scw document-db database delete [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance where to delete the database + name Name of the database 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-database-list-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-database-list-usage.golden new file mode 100644 index 0000000000..0317b98913 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-database-list-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List all databases of a given Database Instance. By default, the databases 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 `name`, `managed` and `owner`. + +USAGE: + scw document-db database list [arg=value ...] + +ARGS: + [name] Name of the database + [managed] Defines whether or not the database is managed + [owner] User that owns this database + [order-by] Criteria to use when ordering database listing (name_asc | name_desc | size_asc | size_desc) + instance-id UUID of the Database Instance to list the databases of + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-database-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-database-usage.golden new file mode 100644 index 0000000000..3e45ebd2bb --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-database-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Databases can be used to store and manage sets of structured information, or data. The interaction between the user and a database is done using a Database Engine, which provides a structured query language to add, modify or delete information from the database. + +USAGE: + scw document-db database + +AVAILABLE COMMANDS: + create Create a database in a Database Instance + delete Delete a database in a Database Instance + list List databases in a Database Instance + +FLAGS: + -h, --help help for database + +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 document-db database [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-endpoint-create-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-endpoint-create-usage.golden new file mode 100644 index 0000000000..029c4c86b1 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-endpoint-create-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new endpoint for a Database Instance. You can add `load_balancer` and `private_network` specifications to the body of the request. + +USAGE: + scw document-db endpoint create [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you to which you want to add an endpoint + [endpoint-spec.private-network.private-network-id] UUID of the Private Network to be connected to the Database Instance + [endpoint-spec.private-network.service-ip] Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations. + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-endpoint-delete-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-endpoint-delete-usage.golden new file mode 100644 index 0000000000..ba66536dcb --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-endpoint-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete the endpoint of a Database Instance. You must specify the `region` and `endpoint_id` parameters of the endpoint you want to delete. Note that might need to update any environment configurations that point to the deleted endpoint. + +USAGE: + scw document-db endpoint delete [arg=value ...] + +ARGS: + endpoint-id UUID of the endpoint you want 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-endpoint-get-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-endpoint-get-usage.golden new file mode 100644 index 0000000000..f43e74774f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-endpoint-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve information about a Database Instance endpoint. Full details about the endpoint, like `ip`, `port`, `private_network` and `load_balancer` specifications are returned in the response. + +USAGE: + scw document-db endpoint get [arg=value ...] + +ARGS: + endpoint-id UUID of the endpoint you want to get + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-endpoint-migrate-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-endpoint-migrate-usage.golden new file mode 100644 index 0000000000..895886220a --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-endpoint-migrate-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Migrate an existing Database Instance endpoint to another Database Instance. + +USAGE: + scw document-db endpoint migrate [arg=value ...] + +ARGS: + endpoint-id UUID of the endpoint you want to migrate + instance-id UUID of the instance you want to attach the endpoint to + [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 migrate + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-endpoint-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-endpoint-usage.golden new file mode 100644 index 0000000000..8e7c876c33 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-endpoint-usage.golden @@ -0,0 +1,29 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +A point of connection to a Database Instance. The endpoint is associated with an IPv4 address and a port. It contains the information about whether the endpoint is read-write or not. The endpoints always point to the main node of a Database Instance. + +All endpoints have TLS enabled. You can use TLS to make your data and your passwords unreadable in transit to anyone but you. + +For added security, you can set up ACL rules to restrict access to your endpoint to a set of trusted hosts or networks of your choice. + +Load Balancers are used to forward traffic to the right node based on the node state (active/hot standby). The Load Balancers' configuration is set to cut off inactive connections if no TCP traffic is sent within a 6-hour timeframe. We recommend using connection pooling on the application side to renew database connections regularly. + +USAGE: + scw document-db endpoint + +AVAILABLE COMMANDS: + create Create a new Database Instance endpoint + delete Delete a Database Instance endpoint + get Get a Database Instance endpoint + migrate Migrate Database Instance endpoint + +FLAGS: + -h, --help help for endpoint + +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 document-db endpoint [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-engine-list-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-engine-list-usage.golden new file mode 100644 index 0000000000..2bc35987d0 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-engine-list-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List the FerretDB database engines available at Scaleway. + +USAGE: + scw document-db engine list [arg=value ...] + +ARGS: + [name] Name of the database engine + [version] Version of the database engine + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-engine-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-engine-usage.golden new file mode 100644 index 0000000000..9b419c9930 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-engine-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +A database engine is the software component that stores and retrieves your data from a database. Currently FerretDB 1.X is available. + +USAGE: + scw document-db engine + +AVAILABLE COMMANDS: + list List available database engines + +FLAGS: + -h, --help help for engine + +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 document-db engine [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-clone-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-clone-usage.golden new file mode 100644 index 0000000000..397c18b587 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-clone-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Clone a given Database Instance, specified by the `region` and `instance_id` parameters. The clone feature allows you to create a new Database Instance from an existing one. The clone includes all existing databases, users and permissions. You can create a clone on a Database Instance bigger than your current one. + +USAGE: + scw document-db instance clone [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want to clone + [name] Name of the Database Instance clone + [node-type] Node type of the clone + [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 clone + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-create-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-create-usage.golden new file mode 100644 index 0000000000..ba571066df --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-create-usage.golden @@ -0,0 +1,35 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new Database Instance. You must set the `engine`, `user_name`, `password` and `node_type` parameters. Optionally, you can specify the volume type and size. + +USAGE: + scw document-db 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 + engine Database engine of the Database Instance + user-name Username created when the Database Instance is created + password Password of the user + node-type Type of node to use for the Database Instance + [is-ha-cluster] Defines whether or not High-Availability is enabled + [disable-backup] Defines whether or not backups are disabled + [tags.{index}] Tags to apply to the Database Instance + [init-settings.{index}.name] + [init-settings.{index}.value] + [volume-type] Type of volume where data is stored (lssd, bssd, ...) (lssd | bssd) + [volume-size] Volume size when volume_type is not lssd + [init-endpoints.{index}.private-network.private-network-id] UUID of the Private Network to be connected to the Database Instance + [init-endpoints.{index}.private-network.service-ip] Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations. + [backup-same-region] Defines whether to or not to store logical backups in the same region as the Database Instance + [organization-id] Organization ID to use. If none is passed the default organization ID will be used + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-delete-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-delete-usage.golden new file mode 100644 index 0000000000..1f2798331e --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a given Database Instance, specified by the `region` and `instance_id` parameters. Deleting a Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost. + +USAGE: + scw document-db instance delete [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-get-certificate-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-get-certificate-usage.golden new file mode 100644 index 0000000000..034251609b --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-get-certificate-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve information about the TLS certificate of a given Database Instance. Details like name and content are returned in the response. + +USAGE: + scw document-db instance get-certificate [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-get-metrics-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-get-metrics-usage.golden new file mode 100644 index 0000000000..b0622b61b6 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-get-metrics-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve the time series metrics of a given Database Instance. You can define the period from which to retrieve metrics by specifying the `start_date` and `end_date`. + +USAGE: + scw document-db instance get-metrics [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance + [start-date] Start date to gather metrics from + [end-date] End date to gather metrics from + [metric-name] Name of the metric to gather + [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-metrics + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-get-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-get-usage.golden new file mode 100644 index 0000000000..34da9388dd --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve information about a given 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 document-db instance get [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-list-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-list-usage.golden new file mode 100644 index 0000000000..400db0ab05 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-list-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List all Database Instances in the specified region, for a given Scaleway Organization or Scaleway Project. By default, the 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 document-db 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 | region | status_asc | status_desc) + [project-id] Project ID to list the Database Instance of + [organization-id] Please use project_id instead + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-renew-certificate-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-renew-certificate-usage.golden new file mode 100644 index 0000000000..ec7ab314ab --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-renew-certificate-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Renew a TLS for a Database Instance. Renewing a certificate means that you will not be able to connect to your Database Instance using the previous certificate. You will also need to download and update the new certificate for all database clients. + +USAGE: + scw document-db instance renew-certificate [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want logs of + [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 renew-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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-restart-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-restart-usage.golden new file mode 100644 index 0000000000..b67da8ae20 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-restart-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Restart a given Database Instance, specified by the `region` and `instance_id` parameters. The status of the Database Instance returned in the response. + +USAGE: + scw document-db instance restart [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want to restart + [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 restart + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-update-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-update-usage.golden new file mode 100644 index 0000000000..800a556781 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-update-usage.golden @@ -0,0 +1,28 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update the parameters of a Database Instance, including name, tags and backup schedule details. + +USAGE: + scw document-db instance update [arg=value ...] + +ARGS: + [backup-schedule-frequency] In hours + [backup-schedule-retention] In days + [is-backup-schedule-disabled] Defines whether or not the backup schedule is disabled + [name] Name of the Database Instance + instance-id UUID of the Database Instance to update + [tags.{index}] Tags of a Database Instance + [logs-policy.max-age-retention] Max age (in days) of remote logs to keep on the Database Instance + [logs-policy.total-disk-retention] Max disk size of remote logs to keep on the Database Instance + [backup-same-region] Store logical backups in the same region as the Database Instance + [backup-schedule-start-hour] Defines the start time of the autobackup + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-upgrade-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-upgrade-usage.golden new file mode 100644 index 0000000000..43ed2c355f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-upgrade-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Upgrade your current Database Instance specifications like node type, high availability, volume, or the database engine version. Note that upon upgrade the `enable_ha` parameter can only be set to `true`. + +USAGE: + scw document-db instance upgrade [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want to upgrade + [node-type] Node type of the Database Instance you want to upgrade to + [enable-ha] Defines whether or not High Availability should be enabled on the Database Instance + [volume-size] Increase your Block volume size + [volume-type] Change your Database Instance storage type (lssd | bssd) + [upgradable-version-id] Update your database engine to a newer version + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-instance-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-instance-usage.golden new file mode 100644 index 0000000000..747c477344 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-instance-usage.golden @@ -0,0 +1,34 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +A Database Instance is made up of one or multiple dedicated compute nodes running a single database engine. Two node settings are available: **High-Availability (HA)**, with a main node and one replica, and **standalone** with a main node. The HA standby node is linked to the main node, using synchronous replication. Synchronous replication offers the ability to confirm that all changes intended by a transaction have been transferred and applied to the synchronous replica node, providing durability to the data. + +**Note**: HA standby nodes are not accessible to users unless the main node becomes unavailable and the standby takes over. If you wish to run queries on a read-only node, you can use [Read Replicas](#path-read-replicas-create-a-read-replica) + +Read Replicas can be used for certain read-only workflows such as Business Intelligence, or for a read-only scaling of your application. Read Replicas use asynchronous replication to replicate data from the main node. + +USAGE: + scw document-db instance + +AVAILABLE COMMANDS: + clone Clone a Database Instance + create Create a Database Instance + delete Delete a Database Instance + get Get a Database Instance + get-certificate Get the TLS certificate of a Database Instance + get-metrics Get Database Instance metrics + list List Database Instances + renew-certificate Renew the TLS certificate of a Database Instance + restart Restart Database Instance + update Update a 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 document-db instance [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-log-get-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-log-get-usage.golden new file mode 100644 index 0000000000..0f7c725d87 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-log-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve information about the logs of a Database Instance. Specify the `instance_log_id` and `region` in your request to get information such as `download_url`, `status`, `expires_at` and `created_at` about your logs in the response. + +USAGE: + scw document-db log get [arg=value ...] + +ARGS: + instance-log-id UUID of the instance_log you want + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-log-list-details-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-log-list-details-usage.golden new file mode 100644 index 0000000000..9ff22d7feb --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-log-list-details-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List remote log details. 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 document-db log list-details [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want logs of + [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 list-details + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-log-list-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-log-list-usage.golden new file mode 100644 index 0000000000..632df045be --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-log-list-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List the available logs of a Database Instance. By default, the logs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. + +USAGE: + scw document-db log list [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want logs of + [order-by] Criteria to use when ordering Database Instance logs listing (created_at_asc | created_at_desc) + [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 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-log-purge-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-log-purge-usage.golden new file mode 100644 index 0000000000..89a7e023a9 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-log-purge-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Purge a given remote log from a Database Instance. You can specify the `log_name` of the log you wish to clean from your Database Instance. + +USAGE: + scw document-db log purge [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want logs of + [log-name] Given log name to purge + [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 purge + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-log-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-log-usage.golden new file mode 100644 index 0000000000..d0eab7938a --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-log-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Instance logs management commands. + +USAGE: + scw document-db log + +AVAILABLE COMMANDS: + get Get given logs of a Database Instance + list List available logs of a Database Instance + list-details List remote Database Instance logs details + purge Purge remote Database Instance logs + +FLAGS: + -h, --help help for log + +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 document-db log [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-node-type-list-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-node-type-list-usage.golden new file mode 100644 index 0000000000..0b1e602d47 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-node-type-list-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. + +USAGE: + scw document-db 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-node-type-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-node-type-usage.golden new file mode 100644 index 0000000000..5b4986a22a --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-node-type-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Two node type ranges are available: + +* **General Purpose:** production-grade nodes designed for scalable database infrastructures. +* **Development:** sandbox environments and reliable performance for development and testing purposes. + +USAGE: + scw document-db node-type + +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 document-db node-type [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-privilege-list-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-privilege-list-usage.golden new file mode 100644 index 0000000000..5fa12be262 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-privilege-list-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List privileges of a user on a database. 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. You can define additional parameters for your query, such as `database_name` and `user_name`. + +USAGE: + scw document-db privilege list [arg=value ...] + +ARGS: + [order-by] Criteria to use when ordering privileges listing (user_name_asc | user_name_desc | database_name_asc | database_name_desc) + [database-name] Name of the database + instance-id UUID of the Database Instance + [user-name] Name of the user + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-privilege-set-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-privilege-set-usage.golden new file mode 100644 index 0000000000..6c52ad6078 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-privilege-set-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Set the privileges of a user on a database. You must define `database_name`, `user_name` and `permission` in the request body. + +USAGE: + scw document-db privilege set [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance + [database-name] Name of the database + [user-name] Name of the user + [permission] Permission to set (Read, Read/Write, All, Custom) (readonly | readwrite | all | custom | none) + [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 set + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-privilege-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-privilege-usage.golden new file mode 100644 index 0000000000..cd0a484467 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-privilege-usage.golden @@ -0,0 +1,28 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Privileges are permissions that can be granted to database users. You can manage user permissions either via the console, the Scaleway APIs. Managed Database for FerretDB provides a simplified and unified permission model through the API and the console to make things easier to manage and understand. + +Each user has associated permissions that give them access to zero or more logical databases. These include: + +* **None:** No access to the database +* **Read:** Allow users to read tables and fields in a database +* **Write:** Allow users to write content in databases. +* **Admin:** Read and write access to the data, and extended privileges depending on the database engine. + +USAGE: + scw document-db privilege + +AVAILABLE COMMANDS: + list List user privileges for a database + set Set user privileges for a database + +FLAGS: + -h, --help help for privilege + +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 document-db privilege [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-read-replica-create-endpoint-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-read-replica-create-endpoint-usage.golden new file mode 100644 index 0000000000..38074565a7 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-read-replica-create-endpoint-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new endpoint for a Read Replica. Read Replicas can have at most one direct access and one Private Network endpoint. + +USAGE: + scw document-db read-replica create-endpoint [arg=value ...] + +ARGS: + read-replica-id UUID of the Read Replica + [endpoint-spec.{index}.private-network.private-network-id] UUID of the Private Network to be connected to the Read Replica + [endpoint-spec.{index}.private-network.service-ip] Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations. + [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-endpoint + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-read-replica-create-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-read-replica-create-usage.golden new file mode 100644 index 0000000000..902ea58ed7 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-read-replica-create-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new Read Replica of a Database Instance. You must specify the `region` and the `instance_id`. You can only create a maximum of 3 Read Replicas per Database Instance. + +USAGE: + scw document-db read-replica create [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want to create a Read Replica from + [endpoint-spec.{index}.private-network.private-network-id] UUID of the Private Network to be connected to the Read Replica + [endpoint-spec.{index}.private-network.service-ip] Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations. + [same-zone] Defines whether or not to create the replica in the same Availability Zone as the main Database Instance nodes. + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-read-replica-delete-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-read-replica-delete-usage.golden new file mode 100644 index 0000000000..927d381839 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-read-replica-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a Read Replica of a Database Instance. You must specify the `region` and `read_replica_id` parameters of the Read Replica you want to delete. + +USAGE: + scw document-db read-replica delete [arg=value ...] + +ARGS: + read-replica-id UUID of the Read Replica + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-read-replica-get-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-read-replica-get-usage.golden new file mode 100644 index 0000000000..768380adae --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-read-replica-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve information about a Database Instance Read Replica. Full details about the Read Replica, like `endpoints`, `status` and `region` are returned in the response. + +USAGE: + scw document-db read-replica get [arg=value ...] + +ARGS: + read-replica-id UUID of the Read Replica + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-read-replica-reset-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-read-replica-reset-usage.golden new file mode 100644 index 0000000000..23c07f1335 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-read-replica-reset-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +When you resync a Read Replica, first it is reset, then its data is resynchronized from the primary node. Your Read Replica remains unavailable during the resync process. The duration of this process is proportional to the size of your Database Instance. +The configured endpoints do not change. + +USAGE: + scw document-db read-replica reset [arg=value ...] + +ARGS: + read-replica-id UUID of the Read Replica + [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 reset + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-read-replica-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-read-replica-usage.golden new file mode 100644 index 0000000000..2bb40c7f95 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-read-replica-usage.golden @@ -0,0 +1,36 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +A Read Replica is a live copy of a Database Instance that behaves like an Instance, but that only allows read-only connections. +The replica mirrors the data of the primary Database node and any changes made are replicated to the replica asynchronously. Read Replicas allow you to scale your Database Instance for read-heavy database workloads. They can also be used for business intelligence workloads. + +A Read Replica can have at most one direct access and one Private Network endpoint. `Loadbalancer` endpoints are not available on Read Replicas even if this resource is displayed in the Read Replica response example. + +If you want to remove a Read Replica endpoint, you can use [delete a Database Instance endpoint](#path-endpoints-delete-a-database-instance-endpoint) API call. + +Instance Access Control Lists (ACL) also apply to Read Replica direct access endpoints. + +**Limitations:** +There might be replication lags between the primary node and its Read Replica nodes. You can try to reduce this lag with some good practices: +* All your tables should have a primary key +* Don't run large transactions that modify, delete or insert lots of rows. Try to split it into several small transactions. + +USAGE: + scw document-db read-replica + +AVAILABLE COMMANDS: + create Create a Read Replica + create-endpoint Create an endpoint for a Read Replica + delete Delete a Read Replica + get Get a Read Replica + reset Resync a Read Replica + +FLAGS: + -h, --help help for read-replica + +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 document-db read-replica [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-setting-add-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-setting-add-usage.golden new file mode 100644 index 0000000000..1f1f7b5b35 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-setting-add-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Add an advanced setting to a Database Instance. You must set the `name` and the `value` of each setting. + +USAGE: + scw document-db setting add [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance you want to add settings to + [settings.{index}.name] + [settings.{index}.value] + [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 add + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-setting-delete-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-setting-delete-usage.golden new file mode 100644 index 0000000000..54b04f29df --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-setting-delete-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete an advanced setting in a Database Instance. You must specify the names of the settings you want to delete in the request. + +USAGE: + scw document-db setting delete [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance to delete settings from + setting-names.{index} Settings names 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-setting-set-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-setting-set-usage.golden new file mode 100644 index 0000000000..b88af969a5 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-setting-set-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update an advanced setting for a Database Instance. Settings added upon database engine initalization can only be defined once, and cannot, therefore, be updated. + +USAGE: + scw document-db setting set [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance where the settings must be set + [settings.{index}.name] + [settings.{index}.value] + [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 set + +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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-setting-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-setting-usage.golden new file mode 100644 index 0000000000..0dd9486a60 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-setting-usage.golden @@ -0,0 +1,26 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Advanced Database Instance settings allow you to tune the behavior of your database engines to better fit your needs. + +Available settings depend on the database engine and its version. Note that some settings can only be defined upon database engine initialization. These are called init settings. You can find a full list of the settings available in the response body of the [list available database engines](#path-databases-list-databases-in-a-database-instance) endpoint. + +Each advanced setting entry has a default value that users can override. The deletion of a setting entry will restore the setting to default value. Some of the defaults values can be different from the engine's defaults, as we optimize them to the Scaleway platform. + +USAGE: + scw document-db setting + +AVAILABLE COMMANDS: + add Add Database Instance advanced settings + delete Delete Database Instance advanced settings + set Set Database Instance advanced settings + +FLAGS: + -h, --help help for setting + +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 document-db setting [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-snapshot-create-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-snapshot-create-usage.golden new file mode 100644 index 0000000000..97b1e2cfe1 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-snapshot-create-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new snapshot of a Database Instance. You must define the `name` parameter in the request. + +USAGE: + scw document-db snapshot create [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance + name= Name of the snapshot + [expires-at] Expiration date (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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-snapshot-delete-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-snapshot-delete-usage.golden new file mode 100644 index 0000000000..68c398d19b --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-snapshot-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the `region` and `snapshot_id` parameters of the snapshot you want to delete. + +USAGE: + scw document-db snapshot delete [arg=value ...] + +ARGS: + snapshot-id UUID of the snapshot 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-snapshot-get-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-snapshot-get-usage.golden new file mode 100644 index 0000000000..e2c671d650 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-snapshot-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve information about a given snapshot, specified by its `snapshot_id` and `region`. Full details about the snapshot, like size and expiration date, are returned in the response. + +USAGE: + scw document-db snapshot get [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-snapshot-list-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-snapshot-list-usage.golden new file mode 100644 index 0000000000..63cb103bb1 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-snapshot-list-usage.golden @@ -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 document-db snapshot list [arg=value ...] + +ARGS: + [name] Name of the snapshot + [order-by] Criteria to use when ordering snapshot listing (created_at_asc | created_at_desc | name_asc | name_desc | expires_at_asc | expires_at_desc) + [instance-id] UUID of the Database Instance + [project-id] Project ID the snapshots belongs to + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-snapshot-restore-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-snapshot-restore-usage.golden new file mode 100644 index 0000000000..9c873a525c --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-snapshot-restore-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Restore a snapshot. When you restore a snapshot, a new Instance is created and billed to your account. Note that is possible to select a larger node type for your new Database Instance. However, the Block volume size will be the same as the size of the restored snapshot. All Instance settings will be restored if you chose a node type with the same or more memory size than the initial Instance. Settings will be reset to the default if your node type has less memory. + +USAGE: + scw document-db snapshot restore [arg=value ...] + +ARGS: + snapshot-id Block snapshot of the Database Instance + [instance-name] Name of the Database Instance created with the snapshot + [is-ha-cluster] Defines whether or not High Availability is enabled on the new Database Instance + [node-type] The node type used to restore 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 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-snapshot-update-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-snapshot-update-usage.golden new file mode 100644 index 0000000000..8c315334df --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-snapshot-update-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update the parameters of a snapshot of a Database Instance. You can update the `name` and `expires_at` parameters. + +USAGE: + scw document-db snapshot update [arg=value ...] + +ARGS: + snapshot-id UUID of the snapshot to update + [name] Name of the snapshot + [expires-at] Expiration date (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 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-snapshot-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-snapshot-usage.golden new file mode 100644 index 0000000000..3b67a6e038 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-snapshot-usage.golden @@ -0,0 +1,25 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +A snapshot is a consistent, instantaneous copy of the Block Storage volume of your Database Instance at a certain point in time. They are designed to recover your data in case of failure or accidental alterations of the data by a user. They allow you to quickly create a new Instance from a previous state of your database, regardless of the size of the volume. Their limitation is that, unlike backups, snapshots can only be stored in the same location as the original data. + +USAGE: + scw document-db snapshot + +AVAILABLE COMMANDS: + create Create a Database Instance snapshot + delete Delete a Database Instance snapshot + get Get a Database Instance snapshot + list List snapshots + restore Create a new Database Instance from a snapshot + update Update 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 document-db snapshot [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-usage.golden new file mode 100644 index 0000000000..1344ed3781 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-usage.golden @@ -0,0 +1,31 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Managed Document Databases API. + +USAGE: + scw document-db + +AVAILABLE COMMANDS: + acl Access Control List (ACL) management commands + database Database management commands + endpoint Endpoint management + engine Database engines commands + instance Instance management commands + log Instance logs management commands + node-type Node types management commands + privilege User privileges management commands + read-replica Read replica management + setting Setting management + snapshot Block snapshot management + user User management commands + +FLAGS: + -h, --help help for document-db + +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 document-db [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-document-db-user-create-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-user-create-usage.golden new file mode 100644 index 0000000000..87bcda96c6 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-user-create-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new user for a Database Instance. You must define the `name`, `password` and `is_admin` parameters. + +USAGE: + scw document-db user create [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance in which you want to create a user + [name] Name of the user you want to create + [password] Password of the user you want to create + [is-admin] Defines whether the user will have administrative privileges + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-user-delete-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-user-delete-usage.golden new file mode 100644 index 0000000000..f8f12842b7 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-user-delete-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a given user on a Database Instance. You must specify, in the endpoint, the `region`, `instance_id` and `name` parameters of the user you want to delete. + +USAGE: + scw document-db user delete [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance to delete the user from + name Name of the user + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-user-list-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-user-list-usage.golden new file mode 100644 index 0000000000..c102642688 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-user-list-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List all users of a given Database Instance. By default, the users returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. + +USAGE: + scw document-db user list [arg=value ...] + +ARGS: + [name] Name of the user + [order-by] Criteria to use when requesting user listing (name_asc | name_desc | is_admin_asc | is_admin_desc) + 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 | 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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-user-update-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-user-update-usage.golden new file mode 100644 index 0000000000..00a937d8fa --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-user-update-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update the parameters of a user on a Database Instance. You can update the `password` and `is_admin` parameters, but you cannot change the name of the user. + +USAGE: + scw document-db user update [arg=value ...] + +ARGS: + instance-id UUID of the Database Instance the user belongs to + name Name of the database user + [password] Password of the database user + [is-admin] Defines whether or not this user got administrative privileges + [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 diff --git a/cmd/scw/testdata/test-all-usage-document-db-user-usage.golden b/cmd/scw/testdata/test-all-usage-document-db-user-usage.golden new file mode 100644 index 0000000000..77f1a1041e --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-document-db-user-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Users are profiles to which you can attribute database-level permissions. They allow you to define permissions specific to each type of database usage. For example, users with an `admin` role can create new databases and users. + +USAGE: + scw document-db user + +AVAILABLE COMMANDS: + create Create a user for a Database Instance + delete Delete a user on a Database Instance + list List users of a Database Instance + update Update a user on a Database Instance + +FLAGS: + -h, --help help for user + +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 document-db user [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-main-usage-usage.cassette.yaml b/cmd/scw/testdata/test-main-usage-usage.cassette.yaml index f0b1939dcd..99a9ea7a46 100644 --- a/cmd/scw/testdata/test-main-usage-usage.cassette.yaml +++ b/cmd/scw/testdata/test-main-usage-usage.cassette.yaml @@ -2,7 +2,7 @@ version: 1 interactions: - request: - body: '{"message":"authentication is denied","method":"api_key","reason":"not_found","type":"denied_authentication"}' + body: '{"access_key":"SCW35HBME3ERTXWJFA0D","secret_key":null,"description":"default","created_at":"2023-02-08T13:37:42.867291Z","updated_at":"2023-02-08T13:37:42.867291Z","expires_at":null,"default_project_id":"63a66ec9-a385-4194-bc15-04aa6921274a","editable":true,"creation_ip":"195.154.228.158","user_id":"284d6fc3-6cf7-485b-bd32-efa92c2335d9"}' form: {} headers: User-Agent: @@ -10,16 +10,16 @@ interactions: url: https://api.scaleway.com/iam/v1alpha1/api-keys/SCWXXXXXXXXXXXXXXXXX method: GET response: - body: '{"message":"authentication is denied","method":"api_key","reason":"not_found","type":"denied_authentication"}' + body: '{"access_key":"SCW35HBME3ERTXWJFA0D","secret_key":null,"description":"default","created_at":"2023-02-08T13:37:42.867291Z","updated_at":"2023-02-08T13:37:42.867291Z","expires_at":null,"default_project_id":"63a66ec9-a385-4194-bc15-04aa6921274a","editable":true,"creation_ip":"195.154.228.158","user_id":"284d6fc3-6cf7-485b-bd32-efa92c2335d9"}' headers: Content-Length: - - "109" + - "340" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Mon, 17 Jul 2023 13:11:02 GMT + - Mon, 02 Oct 2023 07:56:20 GMT Server: - Scaleway API-Gateway Strict-Transport-Security: @@ -29,7 +29,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 4dbd3c92-0639-4c2b-8cca-9106da810d5c - status: 401 Unauthorized - code: 401 + - fde8dfa6-ddf7-45db-bd1d-e71f62dc371e + status: 200 OK + code: 200 duration: "" diff --git a/cmd/scw/testdata/test-main-usage-usage.golden b/cmd/scw/testdata/test-main-usage-usage.golden index 7d426c1c46..06660e8545 100644 --- a/cmd/scw/testdata/test-main-usage-usage.golden +++ b/cmd/scw/testdata/test-main-usage-usage.golden @@ -12,6 +12,7 @@ AVAILABLE COMMANDS: cockpit Cockpit API container Container as a Service API dns Domains and DNS API + document-db Managed Document Databases API fip Elastic Metal - Flexible IP API function Function as a Service API help Get help about how the CLI works diff --git a/docs/commands/document-db.md b/docs/commands/document-db.md new file mode 100644 index 0000000000..07a490894f --- /dev/null +++ b/docs/commands/document-db.md @@ -0,0 +1,1226 @@ + +# Documentation for `scw document-db` +Managed Document Databases API. + +- [Access Control List (ACL) management commands](#access-control-list-(acl)-management-commands) + - [Add an ACL rule to a Database Instance](#add-an-acl-rule-to-a-database-instance) + - [Delete ACL rules of a Database Instance](#delete-acl-rules-of-a-database-instance) + - [List ACL rules of a Database Instance](#list-acl-rules-of-a-database-instance) + - [Set ACL rules for a Database Instance](#set-acl-rules-for-a-database-instance) +- [Database management commands](#database-management-commands) + - [Create a database in a Database Instance](#create-a-database-in-a-database-instance) + - [Delete a database in a Database Instance](#delete-a-database-in-a-database-instance) + - [List databases in a Database Instance](#list-databases-in-a-database-instance) +- [Endpoint management](#endpoint-management) + - [Create a new Database Instance endpoint](#create-a-new-database-instance-endpoint) + - [Delete a Database Instance endpoint](#delete-a-database-instance-endpoint) + - [Get a Database Instance endpoint](#get-a-database-instance-endpoint) + - [Migrate Database Instance endpoint](#migrate-database-instance-endpoint) +- [Database engines commands](#database-engines-commands) + - [List available database engines](#list-available-database-engines) +- [Instance management commands](#instance-management-commands) + - [Clone a Database Instance](#clone-a-database-instance) + - [Create a Database Instance](#create-a-database-instance) + - [Delete a Database Instance](#delete-a-database-instance) + - [Get a Database Instance](#get-a-database-instance) + - [Get the TLS certificate of a Database Instance](#get-the-tls-certificate-of-a-database-instance) + - [Get Database Instance metrics](#get-database-instance-metrics) + - [List Database Instances](#list-database-instances) + - [Renew the TLS certificate of a Database Instance](#renew-the-tls-certificate-of-a-database-instance) + - [Restart Database Instance](#restart-database-instance) + - [Update a Database Instance](#update-a-database-instance) + - [Upgrade a Database Instance](#upgrade-a-database-instance) +- [Instance logs management commands](#instance-logs-management-commands) + - [Get given logs of a Database Instance](#get-given-logs-of-a-database-instance) + - [List available logs of a Database Instance](#list-available-logs-of-a-database-instance) + - [List remote Database Instance logs details](#list-remote-database-instance-logs-details) + - [Purge remote Database Instance logs](#purge-remote-database-instance-logs) +- [Node types management commands](#node-types-management-commands) + - [List available node types](#list-available-node-types) +- [User privileges management commands](#user-privileges-management-commands) + - [List user privileges for a database](#list-user-privileges-for-a-database) + - [Set user privileges for a database](#set-user-privileges-for-a-database) +- [Read replica management](#read-replica-management) + - [Create a Read Replica](#create-a-read-replica) + - [Create an endpoint for a Read Replica](#create-an-endpoint-for-a-read-replica) + - [Delete a Read Replica](#delete-a-read-replica) + - [Get a Read Replica](#get-a-read-replica) + - [Resync a Read Replica](#resync-a-read-replica) +- [Setting management](#setting-management) + - [Add Database Instance advanced settings](#add-database-instance-advanced-settings) + - [Delete Database Instance advanced settings](#delete-database-instance-advanced-settings) + - [Set Database Instance advanced settings](#set-database-instance-advanced-settings) +- [Block snapshot management](#block-snapshot-management) + - [Create a Database Instance snapshot](#create-a-database-instance-snapshot) + - [Delete a Database Instance snapshot](#delete-a-database-instance-snapshot) + - [Get a Database Instance snapshot](#get-a-database-instance-snapshot) + - [List snapshots](#list-snapshots) + - [Create a new Database Instance from a snapshot](#create-a-new-database-instance-from-a-snapshot) + - [Update a Database Instance snapshot](#update-a-database-instance-snapshot) +- [User management commands](#user-management-commands) + - [Create a user for a Database Instance](#create-a-user-for-a-database-instance) + - [Delete a user on a Database Instance](#delete-a-user-on-a-database-instance) + - [List users of a Database Instance](#list-users-of-a-database-instance) + - [Update a user on a Database Instance](#update-a-user-on-a-database-instance) + + +## Access Control List (ACL) management commands + +Network Access Control Lists allow you to control incoming network traffic by setting up ACL rules. + + + +### Add an ACL rule to a Database Instance + +Add an additional ACL rule to a Database Instance. + +**Usage:** + +``` +scw document-db acl add [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want to add ACL rules to | +| rules.{index}.ip | | | +| rules.{index}.description | | | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Delete ACL rules of a Database Instance + +Delete one or more ACL rules of a Database Instance. + +**Usage:** + +``` +scw document-db acl delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want to delete an ACL rule from | +| acl-rule-ips.{index} | Required | IP addresses defined in the ACL rules of the Database Instance | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### List ACL rules of a Database Instance + +List the ACL rules for a given Database Instance. The response is an array of ACL objects, each one representing an ACL that denies, allows or redirects traffic based on certain conditions. + +**Usage:** + +``` +scw document-db acl list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + +### Set ACL rules for a Database Instance + +Replace all the ACL rules of a Database Instance. + +**Usage:** + +``` +scw document-db acl set [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance where the ACL rules must be set | +| rules.{index}.ip | | | +| rules.{index}.description | | | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +## Database management commands + +Databases can be used to store and manage sets of structured information, or data. The interaction between the user and a database is done using a Database Engine, which provides a structured query language to add, modify or delete information from the database. + + + +### Create a database in a Database Instance + +Create a new database. You must define the `name` parameter in the request. + +**Usage:** + +``` +scw document-db database create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance where to create the database | +| name | | Name of the database | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Delete a database in a Database Instance + +Delete a given database on a Database Instance. You must specify, in the endpoint, the `region`, `instance_id` and `name` parameters of the database you want to delete. + +**Usage:** + +``` +scw document-db database delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance where to delete the database | +| name | Required | Name of the database to delete | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### List databases in a Database Instance + +List all databases of a given Database Instance. By default, the databases 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 `name`, `managed` and `owner`. + +**Usage:** + +``` +scw document-db database list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| name | | Name of the database | +| managed | | Defines whether or not the database is managed | +| owner | | User that owns this database | +| order-by | One of: `name_asc`, `name_desc`, `size_asc`, `size_desc` | Criteria to use when ordering database listing | +| instance-id | Required | UUID of the Database Instance to list the databases of | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + +## Endpoint management + +A point of connection to a Database Instance. The endpoint is associated with an IPv4 address and a port. It contains the information about whether the endpoint is read-write or not. The endpoints always point to the main node of a Database Instance. + +All endpoints have TLS enabled. You can use TLS to make your data and your passwords unreadable in transit to anyone but you. + +For added security, you can set up ACL rules to restrict access to your endpoint to a set of trusted hosts or networks of your choice. + +Load Balancers are used to forward traffic to the right node based on the node state (active/hot standby). The Load Balancers' configuration is set to cut off inactive connections if no TCP traffic is sent within a 6-hour timeframe. We recommend using connection pooling on the application side to renew database connections regularly. + + + +### Create a new Database Instance endpoint + +Create a new endpoint for a Database Instance. You can add `load_balancer` and `private_network` specifications to the body of the request. + +**Usage:** + +``` +scw document-db endpoint create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you to which you want to add an endpoint | +| endpoint-spec.private-network.private-network-id | | UUID of the Private Network to be connected to the Database Instance | +| endpoint-spec.private-network.service-ip | | Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations. | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Delete a Database Instance endpoint + +Delete the endpoint of a Database Instance. You must specify the `region` and `endpoint_id` parameters of the endpoint you want to delete. Note that might need to update any environment configurations that point to the deleted endpoint. + +**Usage:** + +``` +scw document-db endpoint delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| endpoint-id | Required | UUID of the endpoint you want to delete | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Get a Database Instance endpoint + +Retrieve information about a Database Instance endpoint. Full details about the endpoint, like `ip`, `port`, `private_network` and `load_balancer` specifications are returned in the response. + +**Usage:** + +``` +scw document-db endpoint get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| endpoint-id | Required | UUID of the endpoint you want to get | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Migrate Database Instance endpoint + +Migrate an existing Database Instance endpoint to another Database Instance. + +**Usage:** + +``` +scw document-db endpoint migrate [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| endpoint-id | Required | UUID of the endpoint you want to migrate | +| instance-id | Required | UUID of the instance you want to attach the endpoint to | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +## Database engines commands + +A database engine is the software component that stores and retrieves your data from a database. Currently FerretDB 1.X is available. + + + +### List available database engines + +List the FerretDB database engines available at Scaleway. + +**Usage:** + +``` +scw document-db engine list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| name | | Name of the database engine | +| version | | Version of the database engine | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + +## Instance management commands + +A Database Instance is made up of one or multiple dedicated compute nodes running a single database engine. Two node settings are available: **High-Availability (HA)**, with a main node and one replica, and **standalone** with a main node. The HA standby node is linked to the main node, using synchronous replication. Synchronous replication offers the ability to confirm that all changes intended by a transaction have been transferred and applied to the synchronous replica node, providing durability to the data. + +**Note**: HA standby nodes are not accessible to users unless the main node becomes unavailable and the standby takes over. If you wish to run queries on a read-only node, you can use [Read Replicas](#path-read-replicas-create-a-read-replica) + +Read Replicas can be used for certain read-only workflows such as Business Intelligence, or for a read-only scaling of your application. Read Replicas use asynchronous replication to replicate data from the main node. + + + +### Clone a Database Instance + +Clone a given Database Instance, specified by the `region` and `instance_id` parameters. The clone feature allows you to create a new Database Instance from an existing one. The clone includes all existing databases, users and permissions. You can create a clone on a Database Instance bigger than your current one. + +**Usage:** + +``` +scw document-db instance clone [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want to clone | +| name | | Name of the Database Instance clone | +| node-type | | Node type of the clone | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Create a Database Instance + +Create a new Database Instance. You must set the `engine`, `user_name`, `password` and `node_type` parameters. Optionally, you can specify the volume type and size. + +**Usage:** + +``` +scw document-db instance create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| name | Default: `` | Name of the Database Instance | +| engine | Required | Database engine of the Database Instance | +| user-name | Required | Username created when the Database Instance is created | +| password | Required | Password of the user | +| node-type | Required | Type of node to use for the Database Instance | +| is-ha-cluster | | Defines whether or not High-Availability is enabled | +| disable-backup | | Defines whether or not backups are disabled | +| tags.{index} | | Tags to apply to the Database Instance | +| init-settings.{index}.name | | | +| init-settings.{index}.value | | | +| volume-type | One of: `lssd`, `bssd` | Type of volume where data is stored (lssd, bssd, ...) | +| volume-size | | Volume size when volume_type is not lssd | +| init-endpoints.{index}.private-network.private-network-id | | UUID of the Private Network to be connected to the Database Instance | +| init-endpoints.{index}.private-network.service-ip | | Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations. | +| backup-same-region | | Defines whether to or not to store logical backups in the same region as the Database Instance | +| organization-id | | Organization ID to use. If none is passed the default organization ID will be used | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Delete a Database Instance + +Delete a given Database Instance, specified by the `region` and `instance_id` parameters. Deleting a Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost. + +**Usage:** + +``` +scw document-db instance delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance to delete | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Get a Database Instance + +Retrieve information about a given 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 document-db instance get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Get the TLS certificate of a Database Instance + +Retrieve information about the TLS certificate of a given Database Instance. Details like name and content are returned in the response. + +**Usage:** + +``` +scw document-db instance get-certificate [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Get Database Instance metrics + +Retrieve the time series metrics of a given Database Instance. You can define the period from which to retrieve metrics by specifying the `start_date` and `end_date`. + +**Usage:** + +``` +scw document-db instance get-metrics [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance | +| start-date | | Start date to gather metrics from | +| end-date | | End date to gather metrics from | +| metric-name | | Name of the metric to gather | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### List Database Instances + +List all Database Instances in the specified region, for a given Scaleway Organization or Scaleway Project. By default, the 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 document-db instance list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| tags.{index} | | List Database Instances that have a given tag | +| name | | Lists Database Instances that match a name pattern | +| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc`, `region`, `status_asc`, `status_desc` | Criteria to use when ordering Database Instance listings | +| project-id | | Project ID to list the Database Instance of | +| organization-id | | Please use project_id instead | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + +### Renew the TLS certificate of a Database Instance + +Renew a TLS for a Database Instance. Renewing a certificate means that you will not be able to connect to your Database Instance using the previous certificate. You will also need to download and update the new certificate for all database clients. + +**Usage:** + +``` +scw document-db instance renew-certificate [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want logs of | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Restart Database Instance + +Restart a given Database Instance, specified by the `region` and `instance_id` parameters. The status of the Database Instance returned in the response. + +**Usage:** + +``` +scw document-db instance restart [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want to restart | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Update a Database Instance + +Update the parameters of a Database Instance, including name, tags and backup schedule details. + +**Usage:** + +``` +scw document-db instance update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| backup-schedule-frequency | | In hours | +| backup-schedule-retention | | In days | +| is-backup-schedule-disabled | | Defines whether or not the backup schedule is disabled | +| name | | Name of the Database Instance | +| instance-id | Required | UUID of the Database Instance to update | +| tags.{index} | | Tags of a Database Instance | +| logs-policy.max-age-retention | | Max age (in days) of remote logs to keep on the Database Instance | +| logs-policy.total-disk-retention | | Max disk size of remote logs to keep on the Database Instance | +| backup-same-region | | Store logical backups in the same region as the Database Instance | +| backup-schedule-start-hour | | Defines the start time of the autobackup | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Upgrade a Database Instance + +Upgrade your current Database Instance specifications like node type, high availability, volume, or the database engine version. Note that upon upgrade the `enable_ha` parameter can only be set to `true`. + +**Usage:** + +``` +scw document-db instance upgrade [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want to upgrade | +| node-type | | Node type of the Database Instance you want to upgrade to | +| enable-ha | | Defines whether or not High Availability should be enabled on the Database Instance | +| volume-size | | Increase your Block volume size | +| volume-type | One of: `lssd`, `bssd` | Change your Database Instance storage type | +| upgradable-version-id | | Update your database engine to a newer version | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +## Instance logs management commands + +Instance logs management commands. + + +### Get given logs of a Database Instance + +Retrieve information about the logs of a Database Instance. Specify the `instance_log_id` and `region` in your request to get information such as `download_url`, `status`, `expires_at` and `created_at` about your logs in the response. + +**Usage:** + +``` +scw document-db log get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-log-id | Required | UUID of the instance_log you want | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### List available logs of a Database Instance + +List the available logs of a Database Instance. By default, the logs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. + +**Usage:** + +``` +scw document-db log list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want logs of | +| order-by | One of: `created_at_asc`, `created_at_desc` | Criteria to use when ordering Database Instance logs listing | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### List remote Database Instance logs details + +List remote log details. 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 document-db log list-details [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want logs of | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Purge remote Database Instance logs + +Purge a given remote log from a Database Instance. You can specify the `log_name` of the log you wish to clean from your Database Instance. + +**Usage:** + +``` +scw document-db log purge [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want logs of | +| log-name | | Given log name to purge | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +## Node types management commands + +Two node type ranges are available: + +* **General Purpose:** production-grade nodes designed for scalable database infrastructures. +* **Development:** sandbox environments and reliable performance for development and testing purposes. + + + +### List available node types + +List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. + +**Usage:** + +``` +scw document-db node-type list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| include-disabled-types | | Defines whether or not to include disabled types | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + +## User privileges management commands + +Privileges are permissions that can be granted to database users. You can manage user permissions either via the console, the Scaleway APIs. Managed Database for FerretDB provides a simplified and unified permission model through the API and the console to make things easier to manage and understand. + +Each user has associated permissions that give them access to zero or more logical databases. These include: + +* **None:** No access to the database +* **Read:** Allow users to read tables and fields in a database +* **Write:** Allow users to write content in databases. +* **Admin:** Read and write access to the data, and extended privileges depending on the database engine. + + + +### List user privileges for a database + +List privileges of a user on a database. 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. You can define additional parameters for your query, such as `database_name` and `user_name`. + +**Usage:** + +``` +scw document-db privilege list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `user_name_asc`, `user_name_desc`, `database_name_asc`, `database_name_desc` | Criteria to use when ordering privileges listing | +| database-name | | Name of the database | +| instance-id | Required | UUID of the Database Instance | +| user-name | | Name of the user | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + +### Set user privileges for a database + +Set the privileges of a user on a database. You must define `database_name`, `user_name` and `permission` in the request body. + +**Usage:** + +``` +scw document-db privilege set [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance | +| database-name | | Name of the database | +| user-name | | Name of the user | +| permission | One of: `readonly`, `readwrite`, `all`, `custom`, `none` | Permission to set (Read, Read/Write, All, Custom) | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +## Read replica management + +A Read Replica is a live copy of a Database Instance that behaves like an Instance, but that only allows read-only connections. +The replica mirrors the data of the primary Database node and any changes made are replicated to the replica asynchronously. Read Replicas allow you to scale your Database Instance for read-heavy database workloads. They can also be used for business intelligence workloads. + +A Read Replica can have at most one direct access and one Private Network endpoint. `Loadbalancer` endpoints are not available on Read Replicas even if this resource is displayed in the Read Replica response example. + +If you want to remove a Read Replica endpoint, you can use [delete a Database Instance endpoint](#path-endpoints-delete-a-database-instance-endpoint) API call. + +Instance Access Control Lists (ACL) also apply to Read Replica direct access endpoints. + +**Limitations:** +There might be replication lags between the primary node and its Read Replica nodes. You can try to reduce this lag with some good practices: +* All your tables should have a primary key +* Don't run large transactions that modify, delete or insert lots of rows. Try to split it into several small transactions. + + + +### Create a Read Replica + +Create a new Read Replica of a Database Instance. You must specify the `region` and the `instance_id`. You can only create a maximum of 3 Read Replicas per Database Instance. + +**Usage:** + +``` +scw document-db read-replica create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want to create a Read Replica from | +| endpoint-spec.{index}.private-network.private-network-id | | UUID of the Private Network to be connected to the Read Replica | +| endpoint-spec.{index}.private-network.service-ip | | Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations. | +| same-zone | | Defines whether or not to create the replica in the same Availability Zone as the main Database Instance nodes. | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Create an endpoint for a Read Replica + +Create a new endpoint for a Read Replica. Read Replicas can have at most one direct access and one Private Network endpoint. + +**Usage:** + +``` +scw document-db read-replica create-endpoint [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| read-replica-id | Required | UUID of the Read Replica | +| endpoint-spec.{index}.private-network.private-network-id | | UUID of the Private Network to be connected to the Read Replica | +| endpoint-spec.{index}.private-network.service-ip | | Endpoint IPv4 address with a CIDR notation. Refer to the official Scaleway documentation to learn more about IP and subnet limitations. | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Delete a Read Replica + +Delete a Read Replica of a Database Instance. You must specify the `region` and `read_replica_id` parameters of the Read Replica you want to delete. + +**Usage:** + +``` +scw document-db read-replica delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| read-replica-id | Required | UUID of the Read Replica | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Get a Read Replica + +Retrieve information about a Database Instance Read Replica. Full details about the Read Replica, like `endpoints`, `status` and `region` are returned in the response. + +**Usage:** + +``` +scw document-db read-replica get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| read-replica-id | Required | UUID of the Read Replica | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Resync a Read Replica + +When you resync a Read Replica, first it is reset, then its data is resynchronized from the primary node. Your Read Replica remains unavailable during the resync process. The duration of this process is proportional to the size of your Database Instance. +The configured endpoints do not change. + +**Usage:** + +``` +scw document-db read-replica reset [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| read-replica-id | Required | UUID of the Read Replica | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +## Setting management + +Advanced Database Instance settings allow you to tune the behavior of your database engines to better fit your needs. + +Available settings depend on the database engine and its version. Note that some settings can only be defined upon database engine initialization. These are called init settings. You can find a full list of the settings available in the response body of the [list available database engines](#path-databases-list-databases-in-a-database-instance) endpoint. + +Each advanced setting entry has a default value that users can override. The deletion of a setting entry will restore the setting to default value. Some of the defaults values can be different from the engine's defaults, as we optimize them to the Scaleway platform. + + + +### Add Database Instance advanced settings + +Add an advanced setting to a Database Instance. You must set the `name` and the `value` of each setting. + +**Usage:** + +``` +scw document-db setting add [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance you want to add settings to | +| settings.{index}.name | | | +| settings.{index}.value | | | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Delete Database Instance advanced settings + +Delete an advanced setting in a Database Instance. You must specify the names of the settings you want to delete in the request. + +**Usage:** + +``` +scw document-db setting delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance to delete settings from | +| setting-names.{index} | Required | Settings names to delete | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Set Database Instance advanced settings + +Update an advanced setting for a Database Instance. Settings added upon database engine initalization can only be defined once, and cannot, therefore, be updated. + +**Usage:** + +``` +scw document-db setting set [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance where the settings must be set | +| settings.{index}.name | | | +| settings.{index}.value | | | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +## Block snapshot management + +A snapshot is a consistent, instantaneous copy of the Block Storage volume of your Database Instance at a certain point in time. They are designed to recover your data in case of failure or accidental alterations of the data by a user. They allow you to quickly create a new Instance from a previous state of your database, regardless of the size of the volume. Their limitation is that, unlike backups, snapshots can only be stored in the same location as the original data. + + + +### Create a Database Instance snapshot + +Create a new snapshot of a Database Instance. You must define the `name` parameter in the request. + +**Usage:** + +``` +scw document-db snapshot create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance | +| name | Required
Default: `` | Name of the snapshot | +| expires-at | | Expiration date (must follow the ISO 8601 format) | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Delete a Database Instance snapshot + +Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the `region` and `snapshot_id` parameters of the snapshot you want to delete. + +**Usage:** + +``` +scw document-db snapshot delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| snapshot-id | Required | UUID of the snapshot to delete | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Get a Database Instance snapshot + +Retrieve information about a given snapshot, specified by its `snapshot_id` and `region`. Full details about the snapshot, like size and expiration date, are returned in the response. + +**Usage:** + +``` +scw document-db snapshot get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| snapshot-id | Required | UUID of the snapshot | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### List snapshots + +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 document-db snapshot list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| name | | Name of the snapshot | +| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc`, `expires_at_asc`, `expires_at_desc` | Criteria to use when ordering snapshot listing | +| instance-id | | UUID of the Database Instance | +| project-id | | Project ID the snapshots belongs to | +| organization-id | | Organization ID the snapshots belongs to | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + +### Create a new Database Instance from a snapshot + +Restore a snapshot. When you restore a snapshot, a new Instance is created and billed to your account. Note that is possible to select a larger node type for your new Database Instance. However, the Block volume size will be the same as the size of the restored snapshot. All Instance settings will be restored if you chose a node type with the same or more memory size than the initial Instance. Settings will be reset to the default if your node type has less memory. + +**Usage:** + +``` +scw document-db snapshot restore [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| snapshot-id | Required | Block snapshot of the Database Instance | +| instance-name | | Name of the Database Instance created with the snapshot | +| is-ha-cluster | | Defines whether or not High Availability is enabled on the new Database Instance | +| node-type | | The node type used to restore the snapshot | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Update a Database Instance snapshot + +Update the parameters of a snapshot of a Database Instance. You can update the `name` and `expires_at` parameters. + +**Usage:** + +``` +scw document-db snapshot update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| snapshot-id | Required | UUID of the snapshot to update | +| name | | Name of the snapshot | +| expires-at | | Expiration date (must follow the ISO 8601 format) | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +## User management commands + +Users are profiles to which you can attribute database-level permissions. They allow you to define permissions specific to each type of database usage. For example, users with an `admin` role can create new databases and users. + + + +### Create a user for a Database Instance + +Create a new user for a Database Instance. You must define the `name`, `password` and `is_admin` parameters. + +**Usage:** + +``` +scw document-db user create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance in which you want to create a user | +| name | | Name of the user you want to create | +| password | | Password of the user you want to create | +| is-admin | | Defines whether the user will have administrative privileges | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Delete a user on a Database Instance + +Delete a given user on a Database Instance. You must specify, in the endpoint, the `region`, `instance_id` and `name` parameters of the user you want to delete. + +**Usage:** + +``` +scw document-db user delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance to delete the user from | +| name | Required | Name of the user | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### List users of a Database Instance + +List all users of a given Database Instance. By default, the users returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. + +**Usage:** + +``` +scw document-db user list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| name | | Name of the user | +| order-by | One of: `name_asc`, `name_desc`, `is_admin_asc`, `is_admin_desc` | Criteria to use when requesting user listing | +| instance-id | Required | UUID of the Database Instance | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + +### Update a user on a Database Instance + +Update the parameters of a user on a Database Instance. You can update the `password` and `is_admin` parameters, but you cannot change the name of the user. + +**Usage:** + +``` +scw document-db user update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the Database Instance the user belongs to | +| name | Required | Name of the database user | +| password | | Password of the database user | +| is-admin | | Defines whether or not this user got administrative privileges | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + diff --git a/internal/namespaces/get_commands.go b/internal/namespaces/get_commands.go index 48778bcc0f..a470f1ec8d 100644 --- a/internal/namespaces/get_commands.go +++ b/internal/namespaces/get_commands.go @@ -40,13 +40,12 @@ import ( "github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpc/v2" "github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpcgw/v1" webhosting "github.com/scaleway/scaleway-cli/v2/internal/namespaces/webhosting/v1alpha1" - "github.com/scaleway/scaleway-sdk-go/scw" ) var labs = os.Getenv("SCW_ENABLE_LABS") == "true" // Enable beta in the code when products are in beta -var beta = os.Getenv(scw.ScwEnableBeta) == "true" +//var beta = os.Getenv(scw.ScwEnableBeta) == "true" // GetCommands returns a list of all commands in the CLI. // It is used by both scw and scw-qa. @@ -89,13 +88,13 @@ func GetCommands() *core.Commands { alias.GetCommands(), webhosting.GetCommands(), billing.GetCommands(), + documentdb.GetCommands(), ) if labs { commands.Merge(ipfs.GetCommands()) } - if beta { - commands.Merge(documentdb.GetCommands()) - } + //if beta { + //} return commands }