Documentation for scw mongodb

May 21, 2025 · View on GitHub

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:

scw mongodb endpoint create <instance-id ...> [arg=value ...]

Args:

NameDescription
instance-idRequiredUUID of the Database Instance
endpoint.private-network.private-network-idUUID of the Private Network
regionDefault: fr-par
One of: fr-par
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 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:

scw mongodb endpoint delete <endpoint-id ...> [arg=value ...]

Args:

NameDescription
endpoint-idRequiredUUID of the Endpoint to delete
regionDefault: fr-par
One of: fr-par
Region to target. If none is passed will use default region from the config

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:

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

Args:

NameDescription
project-idProject ID to use. If none is passed the default project ID will be used
nameDefault: <generated>Name of the Database Instance
versionRequired
Default: ``
Version of the MongoDB® engine
tags.{index}Tags to apply to the Database Instance
node-numberRequired
Default: 1
Number of node to use for the Database Instance
node-typeRequiredType of node to use for the Database Instance
user-nameRequiredUsername created when the Database Instance is created
passwordRequiredPassword of the initial user
volume.volume-sizeDefault: 5GBVolume size
volume.volume-typeDefault: sbs_5k
One of: unknown_type, sbs_5k, sbs_15k
Type of volume where data is stored
endpoints.{index}.private-network.private-network-idUUID of the Private Network
regionDefault: fr-par
One of: fr-par
Region to target. If none is passed will use default region from the config

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:

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

Args:

NameDescription
instance-idRequiredUUID of the Database Instance to delete
regionDefault: fr-par
One of: fr-par
Region to target. If none is passed will use default region from the config

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:

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

Args:

NameDescription
instance-idRequiredUUID of the Database Instance
regionDefault: fr-par
One of: fr-par
Region to target. If none is passed will use default region from the config

Get the certificate of a Database Instance

Retrieve the certificate of a given Database Instance, specified by the instance_id parameter.

Usage:

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

Args:

NameDescription
instance-idRequiredUUID of the Database Instance
regionDefault: fr-par
One of: fr-par
Region to target. If none is passed will use default region from the config

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:

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

Args:

NameDescription
tags.{index}List Database Instances that have a given tag
nameLists Database Instances that match a name pattern
order-byOne of: created_at_asc, created_at_desc, name_asc, name_desc, status_asc, status_descCriteria to use when ordering Database Instance listings
project-idProject ID
organization-idOrganization ID of the Database Instance
regionDefault: fr-par
One of: fr-par, all
Region to target. If none is passed will use default region from the config

Update a MongoDB® Database Instance

Update the parameters of a MongoDB® Database Instance.

Usage:

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

Args:

NameDescription
instance-idRequiredUUID of the Database Instance to update
nameName of the Database Instance
tags.{index}Tags of a Database Instance
regionDefault: fr-par
One of: fr-par
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 volume size.

Usage:

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

Args:

NameDescription
instance-idRequiredUUID of the Database Instance you want to upgrade
volume-sizeIncrease your Block Storage volume size
regionDefault: fr-par
One of: fr-par
Region to target. If none is passed will use default region from the config

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:

scw mongodb instance wait <instance-id ...> [arg=value ...]

Args:

NameDescription
instance-idRequiredID of the instance you want to wait for.
regionDefault: fr-par
One of: fr-par, nl-ams
Region to target. If none is passed will use default region from the config
timeoutDefault: 20m0sTimeout of the wait

Examples:

Wait for an instance to reach a stable state

scw mongodb instance wait 11111111-1111-1111-1111-111111111111

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:

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

Args:

NameDescription
include-disabled-typesDefines whether or not to include disabled types
regionDefault: fr-par
One of: fr-par, all
Region to target. If none is passed will use default region from the config

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:

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

Args:

NameDescription
instance-idRequiredUUID of the Database Instance to snapshot
nameName of the snapshot
expires-atExpiration date of the snapshot (must follow the ISO 8601 format)
regionDefault: fr-par
One of: fr-par
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 snapshot_id parameter of the snapshot you want to delete.

Usage:

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

Args:

NameDescription
snapshot-idRequiredUUID of the snapshot
regionDefault: fr-par
One of: fr-par
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 of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to retrieve.

Usage:

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

Args:

NameDescription
snapshot-idRequiredUUID of the snapshot
regionDefault: fr-par
One of: fr-par
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 mongodb snapshot list [arg=value ...]

Args:

NameDescription
instance-idInstance ID the snapshots belongs to
nameLists database snapshots that match a name pattern
order-byOne of: created_at_asc, created_at_desc, name_asc, name_desc, expires_at_asc, expires_at_descCriteria to use when ordering snapshot listings
project-idProject ID to list the snapshots of
organization-idOrganization ID the snapshots belongs to
regionDefault: fr-par
One of: fr-par, all
Region to target. If none is passed will use default region from the config

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:

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

Args:

NameDescription
snapshot-idRequiredUUID of the snapshot
instance-nameRequiredName of the new Database Instance
node-typeRequiredNode type to use for the new Database Instance
node-numberRequiredNumber of nodes to use for the new Database Instance
volume.volume-typeOne of: unknown_type, sbs_5k, sbs_15kType of volume where data is stored
regionDefault: fr-par
One of: fr-par
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 mongodb snapshot update <snapshot-id ...> [arg=value ...]

Args:

NameDescription
snapshot-idRequiredUUID of the Snapshot
nameName of the snapshot
expires-atExpiration date of the snapshot (must follow the ISO 8601 format)
regionDefault: fr-par
One of: fr-par
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.

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:

scw mongodb user create [arg=value ...]

Args:

NameDescription
instance-idRequiredUUID of the Database Instance the user belongs to
nameName of the database user
passwordPassword of the database user
regionDefault: fr-par
One of: fr-par
Region to target. If none is passed will use default region from the config

Delete a user on a Database Instance

Delete an existing user on a Database Instance.

Usage:

scw mongodb user delete [arg=value ...]

Args:

NameDescription
instance-idRequiredUUID of the Database Instance the user belongs to
nameRequiredName of the database user
regionDefault: fr-par
One of: fr-par
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.

Usage:

scw mongodb user list [arg=value ...]

Args:

NameDescription
nameName of the user
order-byOne of: name_asc, name_descCriteria to use when requesting user listing
instance-idRequiredUUID of the Database Instance
regionDefault: fr-par
One of: fr-par, all
Region to target. If none is passed will use default region from the config

Apply user roles

Apply preset roles for a user in a Database Instance.

Usage:

scw mongodb user set-role [arg=value ...]

Args:

NameDescription
instance-idRequiredUUID of the Database Instance the user belongs to
user-nameName of the database user
roles.{index}.roleOne of: unknown_role, read, read_write, db_admin, syncName of the preset role
roles.{index}.databaseName of the database on which the preset role will be used
roles.{index}.any-databaseFlag to enable the preset role in all databases
regionDefault: fr-par
One of: fr-par
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 parameter, but you cannot change the name of the user.

Usage:

scw mongodb user update [arg=value ...]

Args:

NameDescription
instance-idRequiredUUID of the Database Instance the user belongs to
nameRequiredName of the database user
passwordPassword of the database user
regionDefault: fr-par
One of: fr-par
Region to target. If none is passed will use default region from the config

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:

scw mongodb version list [arg=value ...]

Args:

NameDescription
version
regionDefault: fr-par
One of: fr-par, all
Region to target. If none is passed will use default region from the config