This API is used to restore a backup to a new DB instance.
Name |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Specifies the DB instance name. The instance name can be the same as an existing instance name.
|
availability_zone |
Yes |
String |
Specifies the AZ ID. The value cannot be empty. For details about how to obtain this parameter value, see Regions and Endpoints. |
vpc_id |
Yes |
String |
Specifies the VPC ID. For details about how to obtain this parameter value, see section "Virtual Private Cloud" in the Virtual Private Cloud API Reference. The value cannot be empty. The string length and whether the string complying with UUID regular expression rules are verified. |
subnet_id |
Yes |
String |
Specifies the subnet ID. For details about how to obtain this parameter value, see section "Subnet" in the Virtual Private Cloud API Reference. |
security_group_id |
Yes |
String |
Specifies the ID of the security group where a specified DB instance belongs to. For details about how to obtain this parameter value, see section "Security Group" in the Virtual Private Cloud API Reference. |
password |
No |
String |
Specifies the database password. The value must be 8 to 32 characters in length and contain uppercase letters (A to Z), lowercase letters (a to z), digits (0 to 9), and special characters, such as ~!@#%^*-_=+? Enter a strong password to improve security, preventing security risks such as brute force cracking. |
disk_encryption_id |
No |
String |
The key ID used for disk encryption. The string must comply with UUID regular expression rules. If this parameter is not transferred, disk encryption is not performed. |
flavor |
Yes |
Array of objects |
Specifies the instance specifications. For more information, see Table 4. For details about how to obtain the value, see the parameter value in Querying Database Specifications. |
restore_point |
Yes |
Object |
Specifies the details about the backup to be restored to a new DB instance. For more information, see Table 3. |
backup_strategy |
No |
Object |
Specifies the advanced backup policy. For more information, see Table 5. |
enterprise_project_id |
No |
String |
Specifies the enterprise project ID.
|
ssl_option |
No |
String |
Specifies whether to enable or disable SSL. Valid value:
If this parameter is not transferred, SSL is enabled by default. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
instance_id |
No |
String |
Specifies the instance ID, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance.
|
type |
No |
String |
Specifies the recovery mode. The enumerated values are as follows:
|
backup_id |
No |
String |
Specifies the ID of the backup to be restored. This parameter must be specified when the backup file is used for restoration. NOTE:
When type is not mandatory, backup_id is mandatory. |
restore_time |
No |
Integer |
Specifies the time point of data restoration in the UNIX timestamp. The unit is millisecond and the time zone is UTC. NOTE:
When type is mandatory, restore_time is mandatory. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Specifies the node type. Valid value:
|
num |
Yes |
Integer |
Specifies node quantity. Valid value:
|
size |
No |
String |
Specifies the disk size. The value must be a multiple of 10. The unit is GB.
|
spec_code |
Yes |
String |
Specifies the resource specification code. For details about how to obtain the value, see the parameter value in Querying Database Specifications. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
start_time |
Yes |
String |
Specifies the backup time window. Automated backups will be triggered during the backup time window. The value cannot be empty. It must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.
Example value: 23:00-00:00 |
keep_days |
No |
String |
Specifies the number of days to retain the generated backup files. The value range is from 0 to 732.
|
The values of region and availability_zone are used as examples.
POST https://dds.eu-de.otc.t-systems.com/v3/97b026aa9cc4417888c14c84a1ad9860/instances
Restoring a backup to a new cluster instance:
{ "name": "test-cluster-01", "availability_zone": "bbb", "vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961", "subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007b", "security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58", "password": "Test#%0_", "restore_point": { "backup_id": "8f643d252d834a4c916b2db4322f99552734" }, "flavor": [{ "type": "mongos", "num": 2, "spec_code": "dds.mongodb.c3.medium.4.mongos" }, { "type": "shard", "size": "40", "spec_code": "dds.mongodb.c3.medium.4.shard" }, { "type": "config", "num": 1, "size": "20", "spec_code": "dds.mongodb.c3.large.2.config" } ], "backup_strategy": { "start_time": "23:00-00:00", "keep_days": "8" } }
Restoring a backup to a new replica set instance:
{ "name": "test-replicaset", "availability_zone": "bbb", "vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961", "subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007b", "security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58", "password": "Test#%0_", "restore_point": { "backup_id": "8f643d252d834a4c916b2db4322f99552734" }, "flavor": [ { "type": "replica", "num": 1, "spec_code": "dds.mongodb.s2.medium.4.repset" } ], "backup_strategy": { "start_time": "23:00-00:00", "keep_days": "8" } }
Restoring a backup to a new single node instance:
{ "name": "test-singlenode", "availability_zone": "bbb", "vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961", "subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007b", "security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58", "password": "Test#%0_", "restore_point": { "backup_id": "8f643d252d834a4c916b2db4322f99552734" }, "flavor": [ { "type": "single", "num": 1, "spec_code": "dds.mongodb.c3.medium.4.single" } ], "backup_strategy": { "start_time": "23:00-00:00", "keep_days": "8" } }
Restoring a backup to a new replica set instance at a point in time:
{ "name": "replica-liuyunj1", "availability_zone": "az1xahz", "vpc_id": "dcdadabc-efed-4518-8b34-4af66fcd97e7", "subnet_id": "4a9348f2-f232-4700-a440-2f1641d80960", "security_group_id": "c57b9db2-cccb-4c0d-b058-7ea51dda0c99", "flavor": [ { "type": "replica", "num": 1, "size": "100", "spec_code": "dds.mongodb.c3.large.2.repset" } ], "backup_strategy": { "start_time": "08:00-09:00", "keep_days": "8" }, "restore_point": { "instance_id": "d5833c2854a4486cb7960f829269e211in02", "type": "timestamp", "restore_time": 1607689584000 }, "ssl_option": "1" }
Name |
Type |
Description |
---|---|---|
id |
String |
Indicates the DB instance ID, |
name |
String |
which is the same as the request parameter. |
datastore |
Object |
Indicates the database information, which is the same as the request parameter. For more information, see Table 7. |
created |
String |
Indicates the creation time in the following format: yyyy-mm-dd hh:mm:ss. |
status |
String |
Indicates the DB instance status. The value is creating. |
region |
String |
Indicates the region ID, which is the same as the request parameter. |
availability_zone |
String |
Indicates the AZ ID, which is the same as the request parameter. |
vpc_id |
String |
Indicates the VPC ID, which is the same as the request parameter. |
subnet_id |
String |
Indicates the subnet ID, which is the same as the request parameter. |
security_group_id |
String |
Indicates the ID of the security group to which the instance belongs, which is the same as the request parameter. |
disk_encryption_id |
String |
Indicates the ID of the disk encryption key, which is the same as the request parameter. |
mode |
String |
Indicates the instance type, which is the same as the request parameter. |
flavor |
Array of objects |
Indicates the instance specification, which is the same as the request parameter. For more information, see Table 8. |
backup_strategy |
Object |
Indicates the advanced backup policy, which is the same as the request parameter. For more information, see Table 9. |
enterprise_project_id |
String |
Indicates the enterprise project ID. If the value is 0, the resource belongs to the default enterprise project. |
job_id |
String |
Indicates the ID of the workflow for creating a DB instance. |
ssl_option |
String |
Indicates whether to enable SSL, which functions the same as the request parameter. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Specifies the database type. The value is DDS-Community. |
version |
Yes |
String |
Specifies the database version. Versions 4.4, 4.2, 4.0, 3.4 and 3.2 are supported. The value can be 4.4, 4.2, 4.0, 3.4 or 3.2. |
storage_engine |
Yes |
String |
Specifies the storage engine. DDS supports the WiredTiger and RocksDB storage engines.
|
Name |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Specifies the node type. Valid value:
|
num |
Yes |
String |
Specifies node quantity. Valid value:
|
storage |
No |
String |
Specifies the disk type. Valid value: ULTRAHIGH, which indicates the type SSD. This parameter is valid for the shard and config nodes of a cluster instance, replica set instances, and single node instances. This parameter is invalid for mongos nodes. Therefore, you do not need to specify the storage space for mongos nodes. |
size |
No |
String |
Specifies the disk size. This parameter is mandatory for all nodes except mongos. This parameter is invalid for the mongos nodes. The value must be a multiple of 10. The unit is GB.
|
spec_code |
Yes |
String |
Specifies the resource specification code. For details about how to obtain the value, see the response values of spec_code in Querying Database Specifications. In a cluster instance, multiple specifications need to be specified. All specifications must be of the same series, that is, general-purpose (s6), enhanced (c3), or enhanced II (c6). |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
start_time |
Yes |
String |
Specifies the backup time window. Automated backups will be triggered during the backup time window. The value cannot be empty. It must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.
Example value: 23:00-00:00 |
keep_days |
No |
String |
Specifies the number of days to retain the generated backup files. The value range is from 0 to 732.
|
The values of region and availability_zone are used as examples.
{ "id": "39b6a1a278844ac48119d86512e0000bin02", "name": "test-cluster-01", "datastore": { "type": "DDS-Community", "version": "4.0", "storage_engine": "wiredTiger" }, "created": "2019-01-16 09:34:36", "status": "creating", "region": "aaa", "availability_zone": "bbb", "vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961", "subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007b", "security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58", "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "mode": "Sharding", "flavor": [ { "type": "mongos", "num": "2", "spec_code": "dds.mongodb.c3.medium.4.mongos" }, { "type": "shard", "num": "2", "spec_code": "dds.mongodb.c3.medium.4.shard", "size": "20" }, { "type": "config", "num": "1", "spec_code": "dds.mongodb.c3.large.2.config", "size": "20" } ], "backup_strategy": { "start_time": "23:00-00:00", "keep_days": "8" }, "enterprise_project_id": "", "ssl_option":"1", "job_id": "c010abd0-48cf-4fa8-8cbc-090f093eaa2f" }
Replica set instance:
{ "id": "46dfadfd2b674585a430217f23606cd7in02", "name": "test-replicaset", "datastore": { "type": "DDS-Community", "version": "4.0", "storage_engine": "wiredTiger" }, "created": "2019-01-16 09:33:08", "status": "creating", "region": "aaa", "availability_zone": "bbb", "vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961", "subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007b", "security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58", "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "mode": "ReplicaSet", "flavor": [ { "type": "replica", "num": "1", "spec_code": "dds.mongodb.s2.medium.4.repset", "size": "30" } ], "backup_strategy": { "start_time": "23:00-00:00", "keep_days": "7" }, "enterprise_project_id": "", "ssl_option":"1", "job_id": "2408417d-fd4b-40ae-bec6-e09ce594eb5f" }
Single node instance:
{ "id": "520c58ba00a3497e97ce0b9604874dd6in02", "name": "test-singlenode", "datastore": { "type": "DDS-Community", "version": "4.0", "storage_engine": "wiredTiger" }, "created": "2019-01-15 12:08:11", "status": "creating", "region": "aaa", "availability_zone": "bbb", "vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961", "subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007b", "security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58", "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "mode": "Single", "flavor": [ { "type": "single", "num": "1", "spec_code": "dds.mongodb.c3.medium.4.single", "size": "30" } ], "backup_strategy": { "start_time": "23:00-00:00", "keep_days": "7" }, "enterprise_project_id": "", "ssl_option":"1", "job_id": "46b65a13-3d52-4c58-a29b-4085d563dc9b" }
For more information, see Error Code.