Documentation for `scw mongodb`
The CLI documentation pages are currently under construction
The content is up to date. We're making improvements to the site over the next few weeks for a better experience.
This API allows you to manage your Managed Databases for MongoDB®.
Endpoint management commands
Instance endpoints enable connection to your instance.
Create a new Instance endpoint
Create a new endpoint for a MongoDB® Database Instance. You can add public_network or private_network specifications to the body of the request.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance | Required |
| endpoint.public | ||
| endpoint.private-network.private-network-id | UUID of the Private Network | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Delete a Database Instance endpoint
Delete the endpoint of a Database Instance. You must specify the endpoint_id parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| endpoint-id | UUID of the Endpoint to delete | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Instance management commands
A Managed MongoDB® Database Instance is composed of one or multiple dedicated compute nodes running a single database engine.
Create a MongoDB® Database Instance
Create a new MongoDB® Database Instance.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| project-id | Project ID to use. If none is passed the default project ID will be used | |
| name | Name of the Database Instance | Default: <generated> |
| version | Version of the MongoDB® engine | Required Default: `` |
| tags.{index} | Tags to apply to the Database Instance | |
| node-number | Number of node to use for the Database Instance | Required Default: 1 |
| node-type | Type of node to use for the Database Instance | Required |
| user-name | Username created when the Database Instance is created | Required |
| password | Password of the initial user | Required |
| volume.volume-size | Volume size | Default: 5GB |
| volume.volume-type | Type of volume where data is stored | Default: sbs_5kOne of: unknown_type, sbs_5k, sbs_15k |
| endpoints.{index}.public | ||
| endpoints.{index}.private-network.private-network-id | UUID of the Private Network | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Delete a MongoDB® Database Instance
Delete a given MongoDB® Database Instance, specified by the region and instance_id parameters. Deleting a MongoDB® Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance to delete | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Get a MongoDB® Database Instance
Retrieve information about a given MongoDB® Database Instance, specified by the region and instance_id parameters. Its full details, including name, status, IP address and port, are returned in the response object.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Get the certificate of a Database Instance
Retrieve the certificate of a given Database Instance, specified by the instance_id parameter.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
List MongoDB® Database Instances
List all MongoDB® Database Instances in the specified region. By default, the MongoDB® Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as tags and name. For the name parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| 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 | One of: created_at_asc, created_at_desc, name_asc, name_desc, status_asc, status_desc |
| project-id | Project ID | |
| organization-id | Organization ID of the Database Instance | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, all |
Update a MongoDB® Database Instance
Update the parameters of a MongoDB® Database Instance.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance to update | Required |
| name | Name of the Database Instance | |
| tags.{index} | Tags of a Database Instance | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Upgrade a Database Instance
Upgrade your current Database Instance specifications like volume size.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance you want to upgrade | Required |
| volume-size | Increase your Block Storage volume size | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Wait for an instance to reach a stable state
Wait for an instance to reach a stable state. This is similar to using --wait flag.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | ID of the instance you want to wait for. | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, nl-ams |
| timeout | Timeout of the wait | Default: 20m0s |
Examples:
Wait for an instance to reach a stable state
Code
Node types management commands
Two node type ranges are available:
- Cost-Optimized: a complete and highly reliable node range with shared resources that is made for scaling from development to production needs, at affordable prices.
- Production-Optimized: database nodes with dedicated vCPU for the most demanding workloads and mission-critical applications.
List available node types
List available node types.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| include-disabled-types | Defines whether or not to include disabled types | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, all |
Snapshot management commands
A snapshot is a consistent, instantaneous copy of the Block Storage volume of your Database Instance at a certain point in time.
Create a Database Instance snapshot
Create a new snapshot of a Database Instance. You must define the name and instance_id parameters in the request.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance to snapshot | Required |
| name | Name of the snapshot | |
| expires-at | Expiration date of the snapshot (must follow the ISO 8601 format) | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Delete a Database Instance snapshot
Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to delete.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| snapshot-id | UUID of the snapshot | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Get a Database Instance snapshot
Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to retrieve.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| snapshot-id | UUID of the snapshot | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
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:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | Instance ID the snapshots belongs to | |
| name | Lists database snapshots that match a name pattern | |
| order-by | Criteria to use when ordering snapshot listings | One of: created_at_asc, created_at_desc, name_asc, name_desc, expires_at_asc, expires_at_desc |
| project-id | Project ID to list the snapshots of | |
| organization-id | Organization ID the snapshots belongs to | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, all |
Restore a Database Instance snapshot
Restore a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to restore, the instance_name of the new Database Instance, node_type of the new Database Instance and node_number of the new Database Instance.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| snapshot-id | UUID of the snapshot | Required |
| instance-name | Name of the new Database Instance | Required |
| node-type | Node type to use for the new Database Instance | Required |
| node-number | Number of nodes to use for the new Database Instance | Required |
| volume.volume-type | Type of volume where data is stored | One of: unknown_type, sbs_5k, sbs_15k |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
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:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| snapshot-id | UUID of the Snapshot | Required |
| name | Name of the snapshot | |
| expires-at | Expiration date of the snapshot (must follow the ISO 8601 format) | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
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.
Create an user on a Database Instance
Create an user on a Database Instance. You must define the name, password of the user and instance_id parameters in the request.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance the user belongs to | Required |
| name | Name of the database user | |
| password | Password of the database user | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Delete a user on a Database Instance
Delete an existing user on a Database Instance.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance the user belongs to | Required |
| name | Name of the database user | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
List users of a Database Instance
List all users of a given Database Instance.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| name | Name of the user | |
| order-by | Criteria to use when requesting user listing | One of: name_asc, name_desc |
| instance-id | UUID of the Database Instance | Required |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, all |
Apply user roles
Apply preset roles for a user in a Database Instance.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance the user belongs to | Required |
| user-name | Name of the database user | |
| roles.{index}.role | Name of the preset role | One of: unknown_role, read, read_write, db_admin, sync |
| roles.{index}.database | Name of the database on which the preset role will be used | |
| roles.{index}.any-database | Flag to enable the preset role in all databases | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
Update a user on a Database Instance
Update the parameters of a user on a Database Instance. You can update the password parameter, but you cannot change the name of the user.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| instance-id | UUID of the Database Instance the user belongs to | Required |
| name | Name of the database user | Required |
| password | Password of the database user | |
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par |
MongoDB® version management commands
A database engine is the core software that handles the storage, retrieval, and management of data in your Database Instance.
List available MongoDB® versions
List available MongoDB® versions.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| version | ||
| region | Region to target. If none is passed will use default region from the config | Default: fr-parOne of: fr-par, all |