Skip to content

Latest commit

 

History

History
1067 lines (632 loc) · 28.3 KB

rdb.md

File metadata and controls

1067 lines (632 loc) · 28.3 KB

Documentation for scw rdb

Database RDB API

Access Control List (ACL) management commands

Network Access Control List allows to control network in and out traffic by setting up ACL rules.

Add an ACL instance to a given instance

Add an ACL instance to a given instance.

Usage:

scw rdb acl add [arg=value ...]

Args:

Name Description
instance-id Required UUID of the 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 given instance

Delete ACL rules of a given instance.

Usage:

scw rdb acl delete [arg=value ...]

Args:

Name Description
instance-id Required UUID of the instance you want to delete an ACL rules from
acl-rule-ips.{index} ACL rules IP present on the 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 given instance

List ACL rules of a given instance.

Usage:

scw rdb acl list [arg=value ...]

Args:

Name Description
instance-id Required UUID of the 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

Backup management commands

Save and restore backups of your database instance.

Create a database backup

Create a database backup.

Usage:

scw rdb backup create [arg=value ...]

Args:

Name Description
instance-id UUID of the instance
database-name Name of the database you want to make a backup of
name Default: <generated> Name of the backup
expires-at Expiration date (Format ISO 8601)
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 backup

Delete a database backup.

Usage:

scw rdb backup delete <database-backup-id ...> [arg=value ...]

Args:

Name Description
database-backup-id Required UUID of the database backup 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

Download a backup locally

Download a backup locally.

Usage:

scw rdb backup download <backup-id ...> [arg=value ...]

Args:

Name Description
backup-id Required ID of the backup you want to download.
output Filename to write to
region Default: fr-par
One of: fr-par, nl-ams
Region to target. If none is passed will use default region from the config

Examples:

Download a backup

scw rdb backup download 11111111-1111-1111-1111-111111111111

Export a database backup

Export a database backup.

Usage:

scw rdb backup export <database-backup-id ...> [arg=value ...]

Args:

Name Description
database-backup-id Required UUID of the database backup you want to export
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 backup

Get a database backup.

Usage:

scw rdb backup get <database-backup-id ...> [arg=value ...]

Args:

Name Description
database-backup-id Required UUID of the database backup
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 backups

List database backups.

Usage:

scw rdb backup list [arg=value ...]

Args:

Name Description
name Name of the database backups
order-by One of: created_at_asc, created_at_desc, name_asc, name_desc, status_asc, status_desc Criteria to use when ordering database backups listing
instance-id UUID of the instance
project-id Project ID the database backups belongs to
organization-id Organization ID the database backups belongs 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

Restore a database backup

Restore a database backup.

Usage:

scw rdb backup restore <database-backup-id ...> [arg=value ...]

Args:

Name Description
database-name Defines the destination database in order to restore into a specified database, the default destination is set to the origin database of the backup
database-backup-id Required Backup of a logical database
instance-id Required Defines the rdb instance where the backup has to be restored
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 backup

Update a database backup.

Usage:

scw rdb backup update <database-backup-id ...> [arg=value ...]

Args:

Name Description
database-backup-id Required UUID of the database backup to update
name Name of the Database Backup
expires-at Expiration date (Format ISO 8601)
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

Wait for a backup to reach a stable state

Wait for a backup to reach a stable state. This is similar to using --wait flag.

Usage:

scw rdb backup wait <backup-id ...> [arg=value ...]

Args:

Name Description
backup-id Required ID of the backup you want to wait for.
region Default: fr-par
One of: fr-par, nl-ams
Region to target. If none is passed will use default region from the config

Examples:

Wait for a backup to reach a stable state

scw rdb backup wait 11111111-1111-1111-1111-111111111111

Database management commands

Manage logical databases on your instance

Create a database in a given instance

Create a database in a given instance.

Usage:

scw rdb database create [arg=value ...]

Args:

Name Description
instance-id Required UUID of the 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 given instance

Delete a database in a given instance.

Usage:

scw rdb database delete [arg=value ...]

Args:

Name Description
instance-id Required UUID of the 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 all database in a given instance

List all database in a given instance.

Usage:

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

Args:

Name Description
name Name of the database
managed 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 instance to list database 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

Database engines commands

Software that stores and retrieves data from a database. Each database engine has a name and versions.

List available database engines

List available database engines.

Usage:

scw rdb engine list [arg=value ...]

Args:

Name 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

Instance management commands

A Database Instance is composed of one or more Nodes, depending of the is_ha_cluster setting. Autohealing is enabled by default for HA clusters. Database automated backup is enabled by default in order to prevent data loss.

Clone an instance

Clone an instance.

Usage:

scw rdb instance clone <instance-id ...> [arg=value ...]

Args:

Name Description
instance-id Required UUID of the instance you want to clone
name Name of the clone instance
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

Connect to an instance using locally installed CLI

Connect to an instance using locally installed CLI such as psql or mysql.

Usage:

scw rdb instance connect <instance-id ...> [arg=value ...]

Args:

Name Description
instance-id Required UUID of the instance
username Required Name of the user to connect with to the database
database Default: rdb Name of the database
cli-db Command line tool to use, default to psql/mysql
region Default: fr-par
One of: fr-par, nl-ams
Region to target. If none is passed will use default region from the config

Create an instance

Create an instance.

Usage:

scw rdb 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: <generated> Name of the instance
engine Required Database engine of the database (PostgreSQL, MySQL, ...)
user-name Required Name of the user created when the instance is created
password Required Password of the user
node-type Required
Default: DB-DEV-S
One of: DB-DEV-S, DB-DEV-M, DB-DEV-L, DB-DEV-XL, DB-GP-XS, DB-GP-S, DB-GP-M, DB-GP-L, DB-GP-XL
Type of node to use for the instance
is-ha-cluster Whether or not High-Availability is enabled
disable-backup Whether or not backups are disabled
tags.{index} Tags to apply to the instance
init-settings.{index}.name
init-settings.{index}.value
volume-type One of: lssd, bssd Type of volume where data are stored (lssd, bssd, ...)
volume-size Volume size when volume_type is not lssd
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 an instance

Delete an instance.

Usage:

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

Args:

Name Description
instance-id Required UUID of the 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 an instance

Get an instance.

Usage:

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

Args:

Name Description
instance-id Required UUID of the 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 an instance

Get the TLS certificate of an instance.

Usage:

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

Args:

Name Description
instance-id Required UUID of the 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 instances

List instances.

Usage:

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

Args:

Name Description
tags.{index} List instance that have a given tags
name List instance that match a given 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 instance listing
project-id Project ID to list the instance of
organization-id Please use project_id instead
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 an instance

Update an instance.

Usage:

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

Args:

Name Description
backup-schedule-frequency In hours
backup-schedule-retention In days
is-backup-schedule-disabled Whether or not the backup schedule is disabled
name Name of the instance
instance-id Required UUID of the instance to update
tags.{index} Tags of a given 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

Upgrade an instance to an higher instance type

Upgrade your current node_type or enable high availability on your standalone database instance.

Usage:

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

Args:

Name Description
instance-id Required UUID of the instance you want to upgrade
node-type One of: DB-DEV-S, DB-DEV-M, DB-DEV-L, DB-DEV-XL, DB-GP-XS, DB-GP-S, DB-GP-M, DB-GP-L, DB-GP-XL Node type of the instance you want to upgrade to
enable-ha Set to true to enable high availability on your instance
volume-size Increase your block storage volume size
volume-type One of: lssd, bssd Change your instance storage type
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

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 rdb instance wait <instance-id ...> [arg=value ...]

Args:

Name Description
instance-id Required ID of the instance you want to wait for.
region Default: fr-par
One of: fr-par, nl-ams
Region to target. If none is passed will use default region from the config

Examples:

Wait for an instance to reach a stable state

scw rdb instance wait 11111111-1111-1111-1111-111111111111

Instance logs management commands

Instance logs management commands.

Get specific logs of a given instance

Get specific logs of a given instance.

Usage:

scw rdb 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 given instance

List available logs of a given instance.

Usage:

scw rdb log list [arg=value ...]

Args:

Name Description
instance-id Required UUID of the instance you want logs of
order-by One of: created_at_asc, created_at_desc Criteria to use when ordering 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

Prepare logs of a given instance

Prepare your instance logs. Logs will be grouped on a minimum interval of a day.

Usage:

scw rdb log prepare [arg=value ...]

Args:

Name Description
instance-id Required UUID of the instance you want logs of
start-date Start datetime of your log. Format: {year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z
end-date End datetime of your log. Format: {year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z
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

Node types powering your instance

List available node types

List available node types.

Usage:

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

Args:

Name Description
include-disabled-types Whether or not to include disabled types
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 privileges management commands

Define some privileges to a user on a specific database.

List privileges of a given user for a given database on a given instance

List privileges of a given user for a given database on a given instance.

Usage:

scw rdb 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 instance
user-name 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

Set privileges of a given user for a given database on a given instance

Set privileges of a given user for a given database on a given instance.

Usage:

scw rdb privilege set [arg=value ...]

Args:

Name Description
instance-id Required UUID of the 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

Block snapshot management

Create, restore and manage block snapshot

Create an instance snapshot

Create an instance snapshot.

Usage:

scw rdb snapshot create [arg=value ...]

Args:

Name Description
instance-id Required UUID of the instance
name Required
Default: <generated>
Name of the snapshot
expires-at Expiration date (Format ISO 8601)
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 an instance snapshot

Delete an instance snapshot.

Usage:

scw rdb snapshot delete <snapshot-id ...> [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 an instance snapshot

Get an instance snapshot.

Usage:

scw rdb snapshot get <snapshot-id ...> [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 instance snapshots

List instance snapshots.

Usage:

scw rdb 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 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
Region to target. If none is passed will use default region from the config

Create a new instance from a given snapshot

Create a new instance from a given snapshot.

Usage:

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

Args:

Name Description
snapshot-id Required Block snapshot of the instance
instance-name Name of the instance created with the snapshot
is-ha-cluster Whether or not High-Availability is enabled on the new 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 an instance snapshot

Update an instance snapshot.

Usage:

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

Args:

Name Description
snapshot-id Required UUID of the snapshot to update
name Name of the snapshot
expires-at Expiration date (Format ISO 8601)
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

Manage users on your instance

Create a user on a given instance

Create a user on a given instance.

Usage:

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

Args:

Name Description
instance-id Required UUID of the instance you want to create a user in
name Name of the user you want to create
password Password of the user you want to create
is-admin Whether the user you want to create 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 given instance

Delete a user on a given instance.

Usage:

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

Args:

Name Description
instance-id Required UUID of the instance to delete a 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 given instance

List users of a given instance.

Usage:

scw rdb 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 ordering users listing
instance-id Required UUID of the 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

Update a user on a given instance

Update a user on a given instance.

Usage:

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

Args:

Name Description
instance-id Required UUID of the instance the user belongs to
name Required Name of the database user
password Password of the database user
is-admin 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