Updated on 2025-08-20 GMT+08:00

Creating a DB Instance

Function

This API is used to create an RDS single-node DB instance, primary/standby DB instance, or read replica.

This API allows you to set the X-Client-Token request header in the HTTP request header when you create an RDS for MySQL instance, to ensure the request idempotence. For details, see Idempotent Requests.

URI

  • URI format

    POST /v3/{project_id}/instances

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request

Table 2 Parameters (creating single-node, primary/standby, and cluster instances, except RDS for SQL Server instances configured with the AD domain)

Parameter

Mandatory

Type

Description

name

Yes

String

Definition

Specifies the DB instance name. Instances of the same type can have the same name under the same tenant.

Constraints

N/A

Range

  • 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 (_).

Default Value

N/A

datastore

Yes

Object

Definition

Specifies the database information.

For details, see Table 4.

Constraints

N/A

flavor_ref

Yes

String

Definition

Specifies the specification code.

Constraints

N/A

Range

The value cannot be empty. For details, see spec_code in Table 3 in section Querying Database Specifications.

Default Value

N/A

volume

Yes

Object

Definition

Specifies instance storage.

For details, see Table 7.

Constraints

N/A

region

Yes

String

Definition

Specifies the region ID.

Constraints

N/A

Range

The value cannot be empty. To obtain this value, see Regions and Endpoints.

Default Value

N/A

availability_zone

Yes

String

Definition

Specifies the AZ ID. If the DB instance is not a single-node 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 AZ ID can be obtained from the response returned after the API in Querying Database Specifications is called.

Constraints

N/A

Range

Default Value

N/A

vpc_id

Yes

String

Definition

Specifies the VPC ID.

Constraints

N/A

Range

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

Default Value

N/A

subnet_id

Yes

String

Definition

Specifies the network ID of the subnet.

Constraints

N/A

Range

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

Default Value

N/A

security_group_id

Yes

String

Definition

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

Constraints

N/A

Range

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

To use multiple security groups for an RDS for MySQL instance, submit a service ticket to apply for required permissions. You can add up to 10 security group IDs for each instance and separate them with commas (,).

Default Value

N/A

ha

No

Object

Definition

Specifies the HA configuration, which is used when you create primary/standby instances.

For details, see Table 5.

Constraints

N/A

configuration_id

No

String

Definition

Specifies the parameter template ID.

Constraints

N/A

Range

For details, see id in Table 3 in section Obtaining a Parameter Template List.

Default Value

N/A

port

No

String

Definition

Specifies the database port information.

Constraints

N/A

Range

  • 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).

Default Value

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

password

No

String

Definition

Specifies the database password.

Constraints

N/A

Range

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.

Different DB engines support different 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. If the password you provide is regarded as a weak password by the system, you will be prompted to enter a stronger password.

Default Value

N/A

backup_strategy

No

Object

Definition

Specifies the advanced backup policy.

For details, see Table 6.

Constraints

N/A

enterprise_project_id

No

String

Definition

Specifies the enterprise project ID.

Constraints

N/A

Range

For details, see id in the enterprise_project field data structure table in Querying Enterprise Projects of the Enterprise Management API Reference.

Default Value

N/A

disk_encryption_id

No

String

Definition

Specifies the ID of the key used for disk encryption.

Constraints

N/A

Range

N/A

Default Value

This parameter is left blank by default.

data_vip

No

String

Definition

Specifies the floating IP address of a DB instance. Currently, only IPv4 addresses are supported.

Constraints

N/A

Range

  • Method 1: Log in to the VPC console and click the target subnet on the Subnets page. View the subnet CIDR block and select an IP address that is not in use.
  • Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference.

Default Value

This parameter is left blank by default.

charge_info

No

Object

Definition

Specifies the billing information, which is yearly/monthly or pay-per-use (default setting).

For details, see Table 8.

Constraints

N/A

time_zone

No

String

Definition

Specifies the UTC time zone.

Constraints

N/A

Range

If this parameter is specified for MySQL or PostgreSQL, the value range is from UTC-12:00 to UTC+12:00 on the hour. For example, the value can be UTC+08:00 rather than UTC+08:30.

Default Value

If this parameter is not specified, the time zone of each engine is as follows:
  • MySQL: uses UTC by default.
  • PostgreSQL: uses UTC by default.
  • Microsoft SQL Server: uses UTC by default.

restore_point

No

Object

Definition

Specifies the restoration information. This parameter is mandatory when data is restored to a new instance.

For details, see Table 10.

Constraints

N/A

tags

No

Array of objects

Definition

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 key-value pairs, separate them with commas (,). A maximum of 20 key-value pairs can be added.

For details, see Table 9.

Constraints

N/A

unchangeable_param

No

Object

Definition

Specifies the list of unchangeable parameters. The unchangeable parameters need to be specified before database initialization and cannot be modified after being specified.

For details, see Table 11.

Constraints

N/A

collation

No

String

Definition

Specifies the collation of an RDS for SQL Server instance.

Constraints

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

Range

For details, see Querying the Available SQL Server Character Set.

Default Value

N/A

dry_run

No

Boolean

Definition

Specifies whether DB instances will not be created after the request is checked.

Constraints

This parameter is supported with the MySQL DB engine only.

Range

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

Default Value

N/A

count

No

Integer

Definition

Specifies the number of DB instances to be created in a batch.

Constraints

This parameter is unavailable when you create read replicas.

Range

1–50

Default Value

N/A

is_auto_upgrade

No

Boolean

Definition

Whether to enable automatic minor version upgrade.

Constraints

This parameter is available only for RDS for PostgreSQL DB instances.

Range

  • true: Automatic minor version upgrade is enabled.
  • false: Automatic minor version upgrade is disabled.

Default Value

false

Table 3 Parameters for creating read replicas

Parameter

Mandatory

Type

Description

name

Yes

String

Definition

Specifies the DB instance name.

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

Constraints

N/A

Range

  • 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 (_).

Default Value

N/A

replica_of_id

Yes

String

Definition

Specifies the ID of the primary DB instance.

Constraints

This parameter is mandatory when you create read replicas and is unavailable in other scenarios.

Range

N/A

Default Value

N/A

flavor_ref

Yes

String

Definition

Specifies the specification code.

Constraints

N/A

Range

The value cannot be empty. For details, see spec_code in Table 3 in section Querying Database Specifications.

Default Value

N/A

volume

Yes

Object

Definition

Specifies the volume information.

For details, see Table 7.

Constraints

N/A

availability_zone

Yes

String

Definition

Specifies the AZ ID.

Constraints

N/A

Range

The AZ ID can be obtained from the response returned after the API in Querying Database Specifications is called.

Default Value

N/A

enterprise_project_id

No

String

Definition

Specifies the project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

disk_encryption_id

No

String

Definition

Specifies the ID of the key used for disk encryption.

Constraints

N/A

Range

N/A

Default Value

This parameter is left blank by default.

region

No

String

Definition

Specifies the region ID.

Constraints

Currently, read replicas can be created only in the same region as that of the primary DB instance.

Range

The value cannot be empty. To obtain this value, see Regions and Endpoints.

Default Value

N/A

charge_info

No

Object

Definition

Specifies the billing information, which is yearly/monthly or pay-per-use (default setting).

For details, see Table 8.

Constraints

To create RDS for MySQL and RDS for PostgreSQL read replicas billed on a yearly/monthly basis, contact customer service to apply for the required permissions.

RDS for SQL Server does not support yearly/monthly read replicas.

Table 4 datastore field data structure description

Parameter

Mandatory

Type

Description

type

Yes

String

Definition

Specifies the DB engine.

Constraints

N/A

Range

  • MySQL
  • PostgreSQL
  • SQLServer

Default Value

N/A

version

Yes

String

Definition

Specifies the database version.

Constraints

N/A

Range

  • For RDS for MySQL, the value can be 5.7 or 8.0.
  • For RDS for PostgreSQL, 10, 11, 12, 13, 14, and 15 are supported. RDS for PostgreSQL 9.5 and 9.6 are only for installed base operations.
  • For RDS for SQL Server, 2022 Enterprise Edition, 2022 Standard Edition, 2022 Web Edition (these 2022 editions require you to contact customer service), 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 section Querying Version Information About a DB Engine.

Default Value

N/A

complete_version

No

String

Definition

Specifies the complete version number.

Constraints

This parameter is returned only when the DB engine is PostgreSQL.

Range

N/A

Default Value

N/A

Table 5 ha field data structure description

Parameter

Mandatory

Type

Description

mode

Yes

String

Definition

Specifies the primary/standby instance type.

Constraints

N/A

Range

HA (case-insensitive)

Default Value

N/A

replication_mode

Yes

String

Definition

Specifies the replication mode for the standby DB instance.

Constraints

N/A

Range

  • For RDS for MySQL, the value is async or semisync.
  • For RDS for PostgreSQL, the value is async or sync.
  • For 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.

Default Value

N/A

Table 6 backup_strategy field data structure description

Parameter

Mandatory

Type

Description

start_time

Yes

String

Definition

Specifies the backup time window. Automated backups will be triggered during the backup time window.

Constraints

N/A

Range

The value cannot be left blank. It must be a valid value in the hh:mm-HH:MM format. The current time is the UTC time.

  • 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

Default Value

N/A

keep_days

No

Integer

Definition

Specifies the retention days for specific backup files.

Constraints

The automated backup policy cannot be disabled for primary/standby DB instances of RDS for SQL Server.

Range

0–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.

Default Value

N/A

Table 7 volume field data structure description

Parameter

Mandatory

Type

Description

type

Yes

String

Definition

Specifies the storage type.

Constraints

N/A

Range

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

  • ULTRAHIGH: ultra-high I/O storage.
  • CLOUDSSD: cloud SSD storage. This storage type is supported only with general-purpose and dedicated DB instances.
  • ESSD: extreme SSD storage.

Default Value

N/A

size

Yes

Integer

Definition

Specifies the volume size.

Constraints

For read replicas, this parameter is invalid. The volume size is the same as that of the primary DB instance by default.

Range

40–4000, in GB. The value must be a multiple of 10.

Default Value

N/A

Table 8 charge_info field data structure description

Parameter

Mandatory

Type

Description

charge_mode

Yes

String

Definition

Specifies the billing mode.

Constraints

N/A

Range

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

Default Value

N/A

period_type

No

String

Definition

Specifies the subscription type.

Constraints

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

Range

  • month: indicates that the subscription unit is month.
  • year: indicates that the subscription unit is year.

Default Value

N/A

period_num

No

Integer

Definition

Specifies the subscription period.

Constraints

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

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 or can be 5.

    Only RDS for MySQL supports the 5-year subscription. The constraints are as follows:

    • You need to contact customer service to apply for the required permissions.
    • This setting is supported only in CN North-Beijing4, CN East-Shanghai1, CN South-Guangzhou, and CN Southwest-Guiyang1.
    • This setting is supported only with general-purpose instances.

Default Value

N/A

Table 9 tags field data structure description

Parameter

Mandatory

Type

Description

key

Yes

String

Definition

Specifies the tag key.

Constraints

N/A

Range

The value must consist of 1 to 128 Unicode characters.

It can contain letters, digits, spaces, and special characters _.:=+-@. However, it cannot start or end with a space, or start with _sys_.

Default Value

N/A

value

Yes

String

Definition

Specifies the tag value.

Constraints

N/A

Range

It can be left blank or contain a maximum of 255 Unicode characters.

It can contain letters, digits, spaces, and special characters _.:=+-@.

Default Value

N/A

Table 10 restore_point field data structure description

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Definition

Specifies the source instance ID.

Constraints

N/A

Range

N/A

Default Value

N/A

type

Yes

String

Definition

Specifies the restoration mode.

Constraints

N/A

Range

  • backup: indicates using backup files for restoration. In this mode, type is optional and backup_id is mandatory.
  • timestamp: indicates the point-in-time restoration. In this mode, type is mandatory and restore_time is mandatory.

Default Value

N/A

backup_id

No

String

Definition

Specifies the ID of the backup to be restored.

Constraints

This parameter must be specified when backups are used for restoration.

Range

N/A

Default Value

N/A

restore_time

No

Integer

Definition

Specifies the time point of data restoration in the UNIX timestamp. The unit is millisecond and the time zone is UTC.

Constraints

N/A

Range

N/A

Default Value

N/A

database_name

No

Map<String,String>

Definition

Specifies the database name.

Constraints

This parameter is supported only for Microsoft SQL Server databases. If this parameter is specified, you can restore specific databases and rename new databases.

Range

  • The new database names must be different from the original database names. If you do not customize the database names, data will be restored to the original databases by default. If this parameter is not specified, all databases are restored by default.

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

  • New database names cannot contain the following fields (case-insensitive): rdsadmin, master, msdb, tempdb, model, and resource.
  • Each database name must consist of 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

Table 11 unchangeable_param field data structure description

Parameter

Mandatory

Type

Description

lower_case_table_names

No

String

Definition

Whether table names are case sensitive.

Constraints

When data is restored to an existing DB instance, the case sensitivity setting of the existing DB instance must be the same as that of the original DB instance. Otherwise, the restoration may fail.

Range

  • 0: Table names are fixed and case sensitive.
  • 1: Table names are stored in lowercase and are case insensitive.

Default Value

1

Example Request

  • Create an RDS for MySQL single-node instance.
    POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances
    
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.7"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "CLOUDSSD",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "ap-southeast-1",
    	"availability_zone": "ap-southeast-1a",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
            "dry_run": false,
            "count": 12
    }
  • Create an RDS for PostgreSQL single-node instance.
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "PostgreSQL",
    		"version": "10"
    	},
    	"flavor_ref": "rds.pg.s1.large",
    	"volume": {
    		"type": "CLOUDSSD",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "ap-southeast-1",
    	"availability_zone": "ap-southeast-1a",
    	"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",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "Test@12345678",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	]
    }
  • Create an RDS for MySQL 8.0 single-node instance with initialization parameters specified.
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "8.0"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "CLOUDSSD",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "ap-southeast-1",
    	"availability_zone": "ap-southeast-1a",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
    	"unchangeable_param": {
    		"lower_case_table_names": "1"
    	},
            "dry_run": false,
            "count": 12
    }
  • Create an RDS for SQL Server single-node instance with the collation specified.
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "SQLServer",
    		"version": "2014_SE"
    	},
    	"flavor_ref": "rds.mssql.se.m3.large.8",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "ap-southeast-1",
    	"availability_zone": "ap-southeast-1a",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
            "collation": "Cyrillic_General_CI_AS",
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
    }
  • Create an RDS for MySQL primary/standby instance.
    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.7"
    	},
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "semisync"
    	},
    	"flavor_ref": "rds.mysql.s1.large.ha",
    	"volume": {
    		"type": "CLOUDSSD",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"region": "ap-southeast-1",
    	"availability_zone": "ap-southeast-1a,ap-southeast",
    	"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    	"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    	"data_vip": "192.168.0.1",
    	"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    	"port": 8635,
    	"backup_strategy": {
    		"start_time": "08:15-09:15",
    		"keep_days": 12
    	},
    	"charge_info": {
    		"charge_mode": "postPaid"
    	},
    	"password": "****",
    	"configuration_id": "452408-ef4b-44c5-94be-305145fg",
    	"enterprise_project_id": "fdsa-3rds",
    	"time_zone": "UTC+04:00",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	],
            "dry_run": false,
            "count": 12
    }
  • Create an RDS for MySQL read replica.
    {
    	"name": "rds-instance-rep2",
    	"replica_of_id": "afdsad-fds-fdsagin01",
    	"flavor_ref": "rds.mysql.s1.large.rr",
    	"volume": {
    		"type": "CLOUDSSD",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
            "region": "ap-southeast-1",
    	"availability_zone": "ap-southeast-1a",
    	"enterprise_project_id": "fdsa-3rds",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	]
    }

Response

  • Normal response
    Table 12 Parameters

    Parameter

    Type

    Description

    instance

    Object

    Definition

    Indicates the DB instance information.

    For details, see Table 13.

    job_id

    String

    Definition

    Indicates the ID of the DB instance creation task.

    For details about how to query task details, see Obtaining Information About a Task with a Specified ID.

    This parameter is returned only when pay-per-use DB instances are created.

    Range

    N/A

    order_id

    String

    Definition

    Indicates the order ID. This parameter is returned for the creation of a yearly/monthly DB instance.

    Range

    N/A

    Table 13 instance field data structure description

    Parameter

    Type

    Description

    id

    String

    Definition

    Indicates the DB instance ID. If instances are created in batches, multiple instance IDs separated by commas (,) are returned for the MySQL DB engine. For other DB engines, this parameter is left blank.

    Range

    N/A

    name

    String

    Definition

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

    Range

    N/A

    status

    String

    Definition

    Indicates the DB instance status.

    Range

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

    This parameter is returned only when pay-per-use DB instances are created.

    datastore

    Object

    Definition

    Indicates the database information.

    For details, see Table 14.

    ha

    Object

    Definition

    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

    Definition

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

    Range

    N/A

    port

    String

    Definition

    Indicates the database port.

    Range

    Same as the request parameter.

    backup_strategy

    Object

    Definition

    Indicates the automated backup policy.

    For details, see Table 16.

    enterprise_project_id

    String

    Definition

    Indicates the project ID.

    Range

    N/A

    disk_encryption_id

    String

    Definition

    Indicates the ID of the key used for disk encryption.

    Range

    This parameter is available only when you specify this parameter during instance creation. By default, this parameter is left blank.

    flavor_ref

    String

    Definition

    Indicates the specification code.

    Range

    The value cannot be empty. For details, see spec_code in Table 3 in section Querying Database Specifications.

    volume

    Object

    Definition

    Indicates the volume information.

    For details, see Table 17.

    region

    String

    Definition

    Indicates the region ID.

    Range

    N/A

    availability_zone

    String

    Definition

    Indicates the AZ ID.

    Range

    N/A

    vpc_id

    String

    Definition

    Indicates the VPC ID.

    Range

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

    subnet_id

    String

    Definition

    Indicates the network ID of the subnet.

    Range

    • 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

    Definition

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

    Range

    • Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane. 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.

    charge_info

    Object

    Definition

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

    For details, see Table 18.

    collation

    String

    Definition

    Indicates the collation set for RDS for SQL Server.

    Range

    N/A

    restore_point

    Object

    Definition

    Indicates the restoration information. This parameter is mandatory when data is restored to a new instance.

    For details, see Table 19.

    Table 14 datastore field data structure description

    Parameter

    Type

    Description

    type

    String

    Definition

    Indicates the DB engine.

    Range

    • MySQL
    • PostgreSQL
    • SQLServer

    version

    String

    Definition

    Indicates the database version.

    Range

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

    Table 15 ha field data structure description

    Parameter

    Type

    Description

    mode

    String

    Definition

    Indicates the primary/standby instance type.

    Range

    Ha

    replication_mode

    String

    Definition

    Indicates the replication mode for the standby DB instance. This parameter is valid only when the instance is an HA instance.

    Range

    • For RDS for MySQL, the value is async or semisync.
    • For RDS for PostgreSQL, the value is async or sync.
    • For 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

    Parameter

    Type

    Description

    start_time

    String

    Definition

    Indicates the backup time window. Automated backups will be triggered during the backup time window.

    Range

    The value cannot be left blank. It must be a valid value in the hh:mm-HH:MM format. The current time is the UTC time.

    • 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

    If backup_strategy in the request body is empty, 02:00-03:00 is returned for start_time by default.

    keep_days

    Integer

    Definition

    Indicates the retention days for specific backup files.

    Range

    0–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.

    If backup_strategy in the request body is empty, 7 is returned for keep_days by default.

    Table 17 volume field data structure description

    Parameter

    Type

    Description

    type

    String

    Definition

    Storage type.

    Range

    The value is case-sensitive.

    • ULTRAHIGH: ultra-high I/O storage.
    • CLOUDSSD: cloud SSD storage. This storage type is supported only with general-purpose and dedicated instances.
    • ESSD: extreme SSD storage.

    size

    Integer

    Definition

    Storage capacity.

    Range

    40–4000, in GB. The value must be a multiple of 10.

    Table 18 chargeInfo field data structure description

    Parameter

    Type

    Description

    charge_mode

    String

    Definition

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

    Range

    N/A

    period_num

    Integer

    Definition

    Indicates the subscription period, which is calculated by month.

    This parameter is valid when charge_mode is set to prePaid (creating yearly/monthly DB instances).

    Range

    N/A

    Table 19 restore_point field data structure description

    Parameter

    Type

    Description

    instance_id

    String

    Definition

    Specifies the source instance ID.

    Range

    N/A

    type

    String

    Definition

    Specifies the restoration mode.

    Range

    • backup: Data is restored using backups.
    • timestamp: Data is restored to a point in time.

    backup_id

    String

    Definition

    Specifies the ID of the backup to be restored.

    Range

    N/A

    restore_time

    Integer

    Definition

    Specifies the time point of data restoration in the UNIX timestamp. The unit is millisecond and the time zone is UTC.

    Range

    N/A

    database_name

    Map<String,String>

    Definition

    This parameter is supported only for Microsoft SQL Server databases. If this parameter is specified, you can restore specific databases and rename new databases.

    Range

    N/A

The values of region and availability_zone are used as examples.

  • Example normal response

    RDS for MySQL single-node instance created.

    {
    	"instance": {
    		"id": "dsfae23fsfdsae3435in01",
    		"name": "trove-instance-rep2",
    		"datastore": {
    			"type": "MySQL",
    			"version": "5.7"
    		},
    		"flavor_ref": "rds.mysql.s1.large",
    		"volume": {
    			"type": "CLOUDSSD",
    			"size": 100
    		},
    		"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
                    "region": "ap-southeast-1",
    	        "availability_zone": "ap-southeast-1a",
    		"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    		"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    		"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    		"port": "8635",
    		"backup_strategy": {
    			"start_time": "08:15-09:15",
    			"keep_days": 3
    		},
    		"configuration_id": "452408-44c5-94be-305145fg",
    		"charge_info": {
    			"charge_mode": "postPaid"
    		}
    	},
    	"job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d"
    }

    RDS for SQL Server single-node instance created.

    {
    	"instance": {
    		"id": "dsfae23fsfdsae3435in01",
    		"name": "trove-instance-rep2",
    		"datastore": {
    			"type": "sqlserver",
    			"version": "2014_SE"
    		},
    		"flavor_ref": "rds.mssql.2014.se.s3.large.2",
    		"volume": {
    			"type": "ULTRAHIGH",
    			"size": 100
    		},
    		"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
                    "region": "ap-southeast-1",
    	        "availability_zone": "ap-southeast-1a",
    		"vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce",
    		"subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
    		"security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5",
    		"port": "8635",
    		"backup_strategy": {
    			"start_time": "08:15-09:15",
    			"keep_days": 3
    		},
    		"configuration_id": "452408-44c5-94be-305145fg",
    		"charge_info": {
    			"charge_mode": "postPaid"
    		},
                   "collation": "Cyrillic_General_CI_AS" 
    	},
    	"job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d"
    }

    RDS for MySQL primary/standby instance created.

    {
      "instance":{ 
               "id": "dsfae23fsfdsae3435in01",
               "name": "trove-instance-rep2", 
               "datastore": { 
                 "type": "MySQL", 
                 "version": "5.7" 
                }, 
               "ha": {
                 "mode": "ha",
                 "replication_mode": "semisync"
               },
               "flavor_ref": "rds.mysql.s1.large.ha",
               "volume": { 
                   "type": "CLOUDSSD", 
                   "size": 100 
                 },
               "disk_encryption_id":  "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	   "region": "ap-southeast-1",
    	   "availability_zone": "ap-southeast-1a,ap-southeast-1b",
               "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", 
               "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
               "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", 
               "port": "8635", 
               "backup_strategy": { 
                 "start_time": "08:15-09:15", 
                 "keep_days": 3 
                }, 
               "configuration_id": "452408-44c5-94be-305145fg",
               "charge_info": {
                       "charge_mode": "postPaid"
                                   },
             },
      "job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d" 
    }

    RDS for MySQL read replica created.

    {
      "instance":{ 
                "id": "dsfae23fsfdsae3435in01",
                "name": "trove-instance-rep2", 
                "flavor_ref": "rds.mysql.s1.large.rr",
                 "volume": { 
                   "type": "CLOUDSSD", 
                   "size": 100 
                 },
               "disk_encryption_id":  "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
               "region": "ap-southeast-1",
               "availability_zone": "ap-southeast-1a",
               "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", 
               "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f",
               "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", 
               "port": "8635", 
               "configuration_id": "452408-44c5-94be-305145fg"
             },
     "job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d"  
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.