Scaleway logo
Commands

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:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database InstanceRequired
endpoint.public
endpoint.private-network.private-network-idUUID of the Private Network
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
endpoint-idUUID of the Endpoint to deleteRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
project-idProject ID to use. If none is passed the default project ID will be used
nameName of the Database InstanceDefault: <generated>
versionVersion of the MongoDB® engineRequired
Default: ``
tags.{index}Tags to apply to the Database Instance
node-numberNumber of node to use for the Database InstanceRequired
Default: 1
node-typeType of node to use for the Database InstanceRequired
user-nameUsername created when the Database Instance is createdRequired
passwordPassword of the initial userRequired
volume.volume-sizeVolume sizeDefault: 5GB
volume.volume-typeType of volume where data is storedDefault: sbs_5k
One of: unknown_type, sbs_5k, sbs_15k
endpoints.{index}.public
endpoints.{index}.private-network.private-network-idUUID of the Private Network
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database Instance to deleteRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database InstanceRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database InstanceRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
tags.{index}List Database Instances that have a given tag
nameLists Database Instances that match a name pattern
order-byCriteria to use when ordering Database Instance listingsOne of: created_at_asc, created_at_desc, name_asc, name_desc, status_asc, status_desc
project-idProject ID
organization-idOrganization ID of the Database Instance
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, all

Update a MongoDB® Database Instance

Update the parameters of a MongoDB® Database Instance.

Usage:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database Instance to updateRequired
nameName of the Database Instance
tags.{index}Tags of a Database Instance
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par

Upgrade a Database Instance

Upgrade your current Database Instance specifications like volume size.

Usage:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database Instance you want to upgradeRequired
volume-sizeIncrease your Block Storage volume size
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
instance-idID of the instance you want to wait for.Required
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, nl-ams
timeoutTimeout of the waitDefault: 20m0s

Examples:

Wait for an instance to reach a stable state

TerminalCode
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:

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

Arguments:

NameDescriptionArgument Specifications
include-disabled-typesDefines whether or not to include disabled types
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database Instance to snapshotRequired
nameName of the snapshot
expires-atExpiration date of the snapshot (must follow the ISO 8601 format)
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshotRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshotRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

TerminalCode
scw mongodb snapshot list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
instance-idInstance ID the snapshots belongs to
nameLists database snapshots that match a name pattern
order-byCriteria to use when ordering snapshot listingsOne of: created_at_asc, created_at_desc, name_asc, name_desc, expires_at_asc, expires_at_desc
project-idProject ID to list the snapshots of
organization-idOrganization ID the snapshots belongs to
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshotRequired
instance-nameName of the new Database InstanceRequired
node-typeNode type to use for the new Database InstanceRequired
node-numberNumber of nodes to use for the new Database InstanceRequired
volume.volume-typeType of volume where data is storedOne of: unknown_type, sbs_5k, sbs_15k
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the SnapshotRequired
nameName of the snapshot
expires-atExpiration date of the snapshot (must follow the ISO 8601 format)
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database Instance the user belongs toRequired
nameName of the database user
passwordPassword of the database user
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par

Delete a user on a Database Instance

Delete an existing user on a Database Instance.

Usage:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database Instance the user belongs toRequired
nameName of the database userRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par

List users of a Database Instance

List all users of a given Database Instance.

Usage:

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

Arguments:

NameDescriptionArgument Specifications
nameName of the user
order-byCriteria to use when requesting user listingOne of: name_asc, name_desc
instance-idUUID of the Database InstanceRequired
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, all

Apply user roles

Apply preset roles for a user in a Database Instance.

Usage:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database Instance the user belongs toRequired
user-nameName of the database user
roles.{index}.roleName of the preset roleOne of: unknown_role, read, read_write, db_admin, sync
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
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
instance-idUUID of the Database Instance the user belongs toRequired
nameName of the database userRequired
passwordPassword of the database user
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One 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:

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

Arguments:

NameDescriptionArgument Specifications
version
regionRegion to target. If none is passed will use default region from the configDefault: fr-par
One of: fr-par, all