Updated on 2024-06-07 GMT+08:00

Restoring Data to a New DB Instance

Function

This API is used to restore data to a new DB instance.

  • Before calling an API, you need to understand the API in Authentication.

Constraints

  • The DB engine of the original DB instance must be the same as that of the target DB instance. For example, if the original DB instance is running MySQL, the target DB instance must also run MySQL.
  • The constraints on the original and target DB instances are as follows:
    • For RDS for MySQL and RDS for PostgreSQL, the DB engine versions of the original and target DB instances must be the same.
    • For RDS for SQL Server, the time zones of the original and target DB instances must be the same. Otherwise, data inconsistency may occur.
  • For RDS for MySQL and RDS for PostgreSQL, the total volume size of the target DB instance must be at least equal to that of the original DB instance.

URI

  • URI format

    POST /v3/{project_id}/instances

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

Request

Table 2 Parameter description

Name

Mandatory

Type

Description

name

Yes

String

Specifies the DB instance name.

DB instances of the same type can have same names under the same tenant.

Valid value:

  • RDS for MySQL: The DB instance name must be 4 to 64 bytes long, start with a letter, and contain only letters (case-sensitive), digits, hyphens (-), periods (.), and underscores (_).
  • RDS for PostgreSQL and RDS for SQL Server: The DB instance name must be 4 to 64 bytes long, start with a letter, and contain only letters (case-sensitive), digits, hyphens (-), and underscores (_).

password

No

String

Specifies the database password. If this parameter is not specified, the password will be set by resetting the password after the instance is created.

Valid value:

A database password must be 8 to 32 characters long and contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters.

  • RDS for MySQL: ~!@#$%^*-_=+?,()&
  • RDS for SQL Server: ~!@#$%^*-_+?,
  • RDS for PostgreSQL: ~!@#%^*-_=+?,

You are advised to enter a strong password to improve security, preventing security risks such as brute force cracking.

flavor_ref

Yes

String

Specifies the specification code. The value cannot be empty.

For details, see spec_code in section Querying Database Specifications.

volume

Yes

Object

Specifies the volume information.

For details, see Table 7.

availability_zone

Yes

String

Specifies the AZ ID. If the DB instance is not a single instance, you need to specify an AZ for each node of the instance and separate the AZs with commas (,). For details, see the example.

The value cannot be empty. For details about how to obtain this parameter value, see Regions and Endpoints.

restore_point

Yes

Object

Specifies the restoration information.

For details, see Table 8.

datastore

No

Object

Specifies database information. This parameter is used for RDS for SQL Server DB instances only and is mandatory for cross-version restoration to new DB instances.

For details, see Table 4.

For details about versions for RDS for SQL Server restoration, see Table 5.

ha

No

Object

Specifies the HA configuration parameters, which are used when creating primary/standby DB instances.

For details, see Table 3.

configuration_id

No

String

Specifies the parameter template ID.

port

No

String

Specifies the database port information.

  • RDS for MySQL instances can use database ports 1024 to 65535, excluding 12017 and 33071, which are reserved for RDS system use.
  • RDS for PostgreSQL instances can use database ports 2100 to 9500.
  • For RDS for SQL Server 2022 Enterprise Edition, 2022 Standard Edition, 2022 Web Edition, 2019 Enterprise Edition, 2019 Standard Edition, 2019 Web Edition, 2017 Enterprise Edition, 2017 Standard Edition, and 2017 Web Edition, the port number can be set to 1433 or 2100 to 9500 (excluding 5050, 5353, 5355, 5985, and 5986).

    For other editions, the port number can be set to 1433 or 2100 to 9500 (excluding 5355, 5985, and 5986).

If this parameter is not set, the default value is as follows:

  • RDS for MySQL: 3306
  • RDS for PostgreSQL: 5432
  • RDS for SQL Server: 1433

backup_strategy

No

Object

Specifies the advanced backup policy.

For details, see Table 6.

enterprise_project_id

No

String

Specifies the project ID.

disk_encryption_id

No

String

Specifies the key ID for disk encryption. The default value is empty.

NOTE:

Serverless instances do not support this parameter.

region

No

String

Specifies the region ID. For details, see Regions and Endpoints.

This parameter is mandatory for RDS for SQL Server and RDS for PostgreSQL.

vpc_id

No

String

Specifies the VPC ID. To obtain this parameter value, use either of the following methods:

  • Method 1: Log in to VPC console and view the VPC ID in the VPC details.
  • Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference.

This parameter is mandatory for RDS for SQL Server and RDS for PostgreSQL.

subnet_id

No

String

Specifies the subnet ID. To obtain this parameter value, use either of the following methods:

  • Method 1: Log in to the VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page.
  • Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference.

This parameter is mandatory for RDS for SQL Server and RDS for PostgreSQL.

data_vip

No

String

Specifies the floating IP address of a DB instance. To obtain this parameter value, use either of the following methods:

  • Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the subnet CIDR block on the displayed page.
  • Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference.

security_group_id

No

String

Specifies the security group which the RDS DB instance belongs to. To obtain this parameter value, use either of the following methods:

  • Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane on the left. On the displayed page, click the target security group. You can view the security group ID on the displayed page.
  • Method 2: See the "Querying Security Groups" section in the Virtual Private Cloud API Reference.

This parameter is mandatory for RDS for SQL Server and RDS for PostgreSQL.

To use multiple security groups for an RDS for MySQL instance, choose Service Tickets > Create Service Ticket in the upper right corner of the management console to apply for the required permissions. You can add up to 10 security group IDs for each instance and separate them with commas (,).

charge_info

No

Object

Specifies the billing information, which is yearly/monthly or pay-per-use (default setting). Only RDS for SQL Server supports restoration of yearly/monthly DB instances to new instances.

For details, see Table 10.

time_zone

No

String

Specifies the UTC time zone.

  • If this parameter is not specified, the time zone of each engine is as follows:
    • MySQL: Chinese mainland site and international site use UTC by default.
    • PostgreSQL: Chinese mainland site and international site use UTC by default.
    • Microsoft SQL Server: Chinese mainland site and international site use China Standard Time and UTC, respectively.
  • If this parameter is specified, the value range is from UTC-12:00 to UTC+12:00 on the hour. For example, the parameter can be UTC+08:00 rather than UTC+08:30.

dsspool_id

No

String

Specifies the DSS pool ID of DeC users. The DSS pool configured for each AZ is different. When DeC users create DB instances other than single instances or read replicas, DSS pool IDs must be specified for all nodes of the DB instances and must be separated by commas (,). To obtain the DSS pool ID, you can use either of the following methods:

  • Method 1: Log in to the DSS console, view the DSS pool list, and select the desired DSS ID in the AZ.
  • Method 2: Query the DSS pool ID using the DSS API. For details, see Obtaining Details of DSS Storage Pools.

collation

No

String

This parameter applies only to RDS for SQL Server DB instances.

Value range: character sets queried in Querying the Available SQL Server Character Set.

tags

No

Array of objects

Specifies the tag list. DB instances are created based on tag keys and values.

  • {key} indicates the tag key. It must be unique and cannot be empty.
  • {value} indicates the tag value, which can be empty.

If you want to create DB instances with multiple tag keys and values, separate them with commas (,). A maximum of 20 key-value pairs can be added for a DB instance.

For details, see Table 11.

dry_run

No

Boolean

Specifies whether DB instances will not be created after the request is checked. This parameter is supported with MySQL only.

  • true: DB instances will not be created after the request is checked.
    • If the check is successful, status code 202 is returned.
    • If the check fails, an error code is returned. For details, see Error Codes.
  • false: DB instances will be created after the check is successful.

serverless_info

No

Object

Specifies the resource scaling scope of a serverless instance. This parameter is mandatory when you create a serverless instance.

For details, see Table 9.

Table 3 ha field data structure description

Name

Mandatory

Type

Description

mode

Yes

String

Specifies the primary/standby instance type. The value is Ha (case-insensitive).

replication_mode

Yes

String

Specifies the replication mode for the standby DB instance.

The value cannot be empty.

  • RDS for MySQL: The value is async or semisync.
  • RDS for PostgreSQL: The value is async or sync.
  • RDS for SQL Server: The value is sync.
NOTE:
  • async indicates the asynchronous replication mode.
  • semisync indicates the semi-synchronous replication mode.
  • sync indicates the synchronous replication mode.
Table 4 datastore field data structure description

Name

Mandatory

Type

Description

type

Yes

String

Specifies the DB engine. Value:

SQLServer

version

Yes

String

Specifies the database version.

  • For RDS for SQL Server, only 2019 Enterprise Edition, 2019 Standard Edition, 2019 Web Edition, 2017 Enterprise Edition, 2017 Standard Edition, 2017 Web Edition, 2014 Standard Edition, 2014 Enterprise Edition, 2016 Standard Edition, 2016 Enterprise Edition, 2012 Enterprise Edition, 2012 Standard Edition, 2012 Web Edition, 2014 Web Edition, and 2016 Web Edition are supported. Example value: 2014_SE 2008 R2 Enterprise Edition and 2008 R2 Web Edition are only for installed base operations.

For details about supported database versions, see Querying Version Information About a DB Engine.

Table 5 Version mapping for RDS for SQL Server restoration

Original

Restore To

2008 R2 Standard Edition

2012 Standard Edition

2012 Enterprise Edition

2014 Standard Edition

2014 Enterprise Edition

2016 Standard Edition

2016 Enterprise Edition

2017 Standard Edition

2017 Enterprise Edition

2012 Web Edition

2012 Web Edition

2012 Standard Edition

2012 Enterprise Edition

2014 Web Edition

2014 Standard Edition

2014 Enterprise Edition

2016 Web Edition

2016 Standard Edition

2016 Enterprise Edition

2017 Web Edition

2017 Standard Edition

2017 Enterprise Edition

2012 Standard Edition

2012 Standard Edition

2012 Enterprise Edition

2014 Standard Edition

2014 Enterprise Edition

2016 Standard Edition

2016 Enterprise Edition

2017 Standard Edition

2017 Enterprise Edition

2012 Enterprise Edition

2012 Enterprise Edition

2014 Enterprise Edition

2016 Enterprise Edition

2017 Enterprise Edition

2014 Standard Edition

2014 Standard Edition

2014 Enterprise Edition

2016 Standard Edition

2016 Enterprise Edition

2017 Standard Edition

2017 Enterprise Edition

2014 Enterprise Edition

2014 Enterprise Edition

2016 Enterprise Edition

2017 Enterprise Edition

2016 Standard Edition

2016 Standard Edition

2016 Enterprise Edition

2017 Standard Edition

2017 Enterprise Edition

2016 Enterprise Edition

2016 Enterprise Edition

2017 Enterprise Edition

2017 Web Edition

2017 Web Edition

2017 Standard Edition

2017 Enterprise Edition

2017 Standard Edition

2017 Standard Edition

2017 Enterprise Edition

2017 Enterprise Edition

2017 Enterprise Edition

Table 6 backup_strategy field data structure description

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.

  • The HH value must be 1 greater than the hh value.
  • The values of mm and MM must be the same and must be set to any of the following: 00, 15, 30, or 45.

Example value:

  • 08:15-09:15
  • 23:00-00:00

keep_days

No

Integer

Specifies the retention days for specific backup files.

The value range is from 0 to 732. If this parameter is not specified or set to 0, the automated backup policy is disabled. To extend the retention period, contact customer service. Automated backups can be retained for up to 2,562 days.

Table 7 volume field data structure description

Name

Mandatory

Type

Description

type

Yes

String

Specifies the volume type.

Its value can be any of the following and is case-sensitive:

  • ULTRAHIGH: ultra-high I/O type.
  • LOCALSSD: indicates the local SSD type.
  • CLOUDSSD: indicates the cloud SSD type.
  • ESSD: indicates the extreme SSD type.

size

Yes

Integer

Specifies the volume size.

Its value range is from 40 GB to 4,000 GB. The value must be a multiple of 10.

NOTICE:

The volume size of the new DB instance must be at least equal to that of the original DB instance for RDS for MySQL and RDS for PostgreSQL.

Table 8 restore_point field data structure description

Name

Mandatory

Type

Description

instance_id

Yes

String

Specifies the DB instance ID.

type

Yes

String

Specifies the restoration mode. Enumerated values include:

  • backup: indicates restoration from backup files. In this mode, backup_id is mandatory when type is not mandatory.
  • timestamp: indicates point-in-time restoration. In this mode, restore_time is mandatory when type is mandatory.

backup_id

No

String

Specifies the ID of the backup used to restore data. This parameter must be specified when the backup file is used for restoration.

NOTICE:

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.

NOTICE:

When type is mandatory, restore_time is mandatory.

database_name

No

Map<String, String>

This parameter applies only to Microsoft SQL Server databases.

  • If this parameter is specified, you can restore all or specific databases and rename new databases.
  • If this parameter is not specified, all databases are restored by default.
  • You can enter multiple new database names and separate them with commas (,). The new database names can contain but cannot be the same as the original database names.
  • Note the following when you are specifying new database names:
    • New database names must be different from the original database names. If they are left blank, the original database names will be used for restoration by default.
    • The case-sensitivity settings of the new databases are the same as those of the original databases. Make sure the new database names are unique.
    • New database names must be different from any database names on the original DB instance.
    • The total number of new databases cannot exceed the database quota specified by rds_databases_quota.
    • New database names cannot contain the following fields (case-insensitive): rdsadmin, master, msdb, tempdb, model, and resource.
    • New database names must consist of 1 to 64 characters, including only letters, digits, underscores (_), and hyphens (-). If you want to restore data to multiple new databases, separate them with commas (,).

Example:

"database_name":{"Original database name":"New database name"}

Correct example: "database_name":{"A":"A,A1,A2","B":"B1,B2","C":""}

Wrong example: "database_name":{"A":"A","B":"B1,B2","C":"B1,C1","D":"D1,d1"},

Error causes are as follows:

  1. The new database name (A) is the same as the original database name (A).
  2. The new database name (B1) is not unique.
  3. When the database name is case insensitive, the database names D1 and d1 conflict.
    CAUTION:

    Before the restoration, make sure that the size of the restored data does not exceed the purchased disk capacity.

Table 9 serverless_info field data structure description

Parameter

Mandatory

Type

Description

min_cap

Yes

String

Minimum compute power of a serverless instance, in RCU. The value ranges from 0.5 to 8 and the step is 0.5.

NOTE:

RCU: RDS Capacity Unit. It is the billing unit for serverless instances.

The value of max_cap must be greater than that of min_cap.

max_cap

Yes

String

Maximum compute power of a serverless instance, in RCU. The value ranges from 0.5 to 8 and the step is 0.5.

Table 10 charge_info field data structure description

Name

Mandatory

Type

Description

charge_mode

Yes

String

Specifies the billing mode.

Value range:

  • prePaid: indicates the yearly/monthly billing mode.
  • postPaid: indicates the pay-per-use billing mode.

period_type

No

String

Specifies the subscription type.

Value range:

  • month: indicates that the service is subscribed by month.
  • year: indicates that the service is subscribed by year.
    NOTE:

    This parameter is valid and mandatory if charge_mode is set to prePaid.

period_num

No

Integer

Specifies the subscription period. This parameter is valid and mandatory if charge_mode is set to prePaid.

Value range:

  • When period_type is set to month, the parameter value ranges from 1 to 9.
  • When period_type is set to year, the parameter value ranges from 1 to 3.

is_auto_renew

No

boolean

Specifies whether automatic renewal is enabled for yearly/monthly DB instances. The renewal period is the same as the original period and the order will be automatically paid.

  • true: indicates that automatic renewal is enabled.
  • false: indicates that automatic renewal is disabled. The default value is false.

is_auto_pay

No

boolean

Specifies whether the order will be automatically paid after yearly/monthly DB instances are created. This parameter does not affect the payment mode of automatic renewal.

  • true: indicates the order will be automatically paid.
  • false: indicates the order will be manually paid. The default value is false.

Table 11 tags field data structure description

Name

Mandatory

Type

Description

key

Yes

String

Tag key. It must consist of 1 to 128 Unicode characters, including letters, digits, spaces, and special characters _.:=+-@. However, it cannot start or end with a space, or start with _sys_.

value

Yes

String

Tag value. It can be left blank or contain a maximum of 255 Unicode characters, including letters, digits, spaces and special characters _.:=+-@.

Example Request

  • Restore an RDS for MySQL backup to a new DB instance.
    POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances
    
    {
    	"name": "targetInst",
    	"availability_zone": "bbb,ccc",
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "async"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 40
    	},
            "region": "aaa",
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.147",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"backup_strategy": {
    		"keep_days": 2,
    		"start_time": "19:00-20:00"
    	},
    	"password": "Demo@12345678",
    	"configuration_id": "52e86e87445847a79bf807ceda213165pr01",
    	"enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c",
    	"time_zone": "UTC+04:00",
    	"restore_point": {
    		"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01",
    		"type": "backup",
    		"backup_id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe"
    	}
    }
  • Restore some databases to a new DB instance from an RDS for SQL Server backup.
    {
    	"name": "targetInst",
            "datastore": {
    		"type": "SQLServer",
    		"version": "2014_SE"
    	},
    	"availability_zone": "bbb,ccc",
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "sync"
    	},
    	"flavor_ref": "rds.mssql.2014.se.s3.xlarge.2.ha",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 40
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.147",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"backup_strategy": {
    		"keep_days": 2,
    		"start_time": "19:00-20:00"
    	},
           "charge_info": {
    	       "charge_mode": "prePaid",		
                   "period_type": "month",
                   "period_num": 1,
                   "is_auto_renew": false,
                   "is_auto_pay": true
           },
    	"password": "Demo@12345678",
    	"configuration_id": "52e86e87445847a79bf807ceda213165pr04",
    	"enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c",
    	"time_zone": "UTC+04:00",
            "collation": "Cyrillic_General_CI_AS",
    	"restore_point": {
    		"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin04",
    		"type": "backup",
    		"backup_id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe",
    		"database_name": {
    			"db1": "dbtest1,dbtest2",
    			"db2": "db2,db002",
                            "db3": ""
    		}
    	}
    }
  • Restore data of an RDS for MySQL DB instance to a specific point in time.
    {
    	"name": "targetInst",
    	"availability_zone": "bbb,ccc",
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "async"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 40
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"data_vip": "192.168.0.147",
    	"backup_strategy": {
    		"keep_days": 2,
    		"start_time": "19:00-20:00"
    	},
    	"password": "Demo@12345678",
    	"configuration_id": "52e86e87445847a79bf807ceda213165pr01",
    	"enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c",
    	"time_zone": "UTC+04:00",
    	"restore_point": {
    		"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01",
    		"type": "timestamp",
    		"restore_time": 1532001446987
    	}
    }
  • Restore some databases of an RDS for SQL Server instance to a specific point in time.
    {
    	"name": "targetInst",
            "datastore": {
    		"type": "SQLServer",
    		"version": "2014_SE"
    	},
    	"availability_zone": "bbb,ccc",
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "sync"
    	},
    	"flavor_ref": "rds.mssql.2014.se.s3.xlarge.2.ha",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 40
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.147",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"backup_strategy": {
    		"keep_days": 2,
    		"start_time": "19:00-20:00"
    	},
            "charge_info": {
    	       "charge_mode": "prePaid",		
                   "period_type": "month",
                   "period_num": 1,
                   "is_auto_renew": false,
                   "is_auto_pay": true
           },
    	"password": "Demo@12345678",
    	"configuration_id": "52e86e87445847a79bf807ceda213165pr04",
    	"enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c",
    	"time_zone": "UTC+04:00",
            "collation": "Cyrillic_General_CI_AS",
    	"restore_point": {
    		"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin04",
    		"type": "timestamp",
    		"restore_time": 1532001446987,
    		"database_name": {
    			"db1": "dbtest1,dbtest2",
    			"db2": "db2,db02",
                            "db3": ""
    		}
    	}
    }
  • Restore an RDS for MySQL serverless backup to a new DB instance.
    {
    	"name": "serverless",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.7"
    	},
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "semisync"
    	},
    	"flavor_ref": "rds.mysql.serverless.ha",
    	"volume": {
    		"type": "CLOUDSSD",
    		"size": 100
    	},
    	"region": "aaa",
    	"availability_zone": "bbb,ccc",
    	"vpc_id": "bd3e4c67-74da-459d-820f-9fecd4ea9ca4",
    	"subnet_id": "53cdf568-6f56-4944-a996-4afcaffe994e",
    	"security_group_id": "89f258c5-4b81-4ef0-be30-34f2ee07dd1c",
    	"port": 3307,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"password": "****",
    	"time_zone": "UTC+08:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
        "dry_run": false,
        "serverless_info": {
            "min_cap": "0.5",
            "max_cap": "1"
        },
        "restore_point": {
    		"instance_id": "aceb1e359a444660bb8fe0696afc76e1in01",
    		"type": "backup",
    		"backup_id": "0db0b4b93e5d40afbd65ede29153dc46br01"
    	}
    }

Response

  • Normal response
    Table 12 Parameter description

    Name

    Type

    Description

    instance

    Object

    Indicates the DB instance information.

    For details, see Table 13.

    job_id

    String

    Indicates the ID of the DB instance creation task. This parameter is returned only for the restoration to a new DB instance billed on the pay-per-use basis.

    order_id

    String

    Indicates the order ID. This parameter is returned only for the creation of an RDS for SQL Server DB instance billed on the yearly/monthly basis.

    Table 13 instance description

    Name

    Type

    Description

    id

    String

    Indicates the DB instance ID.

    name

    String

    Indicates the DB instance name.

    DB instances of the same type can have same names under the same tenant.

    status

    String

    Indicates the DB instance status. For example, BUILD indicates that the DB instance is being created.

    datastore

    Object

    Indicates the database information.

    For details, see Table 14.

    ha

    Object

    Indicates the HA configuration parameters. This parameter is returned only when primary/standby DB instances are created.

    For details, see Table 15.

    configuration_id

    String

    Indicates the parameter template ID. This parameter is returned only when a custom parameter template is used during DB instance creation.

    port

    String

    Indicates the database port information.

    • RDS for MySQL instances can use database ports 1024 to 65535, excluding 12017 and 33071, which are reserved for RDS system use.
    • RDS for PostgreSQL instances can use database ports 2100 to 9500.
    • For RDS for SQL Server 2022 Enterprise Edition, 2022 Standard Edition, 2022 Web Edition, 2019 Enterprise Edition, 2019 Standard Edition, 2019 Web Edition, 2017 Enterprise Edition, 2017 Standard Edition, and 2017 Web Edition, the port number can be set to 1433 or 2100 to 9500 (excluding 5050, 5353, 5355, 5985, and 5986).

      For other editions, the port number can be set to 1433 or 2100 to 9500 (excluding 5355, 5985, and 5986).

    If this parameter is not set, the default value is as follows:

    • RDS for MySQL: 3306
    • RDS for PostgreSQL: 5432
    • RDS for SQL Server: 1433

    backup_strategy

    Object

    Indicates the automated backup policy.

    For details, see Table 16.

    enterprise_project_tag

    String

    Indicates the project ID.

    flavor_ref

    String

    Indicates the specification ID.

    For details, see spec_code in Table 3 in section Querying Database Specifications.

    volume

    Object

    Indicates the volume information.

    For details, see Table 17.

    region

    String

    Indicates the region ID.

    availability_zone

    String

    Indicates the AZ ID.

    vpc_id

    String

    Specifies the VPC ID. To obtain this parameter value, use either of the following methods:

    • Method 1: Log in to VPC console and view the VPC ID in the VPC details.
    • Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference.

    subnet_id

    String

    Specifies the network ID. To obtain this parameter value, use either of the following methods:

    • Method 1: Log in to the VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page.
    • Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference.

    security_group_id

    String

    Indicates the security group which the RDS DB instance belongs to. To obtain this parameter value, use either of the following methods:

    • Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane on the left. On the displayed page, click the target security group. You can view the security group ID on the displayed page.
    • Method 2: See the "Querying Security Groups" section in the Virtual Private Cloud API Reference.

    collation

    String

    Indicates the collation for RDS for SQL Server.

    charge_info

    Object

    Indicates the billing information, which is yearly/monthly or pay-per-use.

    For details, see Table 10.

    Table 14 datastore field data structure description

    Name

    Mandatory

    Type

    Description

    type

    Yes

    String

    Indicates the DB engine. Its value can be any of the following and is case-insensitive:

    • MySQL
    • PostgreSQL
    • SQLServer

    version

    Yes

    String

    Indicates the database version.

    For details about supported database versions, see section Querying Version Information About a DB Engine.

    complete_version

    No

    String

    Indicates the complete version number. This parameter is returned only when the DB engine is PostgreSQL.

    Table 15 ha field data structure description

    Name

    Mandatory

    Type

    Description

    mode

    Yes

    String

    Indicates the primary/standby instance type. The value is Ha.

    replication_mode

    Yes

    String

    Indicates the replication mode for the standby DB instance.

    The value cannot be empty.

    • RDS for MySQL: The value is async or semisync.
    • RDS for PostgreSQL: The value is async or sync.
    • RDS for SQL Server: The value is sync.
    NOTE:
    • async indicates the asynchronous replication mode.
    • semisync indicates the semi-synchronous replication mode.
    • sync indicates the synchronous replication mode.
    Table 16 backupStrategy field data structure description

    Name

    Mandatory

    Type

    Description

    start_time

    Yes

    String

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

    • The HH value must be 1 greater than the hh value.
    • The values of mm and MM must be the same and must be set to any of the following: 00, 15, 30, or 45.

    Example value:

    • 08:15-09:15
    • 23:00-00:00

    keep_days

    No

    Integer

    Indicates the retention days for specific backup files.

    The value range is from 0 to 732. If this parameter is not specified or set to 0, the automated backup policy is disabled. To extend the retention period, contact customer service. Automated backups can be retained for up to 2,562 days.

    Table 17 volume field data structure description

    Name

    Mandatory

    Type

    Description

    type

    Yes

    String

    Indicates the volume type.

    Its value can be any of the following and is case-sensitive:

    • ULTRAHIGH: ultra-high I/O type.
    • LOCALSSD: indicates the local SSD type.
    • CLOUDSSD: indicates the cloud SSD type.
    • ESSD: indicates the extreme SSD type.

    size

    Yes

    Integer

    Indicates the volume size.

    Its value range is from 40 GB to 4,000 GB. The value must be a multiple of 10.

  • Example normal response

    RDS for MySQL

    {
    	"instance": {
    		"id": "f5ffdd8b1c98434385eb001904209eacin01",
    		"name": "demoname",
    		"status": "BUILD",
    		"datastore": {
    			"type": "MySQL",
    			"version": "5.7.31"
    		},
    		"port": "3306",
    		"volume": {
    			"type": "ULTRAHIGH",
    			"size": "40"
    		},
    		"region": "aaa",
    		"backup_strategy": {
    			"start_time": "02:00-03:00",
    			"keep_days": "7"
    		},
    		"flavor_ref": "rds.mysql.s1.large",
    		"availability_zone": "bbb",
    		"vpc_id": "19e5d45d-70fd-4a91-87e9-b27e71c9891f",
    		"subnet_id": "bd51fb45-2dcb-4296-8783-8623bfe89bb7",
    		"security_group_id": "23fd0cd4-15dc-4d65-bdb3-8844cc291be0"
    	},
    	"job_id": "bf003379-afea-4aa5-aa83-4543542070bc"
    }

    RDS for PostgreSQL

    {
    	"instance": {
    		"id": "f5ffdd8b1c98434385eb001904209eacin01",
    		"name": "demoname",
    		"status": "BUILD",
    		"datastore": {
    			"type": "PostgreSQL",
    			"version": "9.6.13"
    		},
    		"port": "5432",
    		"volume": {
    			"type": "ULTRAHIGH",
    			"size": "40"
    		},
    		"region": "aaa",
    		"backup_strategy": {
    			"start_time": "02:00-03:00",
    			"keep_days": "7"
    		},
    		"flavor_ref": "rds.pg.s1.large",
    		"availability_zone": "bbb",
    		"vpc_id": "19e5d45d-70fd-4a91-87e9-b27e71c9891f",
    		"subnet_id": "bd51fb45-2dcb-4296-8783-8623bfe89bb7",
    		"security_group_id": "23fd0cd4-15dc-4d65-bdb3-8844cc291be0"
    	},
    	"job_id": "bf003379-afea-4aa5-aa83-4543542070bc"
    }

    RDS for SQL Server

    {
    	"instance": {
    		"id": "f5ffdd8b1c98434385eb001904209eacin01",
    		"name": "demoname",
    		"status": "BUILD",
    		"datastore": {
    			"type": "sqlserver",
    			"version": "2014_SE"
    		},
    		"port": "2100",
    		"volume": {
    			"type": "ULTRAHIGH",
    			"size": "40"
    		},
    		"region": "aaa",
    		"backup_strategy": {
    			"start_time": "02:00-03:00",
    			"keep_days": "7"
    		},
    		"flavor_ref": "rds.mssql.2014.se.s3.large.2",
    		"availability_zone": "bbb",
    		"vpc_id": "19e5d45d-70fd-4a91-87e9-b27e71c9891f",
    		"subnet_id": "bd51fb45-2dcb-4296-8783-8623bfe89bb7",
    		"security_group_id": "23fd0cd4-15dc-4d65-bdb3-8844cc291be0",
                    "charge_info": {           
                           "charge_mode": "prePaid",            
                           "period_num": 1        
                     },        
                    "collation": "Cyrillic_General_CI_AS"
    	},
    	"order_id": "CS20122919584LQ7K"
    }

    RDS for MySQL Serverless

    {
        "instance": {
            "id": "dbb35f31f4144086bf522ff8a124530din01",
            "name": "serverless",
            "status": "BUILD",
            "datastore": {
                "type": "MySQL",
                "version": "5.7.41"
            },
            "ha": {
                "mode": "Ha",
                "replication_mode": "semisync"
            },
            "port": "3307",
            "volume": {
                "type": "CLOUDSSD",
                "size": 100
            },
            "region": "aaa",
            "backup_strategy": {
                "start_time": "08:15-09:15",
                "keep_days": 12
            },
            "flavor_ref": "rds.mysql.serverless.ha",
            "availability_zone": "bbb,ccc",
            "vpc_id": "bd3e4c67-74da-459d-820f-9fecd4ea9ca4",
            "subnet_id": "53cdf568-6f56-4944-a996-4afcaffe994e",
            "security_group_id": "89f258c5-4b81-4ef0-be30-34f2ee07dd1c"
        },
        "job_id": "908c05f7-958a-4411-b590-890eed175345"
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.