Skip to content

Latest commit

 

History

History
649 lines (375 loc) · 33.7 KB

mongodb.md

File metadata and controls

649 lines (375 loc) · 33.7 KB

Documentation for scw mongodb

This API allows you to manage your Managed Databases for MongoDB®.

Database management commands

Databases can be used to store and manage sets of information, or data. The interaction between the user and a database is done using a database engine, which provides a query language to add, modify, or delete information from the database.

List databases in a Database Instance

List all databases of a given Database Instance.

Usage:

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

Arguments:

Name Description Argument Specifications
instance-id UUID of the Database Instance Required
order-by Criteria to use when requesting user listing One of: name_asc, name_desc
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, all

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 ...]

Arguments:

Name Description Argument Specifications
instance-id UUID of the Database Instance Required
endpoint.public-network Expose the Database Instance publicly (empty object)
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-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:

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

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

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

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 Major version of the MongoDB® engine Required
Default: ``
tags.{index} Tags to apply to the Database Instance
node-amount 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.type Type of volume where data is stored Default: sbs_5k
One of: unknown_type, sbs_5k, sbs_15k
volume.size-bytes Volume size Default: 5GB
endpoints.{index}.public-network Expose the Database Instance publicly (empty object)
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-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:

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

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

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

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

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

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

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

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 to list the instances of
has-maintenance Retrieve pending maintenances for the database instances if given
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-par
One of: fr-par, all

Update a MongoDB® Database Instance

Update the parameters of a MongoDB® Database Instance.

Usage:

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

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
snapshot-schedule-frequency-hours In hours
snapshot-schedule-retention-days In days
is-snapshot-schedule-enabled Defines whether or not the snapshot schedule is enabled
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par

Upgrade a Database Instance

Upgrade your current Database Instance specifications like volume size.

Usage:

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

Arguments:

Name Description Argument Specifications
instance-id UUID of the Database Instance you want to upgrade Required
volume-size-bytes Increase your Block Storage volume size
version MongoDB version to upgrade to (e.g., 8.0, 7.0, 8.2)
region Region to target. If none is passed will use default region from the config Default: 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:

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

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-par
One of: fr-par
timeout Timeout of the wait Default: 20m0s

Examples:

Wait for an instance to reach a stable state

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

Maintenance management commands

Maintenance operations for managing scheduled updates to your Database Instance.

Apply a maintenance of a MongoDB® Database Instance.

Apply a maintenance of a MongoDB® Database Instance.

Usage:

scw mongodb maintenance apply <maintenance-id ...> [arg=value ...]

Arguments:

Name Description Argument Specifications
maintenance-id ID of the maintenance Required
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par

Get a maintenance of a MongoDB® Database Instance.

Get a maintenance of a MongoDB® Database Instance.

Usage:

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

Arguments:

Name Description Argument Specifications
maintenance-id ID of the maintenance Required
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par

List all the maintenances of a MongoDB® Database Instance.

List all the maintenances of a MongoDB® Database Instance.

Usage:

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

Arguments:

Name Description Argument Specifications
instance-id ID of the instance
order-by Criteria to use when requesting user listing One of: created_at_asc, created_at_desc, starts_at_asc, starts_at_desc, stops_at_asc, stops_at_desc
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, all

Node types management commands

Two node type ranges are available:

  • Shared vCPU: a complete and highly reliable node range with shared resources that is made for scaling from development to production needs, at affordable prices.
  • Dedicated vCPU: 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 ...]

Arguments:

Name Description Argument Specifications
include-disabled Defines whether or not to include disabled types
project-id ID of a project to get a personalized view of the stock
region Region to target. If none is passed will use default region from the config Default: 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:

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

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

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

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

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

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

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

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-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_amount of the new Database Instance.

Usage:

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

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-amount Number of nodes to use for the new Database Instance Required
volume-type Instance volume type Required
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-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:

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

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

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

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-par
One of: fr-par

Delete a user on a Database Instance

Delete an existing user on a Database Instance.

Usage:

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

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-par
One of: fr-par

List users of a Database Instance

List all users of a given Database Instance.

Usage:

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

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-par
One of: fr-par, all

Apply user roles

Apply preset roles for a user in a Database Instance.

Usage:

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

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

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

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-par
One of: fr-par

MongoDB® major 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® major versions

List available MongoDB® major versions.

Usage:

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

Arguments:

Name Description Argument Specifications
version
region Region to target. If none is passed will use default region from the config Default: fr-par
One of: fr-par, all