Updated on 2024-08-28 GMT+08:00

Creating a DB Instance (API v5)

Function

This API is derived from the API for creating a DB instance (v3). The subscription_agency field is added to the request body of this API. This field is used when a RAM-based shared key is used to create a yearly/monthly RDS DB instance. This API is used to create a single RDS DB instance, primary/standby DB instance, or read replica.

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

This API supports only AK/SK authentication. This API allows you to set the X-Client-Token request header in the HTTP request header to ensure the request idempotence. For details, see Idempotent Requests.

URI

  • URI format

    POST /v5/{project_id}/instances

  • Parameter description
    Table 1 Parameters

    Parameter

    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 Parameters (creating single, primary/standby, and cluster instances)

Parameter

Mandatory

Type

Description

name

Yes

String

Instance name.

Instances of the same type can have the same name under the same tenant. Value 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 (_).

datastore

Yes

Object

Database information.

For details, see Table 4.

ha

No

Object

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

For details, see Table 5.

configuration_id

No

String

Parameter template ID.

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

port

No

String

Database port.

  • RDS for MySQL instances can use database ports 1024 to 65535, excluding 12017, 33071, and 33062, 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

password

No

String

Database password.

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

backup_strategy

No

Object

Advanced backup policy.

For details, see Table 6.

enterprise_project_id

No

String

Enterprise project ID.

disk_encryption_id

No

String

Key ID for disk encryption. The default value is empty.

NOTE:

Serverless instances do not support this parameter.

subscription_agency

No

String

URN of the agency authorized to the Billing service. This parameter is required when you use a RAM-based shared key to create a yearly/monthly RDS DB instance. For details about how to obtain the agency URN, see Obtaining an Agency URN.

flavor_ref

Yes

String

Specification code. The value cannot be empty.

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

volume

Yes

Object

Volume information.

For details, see Table 7.

region

Yes

String

Region ID.

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

availability_zone

Yes

String

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.

vpc_id

Yes

String

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

  • 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

Yes

String

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.

data_vip

No

String

Floating IP address of a DB instance. Currently, only IPv4 addresses are supported. You can use either of the following methods to obtain the floating IP address:

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

security_group_id

Yes

String

Security group which the DB instance is associated with. 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 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

No

Object

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

For details, see Table 8.

time_zone

No

String

UTC time zone.

  • If this parameter is not specified, the time zone of each DB engine is as follows:
    • MySQL uses UTC by default.
    • PostgreSQL uses UTC by default.
    • Microsoft SQL Server uses UTC by default.
  • 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 parameter can be UTC+08:00 rather than UTC+08:30.

replica_of_id

No

String

ID of the primary DB instance. This parameter is mandatory when you create a read replica and is unavailable in other scenarios.

restore_point

No

Object

Restoration information. This parameter is mandatory when data is restored to a new instance.

For details, see Table 10.

tags

No

Array of objects

Tag list. Each DB instance can be associated with tag key-value pairs while being created.

  • {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 10 key-value pairs can be added for a DB instance.

For details, see Table 9.

unchangeable_param

No

Object

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

collation

No

String

This parameter applies only to RDS for SQL Server instances. It is invalid for RDS for MySQL, RDS for MariaDB, and RDS for PostgreSQL instances.

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

dry_run

No

Boolean

Whether DB instances will not be created after the request is checked. This parameter is supported with the MySQL DB engine 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.

count

No

Integer

Number of DB instances to be created in a batch. Value range: 1 to 50

NOTE:

This parameter is available only when you create an RDS for MySQL or RDS for SQL Server primary instance.

This parameter is unavailable when you create read replicas.

serverless_info

No

Object

Resource scaling scope of a serverless instance. This parameter is mandatory when you create a serverless instance.

For details, see Table 11.

Table 3 Parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Instance name.

Instances of the same type can have the same name under the same tenant.

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

enterprise_project_id

No

String

Project ID.

disk_encryption_id

No

String

Key ID for disk encryption. The default value is empty.

subscription_agency

No

String

URN of the agency authorized to the Billing service. This parameter is required when you use a RAM-based shared key to create a yearly/monthly RDS DB instance. For details about how to obtain the agency URN, see Obtaining an Agency URN.

replica_of_id

No

String

ID of the primary DB instance. This parameter is mandatory when you create a read replica and is unavailable in other scenarios.

flavor_ref

Yes

String

Specification code. The value cannot be empty.

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

volume

Yes

Object

Volume information.

For details, see Table 7.

region

No

String

Region ID. Read replicas can be created only in the same region as that of the primary DB instance.

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

availability_zone

Yes

String

AZ ID.

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

charge_info

No

Object

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

For details, see Table 8.

NOTE:

To create RDS for MySQL or 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.

complete_version

No

String

Complete database version number.

Table 4 Data structure description of field datastore

Parameter

Mandatory

Type

Description

type

Yes

String

DB engine. Value:

  • MySQL
  • PostgreSQL
  • SQLServer

version

Yes

String

DB engine version.

  • MySQL: 5.6, 5.7, and 8.0 are supported. Example value: 5.7
  • PostgreSQL: 9.5, 9.6, 10, 11, 12, 13, 14, and 15 are supported. Example value: 9.6
  • Microsoft SQL Server: Only 2022 Enterprise Edition, 2022 Standard Edition, 2022 Web Edition, 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, 2008 R2 Enterprise Edition, 2008 R2 Web Edition, 2014 Web Edition, and 2016 Web Edition are supported. Example value: 2014_SE

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

Table 5 Data structure description of field ha

Parameter

Mandatory

Type

Description

mode

Yes

String

Primary/standby instance type. The value is Ha (case-insensitive).

replication_mode

Yes

String

Replication mode for the standby instance.

Value:

  • 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 asynchronous replication.
  • semisync indicates semi-synchronous replication.
  • sync indicates synchronous replication.
Table 6 Data structure description of field backup_strategy

Parameter

Mandatory

Type

Description

start_time

Yes

String

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

Retention days for backups.

The value ranges 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.

NOTICE:

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

Table 7 Data structure description of field volume

Parameter

Mandatory

Type

Description

type

Yes

String

Storage type.

The value can be any of the following (case-sensitive):

  • ULTRAHIGH: SSD storage.
  • LOCALSSD: local SSD storage.
  • CLOUDSSD: cloud SSD storage. This storage type is supported only with general-purpose and dedicated instances.
  • ESSD: extreme SSD storage.

size

Yes

Integer

Storage space.

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

NOTE:

For read replicas, this parameter is invalid. The storage space is the same as that of the primary instance by default.

Table 8 Data structure description of field charge_info

Parameter

Mandatory

Type

Description

charge_mode

Yes

String

Billing mode.

Values:

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

period_type

No

String

Subscription type.

Values:

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

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

period_num

No

Integer

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 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.
Table 9 Data structure description of field tags

Parameter

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.

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

Table 10 Data structure description of field restore_point

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Source instance ID.

type

Yes

String

Restoration mode. Enumerated values include:

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

backup_id

No

String

ID of the backup used to restore data. This parameter must be specified when backups are used for restoration.

restore_time

No

Integer

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

database_name

No

Map<String,String>

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

  • 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.
Table 11 Data structure description of field serverless_info

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 12 Data structure description of field unchangeable_param

Parameter

Mandatory

Type

Description

lower_case_table_names

No

String

Whether table names are case sensitive. The default value is 1.

Values:

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

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.

The values of region and availability_zone in the example request are only for reference.

  • URI example

    POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances

  • Example request

    Create an RDS for MySQL single-node instance billed on a yearly/monthly basis using a RAM-based shared key.

    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.7"
    	},
    	"flavor_ref": "rds.mysql.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"subscription_agency": "xxx::xxxxx:xx:xxxx",
    	"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": "prePaid",
                    "period_type": "year",
                    "period_num": 1
            },
    	"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"
    		}
    	],
            "dry_run": false,
            "count": 12
    }

    Create an RDS for PostgreSQL single-node instance billed on a yearly/monthly basis using a RAM-based shared key.

    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "PostgreSQL",
    		"version": "10"
    	},
    	"flavor_ref": "rds.pg.s1.large",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
            "subscription_agency": "xxx::xxxxx:xx:xxxx",
    	"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": "prePaid",
                    "period_type": "year",
                    "period_num": 1
    	},
    	"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 SQL Server single-node instance billed on a yearly/monthly basis using a RAM-based shared key.

    {
    	"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",
            "subscription_agency": "xxx::xxxxx:xx:xxxx",
    	"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": "prePaid",
                    "period_type": "year",
                    "period_num": 1
    	},
            "collation": "Cyrillic_General_CI_AS",
    	"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 primary/standby instance billed on a yearly/monthly basis using a RAM-based shared key.

    {
    	"name": "rds-instance-rep2",
    	"datastore": {
    		"type": "MySQL",
    		"version": "5.6"
    	},
    	"ha": {
    		"mode": "ha",
    		"replication_mode": "semisync"
    	},
    	"flavor_ref": "rds.mysql.s1.large.ha",
    	"volume": {
    		"type": "ULTRAHIGH",
    		"size": 100
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
            "subscription_agency": "xxx::xxxxx:xx:xxxx",
    	"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",
    	"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": "prePaid",
                    "period_type": "year",
                    "period_num": 1
    	},
    	"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"
    		}
    	],
            "dry_run": false,
            "count": 12
    }

    Create an RDS for MySQL read replica billed on a yearly/monthly basis using a RAM-based shared key.

    {
    	"name": "rds-instance-rep2",
    	"replica_of_id": "afdsad-fds-fdsagin01",
    	"flavor_ref": "rds.mysql.s1.large.rr",
    	"volume": {
    		"type": "ULTRAHIGH"
    	},
    	"disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
    	"subscription_agency": "xxx::xxxxx:xx:xxxx",
            "region": "ap-southeast-1",
    	"availability_zone": "ap-southeast-1a",
    
            "charge_info": {
    		"charge_mode": "prePaid",
                    "period_type": "year",
                    "period_num": 1
    	},
    	"enterprise_project_id": "fdsa-3rds",
    	"tags": [
    		{
    			"key": "key1",
    			"value": "value1"
    		},
    		{
    			"key": "key2",
    			"value": "value2"
    		}
    	]
    }

Response

  • Normal response
    Table 13 Parameters

    Parameter

    Type

    Description

    instance

    Object

    Instance information.

    For details, see Table 14.

    job_id

    String

    ID of the 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 for the creation of pay-per-use instances.

    order_id

    String

    Order ID. This parameter is returned only for the creation of yearly/monthly instances.

    Table 14 instance description

    Parameter

    Type

    Description

    id

    String

    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.

    name

    String

    Instance name. Instances of the same type can have the same name under the same tenant.

    status

    String

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

    This parameter is returned only for the creation of pay-per-use instances.

    datastore

    Object

    Database information.

    For details, see Table 15.

    ha

    Object

    HA configurations. This parameter is returned only when primary/standby instances are created.

    For details, see Table 16.

    configuration_id

    String

    Parameter template ID. This parameter is returned only when a custom parameter template is used during instance creation.

    port

    String

    Database port, which is the same as the request parameter.

    backup_strategy

    Object

    Automated backup policy.

    For details, see Table 17.

    enterprise_project_id

    String

    Project ID.

    disk_encryption_id

    String

    Key ID for disk encryption. This parameter is returned only when it is specified during the instance creation. By default, it is empty.

    flavor_ref

    String

    Specification code. The value cannot be empty.

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

    volume

    Object

    Volume information.

    For details, see Table 18.

    region

    String

    Region ID.

    availability_zone

    String

    AZ ID.

    vpc_id

    String

    VPC ID.

    subnet_id

    String

    Subnet ID.

    security_group_id

    String

    Security group which the DB instance is associated with. To obtain this parameter value, use either of the following methods:

    charge_info

    Object

    Billing information, which is yearly/monthly or pay-per-use.

    For details, see Table 19.

    collation

    String

    Collation for the RDS for SQL Server instance.

    restore_point

    Object

    Restoration information. This parameter is mandatory when data is restored to a new instance.

    For details, see Table 20.

    Table 15 Data structure description of field datastore

    Parameter

    Type

    Description

    type

    String

    DB engine. Value:

    • MySQL
    • PostgreSQL
    • SQLServer

    version

    String

    DB engine version.

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

    complete_version

    String

    Complete database version number.

    Table 16 Data structure description of field ha

    Parameter

    Type

    Description

    mode

    String

    Primary/standby instance type. The value is Ha.

    replication_mode

    String

    Replication mode for the standby instance. This parameter is valid only when the instance is an HA instance.

    Value:

    • 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 asynchronous replication.
    • semisync indicates semi-synchronous replication.
    • sync indicates synchronous replication.
    Table 17 Data structure description of field backupStrategy

    Parameter

    Type

    Description

    start_time

    String

    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

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

    keep_days

    Integer

    Retention days for backups.

    The value ranges 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.

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

    Table 18 Data structure description of field volume

    Parameter

    Type

    Description

    type

    String

    Storage type.

    The value can be any of the following (case-sensitive):

    • ULTRAHIGH: SSD storage.
    • LOCALSSD: local SSD storage.
    • CLOUDSSD: cloud SSD storage. This storage type is supported only with general-purpose and dedicated instances.
    • ESSD: extreme SSD storage.

    size

    Integer

    Storage space.

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

    Table 19 Data structure description of field chargeInfo

    Parameter

    Type

    Description

    charge_mode

    String

    Billing information, which is yearly/monthly or pay-per-use.

    period_type

    String

    Subscription type.

    • month: The service is subscribed by month.
    • year: The service is subscribed by year.

    period_num

    Integer

    Subscription period, which is calculated by month.

    This parameter is valid only when charge_mode is set to prePaid (yearly/monthly billing).

    is_auto_pay

    Boolean

    Whether the order will be automatically paid after yearly/monthly instances are created. This parameter does not affect the payment method of automatic renewal.

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

    is_auto_renew

    Boolean

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

    • false: Automatic renewal is disabled. The default value is false.
    • true: Automatic renewal is enabled.
    Table 20 Data structure description of field restore_point

    Parameter

    Type

    Description

    instance_id

    String

    Source instance ID.

    type

    String

    Restoration mode.

    • backup: indicates using backup files for restoration.
    • timestamp: indicates the point-in-time restoration.

    backup_id

    String

    ID of the backup used to restore data.

    restore_time

    Integer

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

    database_name

    Map<String,String>

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

The values of region and availability_zone in the example response are only for reference.

  • Example normal response

    RDS for MySQL single instance created.

    {
    	"instance": {
    		"id": "dsfae23fsfdsae3435in01",
    		"name": "trove-instance-rep2",
    		"datastore": {
    			"type": "MySQL",
    			"version": "5.7"
    		},
    		"flavor_ref": "rds.mysql.s1.large",
    		"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": "prePaid",
                            "period_type": "year",
                            "period_num": 1
    		},
    	},
    	"job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d"
    }

    RDS for SQL Server single 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": "prePaid",
                            "period_type": "year",
                            "period_num": 1
    		},
                   "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": "ULTRAHIGH", 
                   "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": "prePaid",
                    "period_type": "year",
                    "period_num": 1
    	   },
             },
      "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": "ULTRAHIGH", 
                   "size": 100 
                 },
               "disk_encryption_id":  "2gfdsh-844a-4023-a776-fc5c5fb71fb4",
               "region": "ap-southeast-1",
    	   "availability_zone": "ap-southeast-1a",
               "charge_info": {
    		"charge_mode": "prePaid",
                    "period_type": "year",
                    "period_num": 1
    	   },
               "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.

Obtaining an Agency URN

  1. Log in to the Identity and Access Management (IAM) console.
    Figure 1 IAM page
  2. Click Agencies. On the displayed page, click Create Agency.
  3. On the Create Agency page, set the following parameters and click Next.
    • Agency Name: For example, enter agency_billing.
    • Agency Type: Select Cloud service.
    • Cloud Service: Select Billing.
    • Validity Period: Select Unlimited.
    • Description: Enter a description about the agency.
    Figure 2 Creating an agency
  4. Enter fulfillment in the search box to start a search, select ServicePolicyForRDSFulfillment, and click Next.
    Figure 3 Selecting a policy
  5. By default, the permissions apply to all resources. Click OK.
    Figure 4 Selecting a scope
  6. Click the name of the created agency. On the Basic Information page, obtain the agency URN.
    Figure 5 Obtaining a URN