You are not logged in.
RestoreNewInstance
This API is used to restore a backup to a new DB instance.
Name | Type | IN | Mandatory | Description |
---|---|---|---|---|
x-auth-token | string | header | Yes | Specifies the user token obtained from the IAM service. |
project_id | string | path | Yes | Specifies the project ID of a tenant in a region. |
Name | Type | Mandatory | Description |
---|---|---|---|
name | string | Yes | Specifies the DB instance name. The DB instance name of the same DB engine is unique for the same tenant. The value must be 4 to 64 characters in length and start with a letter (from A to Z or from a to z). It is case-sensitive and can contain only letters, digits (from 0 to 9), hyphens (-), and underscores (_). |
availability_zone | string | Yes | Specifies the AZ ID. |
vpc_id | string | Yes | Specifies the VPC ID. The value cannot be empty. The string length and whether the string complying with UUID regular expression rules are verified. |
subnet_id | string | Yes | Specifies the subnet ID. |
security_group_id | string | Yes | Specifies the ID of the security group where a specified DB instance belongs to. |
password | string | No | 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. If this parameter is not transferred, set a password for the instance before connecting to the instance. |
disk_encryption_id | string | No | Specifies 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 | Array of RestoreNewInstanceFlavorOption objects | Yes | Specifies the instance specifications. |
backup_strategy | BackupStrategy object | No | Specifies the advanced backup policy. |
enterprise_project_id | string | No | Specifies the enterprise project ID. |
ssl_option | string | No | Specifies whether to enable or disable SSL. Valid value:
|
dss_pool_id | string | No | Specifies the DSS storage pool ID of the DeC user. The value is left blank by default. Only DeC users can set this parameter. |
server_group_policies | Array of strings | No | Specifies the names of the policies associated with the ECS group of the DeC user. Available values include:
|
restore_point | RestorePoint object | Yes | Specifies the details about the backup to be restored to a new DB instance. |
Name | Type | Mandatory | Description |
---|---|---|---|
type | string | Yes | Specifies the node type. Valid value:
|
num | string | Yes | Specifies node quantity. Valid value:
|
size | string | No | Specifies the disk size. The value must be a multiple of 10. The unit is GB.
|
spec_code | string | Yes | Specifies the resource specification code. |
Name | Type | Mandatory | Description |
---|---|---|---|
start_time | string | Yes | 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.
|
keep_days | string | No | Specifies the number of days to retain the generated backup files. The value range is from 0 to 732.
|
Name | Type | Mandatory | Description |
---|---|---|---|
instance_id | string | No | Specifies the instance ID, which can be obtained by calling the API for querying instances and details. If you do not have an instance, you can call the API used for creating an instance.
|
type | string | No | Specifies the recovery mode. The enumerated values are as follows:
|
backup_id | string | No | Specifies the ID of the backup to be restored. This parameter must be specified when the backup file is used for restoration. When type is not mandatory, backup_id is mandatory. |
restore_time | string | No | Specifies the time point of data restoration in the UNIX timestamp. The unit is millisecond and the time zone is UTC. When type is mandatory, restore_time is mandatory. |
Success.
Name | Type | Description |
---|---|---|
id | string | Indicates the DB instance ID. |
datastore | Datastore object | Indicates the database information, which is the same as the request parameter. |
name | string | Indicates the DB instance name. |
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 VPC 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 RestoreNewInstanceFlavorOption objects | Indicates the instance specification, which is the same as the request parameter. |
backup_strategy | BackupStrategy object | Indicates the advanced backup policy, which is the same as the request parameter. |
enterprise_project_id | string | Indicates the enterprise project ID. If the value is 0, the resource belongs to the default enterprise project. |
ssl_option | string | Indicates whether to enable SSL, which functions the same as the request parameter. |
dss_pool_id | string | Indicates the DSS storage pool ID of the DeC user. |
job_id | string | Indicates the ID of the workflow for creating a DB instance. |
Name | Type | Description |
---|---|---|
type | string | Specifies the database type. The value is DDS-Community. |
version | string | Specifies the database version. Versions 3.4 or later are supported. The value is 3.4, 4.0, 4.2, 4.4, or 5.0. |
storage_engine | string | Specifies the storage engine. Currently, DDS supports the WiredTiger storage engine. The value is wiredTiger. |
Name | Type | Description |
---|---|---|
type | string | Specifies the node type. Valid value:
|
num | string | Specifies node quantity. Valid value:
|
size | string | Specifies the disk size. The value must be a multiple of 10. The unit is GB.
|
spec_code | string | Specifies the resource specification code. |
Name | Type | Description |
---|---|---|
start_time | 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.
|
keep_days | string | Specifies the number of days to retain the generated backup files. The value range is from 0 to 732.
|
Client or server error.
Name | Type | Description |
---|---|---|
error_code | string | Specifies the error returned when a task submission exception occurs. |
error_msg | string | Specifies the description of the error returned when a task submission exception occurs. |
Restoring a backup to a new cluster instance:
"POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances"
{
"name": "test-cluster-01",
"availability_zone": "bbb",
"vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961",
"subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007",
"security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58",
"password": "******",
"restore_point": {
"backup_id": "8f643d252d834a4c916b2db4322f99552734"
},
"flavor": [
{
"type": "mongos",
"num": "2",
"spec_code": "dds.mongodb.c6.medium.4.mongos"
},
{
"type": "shard",
"size": "20",
"spec_code": "dds.mongodb.c6.medium.4.shard"
},
{
"type": "config",
"num": "1",
"size": "20",
"spec_code": "dds.mongodb.c6.large.2.config"
}
],
"backup_strategy": {
"start_time": "08:15-09:15",
"keep_days": "8"
},
"ssl_option": "1",
"dss_pool_id": "f5f84ed7-6f19-4bd4-99d7-b450ad6cc4dd",
"server_group_policies": [
"anti-affinity"
]
}
Restoring a backup to a new replica set instance:
"POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances"
{
"name": "test-replicaset",
"availability_zone": "bbb",
"vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961",
"subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007",
"security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58",
"password": "******",
"restore_point": {
"backup_id": "8f643d252d834a4c916b2db4322f99552734"
},
"flavor": [
{
"type": "replica",
"num": "1",
"storage": "ULTRAHIGH",
"size": "30",
"spec_code": "dds.s2.medium.4.shard"
}
],
"backup_strategy": {
"start_time": "08:15-09:15",
"keep_days": "8"
},
"ssl_option": "1"
}
Restoring a backup to a new single node instance:
"POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances"
{
"name": "test-singlenode",
"availability_zone": "bbb",
"vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961",
"subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007",
"security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58",
"password": "******",
"restore_point": {
"backup_id": "8f643d252d834a4c916b2db4322f99552734"
},
"flavor": [
{
"type": "single",
"num": "1",
"storage": "ULTRAHIGH",
"size": "30",
"spec_code": "dds.mongodb.c6.medium.4.single"
}
],
"backup_strategy": {
"start_time": "08:15-09:15",
"keep_days": "8"
},
"ssl_option": "1"
}
Restoring a backup to a new replica set instance at a point in time:
"POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances"
{
"name": "test-replicaset",
"availability_zone": "bbb",
"vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961",
"subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007",
"security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58",
"password": "******",
"restore_point": {
"instance_id": "8f643d252d834a4c916b2db4322f9955in02",
"type": "timestamp",
"restore_time": 1607689584000
},
"flavor": [
{
"type": "replica",
"num": "1",
"storage": "ULTRAHIGH",
"size": "30",
"spec_code": "dds.s2.medium.4.shard"
}
],
"backup_strategy": {
"start_time": "08:15-09:15",
"keep_days": "8"
},
"ssl_option": "1"
}
Success.
{
"id": "39b6a1a278844ac48119d86512e0000bin02",
"name": "test-cluster-01",
"datastore": {
"type": "DDS-Community",
"version": "3.2",
"storage_engine": "wiredTiger"
},
"created": "2019-01-16 09:34:36",
"status": "creating",
"region": "aaa",
"availability_zone": "bbb",
"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
"mode": "Sharding",
"flavor": [
{
"type": "mongos",
"num": "2",
"spec_code": "dds.mongodb.c6.medium.4.mongos"
},
{
"type": "shard",
"num": "2",
"spec_code": "dds.mongodb.c6.medium.4.shard",
"size": "20"
},
{
"type": "config",
"num": "1",
"spec_code": "dds.mongodb.c6.large.2.config",
"size": "20"
}
],
"backup_strategy": {
"start_time": "08:15-09:15",
"keep_days": "8"
},
"enterprise_project_id": "",
"ssl_option": "1",
"dss_pool_id": "f5f84ed7-6f19-4bd4-99d7-b450ad6cc4dd",
"job_id": "c010abd0-48cf-4fa8-8cbc-090f093eaa2f"
}