Creating a DB Instance
Function
This API is used to create a single RDS DB instance, primary/standby DB instances, or a read replica.
- Before calling an API, you need to understand the API in Authentication.
- Before calling this API, obtain the required region and endpoint.
URI
- URI format
- Example
https://rds.cn-north-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances
- Parameter description
Table 1 Parameter description Name
Mandatory
Description
project_id
Yes
Specifies the project ID of a tenant in a region.
For details about how to obtain the project ID, see Obtaining a Project ID.
Request
|
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. The value must be 4 to 64 characters in length and start with a letter. It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_). |
|
datastore |
Yes |
Object |
Specifies the database information. For details, see Table 4. |
|
ha |
No |
Object |
Specifies the HA configuration parameters, which are used when creating primary/standby DB instances. For details, see Table 5. |
|
configuration_id |
No |
String |
Specifies the parameter template ID. For details, see id in Table 3 in section Obtaining a Parameter Template List. |
|
port |
No |
String |
Specifies the database port information.
If this parameter is not set, the default value is as follows:
|
|
password |
No |
String |
Specifies the database password. Valid value:
You are advised to enter a strong password to improve security, preventing security risks such as brute force cracking. |
|
backup_strategy |
No |
Object |
Specifies the advanced backup policy. For details, see Table 6. |
|
enterprise_project_id |
No |
String |
Specifies the enterprise project ID. For details, see id in the enterprise_project field data structure table in section Querying the Enterprise Project List of the Enterprise Management API Reference. |
|
disk_encryption_id |
No |
String |
Specifies the key ID for disk encryption. The default value is empty. |
|
flavor_ref |
Yes |
String |
Specifies the specification code. The value cannot be empty. For details, see spec_code in Table 3 in section Querying Database Specifications. |
|
volume |
Yes |
Object |
Specifies the volume information. For details, see Table 7. |
|
region |
Yes |
String |
Specifies the region ID. The value cannot be empty. For details about how to obtain this parameter value, see Regions and Endpoints. |
|
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. |
|
vpc_id |
Yes |
String |
Specifies the VPC ID. To obtain this parameter value, use either of the following methods:
|
|
subnet_id |
Yes |
String |
Specifies the network ID. To obtain this parameter value, use either of the following methods:
|
|
data_vip |
No |
String |
Specifies the floating IP address of a DB instance. To obtain this parameter value, use either of the following methods:
|
|
security_group_id |
Yes |
String |
Specifies the security group which the RDS DB instance belongs to. To obtain this parameter value, use either of the following methods:
|
|
charge_info |
No |
Object |
Specifies the billing information, which is yearly/monthly or pay-per-use (default setting). For details, see Table 8. |
|
time_zone |
No |
String |
Specifies the UTC time zone.
|
|
dsspool_id |
No |
String |
Specifies the dsspool ID of DeC users. The dsspool configured for each AZ is different. When DeC users create DB instances other than single instances or read replicas, dsspool IDs must be specified for all nodes of the DB instances and must be separated by commas (,). |
|
tags |
No |
Array of objects |
Specifies the tag list. DB instances are created based on tag keys and values.
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 details, see Table 9. |
|
unchangeable_param |
No |
Object |
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. |
|
collation |
No |
String |
This parameter applies only to Microsoft SQL Server DB instances. Value range: character sets queried in Querying the Available SQL Server Character Set. |
|
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. The value must be 4 to 64 characters in length and start with a letter. It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_). |
|
replica_of_id |
Yes |
String |
Specifies the primary DB instance ID for creating a read replica. For details, see id in Table 4 in section Querying Details About DB Instances. |
|
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. |
|
flavor_ref |
Yes |
String |
Specifies the specification code. The value cannot be empty. For details, see spec_code in Table 3 in section Querying Database Specifications. |
|
volume |
Yes |
Object |
Specifies the volume information. For details, see Table 7. |
|
region |
No |
String |
Specifies the region ID. Currently, 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 |
Specifies the AZ ID. The value cannot be empty. For details about how to obtain this parameter value, see Regions and Endpoints. |
|
charge_info |
No |
Object |
Specifies the billing information, which is yearly/monthly or pay-per-use (default setting). For details, see Table 8. |
|
dsspool_id |
No |
String |
Specifies the dsspool ID of DeC users. The dsspool configured for each AZ is different. When DeC users create DB instances other than single instances or read replicas, dsspool IDs must be specified for all nodes of the DB instances and must be separated by commas (,). |
|
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
type |
Yes |
String |
Specifies the DB engine. Value:
|
|
version |
Yes |
String |
Specifies the database version.
For details about supported database versions, see section Querying Version Information About a DB Engine. |
|
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
mode |
Yes |
String |
Specifies the DB instance type. The value is Ha (primary/standby DB instances) and is case-insensitive. |
|
replication_mode |
Yes |
String |
Specifies the replication mode for the standby DB instance. Value:
NOTE:
|
|
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
start_time |
Yes |
String |
Specifies the backup time window. Automated backups will be triggered during the backup time window. The value cannot be empty. It must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.
Example value:
|
|
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 2562 days.
NOTICE:
Primary/standby DB instances of Microsoft SQL Server do not support disabling the automated backup policy. |
|
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
type |
Yes |
String |
Specifies the volume type. Its value can be any of the following and is case-sensitive:
|
|
size |
Yes |
Integer |
Specifies the volume size. Its value must be a multiple of 10 and the value range is from 40 GB to 4000 GB. MySQL supports storage space from 11 GB to 10,000 GB for some users. If you want to create a DB instance with storage space up to 10,000 GB or scale up to 10,000 GB, contact customer service.
NOTE:
For read replicas, this parameter is invalid. The volume size is the same as that of the primary DB instance by default. |
|
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
charge_mode |
Yes |
String |
Specifies the billing mode. Valid value:
|
|
period_type |
No |
String |
Specifies the subscription period. Valid value:
|
|
period_num |
No |
Integer |
This parameter is valid and mandatory if charge_mode is set to prePaid. Valid value:
|
|
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.
|
|
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.
|
|
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Specifies the tag key. It contains a maximum of 36 Unicode characters. The value cannot be an empty string, a space, or left blank. Only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_) are allowed. |
|
value |
Yes |
String |
Specifies the tag value. It contains a maximum of 43 Unicode characters. The value can be an empty character string. Only uppercase letters, lowercase letters, digits, periods (.), hyphens (-), and underscores (_) are allowed. |
|
Time Zone |
Standard Time Offset |
Remarks |
|---|---|---|
|
Afghanistan Standard Time |
UTC+04:30 |
Kabul |
|
Alaskan Standard Time |
UTC-09:00 |
Alaska |
|
Arabian Standard Time |
UTC+04:00 |
Abu Dhabi, Muscat |
|
Atlantic Standard Time |
UTC-04:00 |
Atlantic Time (Canada) |
|
AUS Central Standard Time |
UTC+09:30 |
Darwin |
|
AUS Eastern Standard Time |
UTC+10:00 |
Canberra, Melbourne, Sydney |
|
Belarus Standard Time |
UTC+03:00 |
Minsk |
|
Canada Central Standard Time |
UTC-06:00 |
Saskatchewan |
|
Cape Verde Standard Time |
UTC-01:00 |
Cape Verde Is. |
|
Cen. Australia Standard Time |
UTC+09:30 |
Adelaide |
|
Central America Standard Time |
UTC-06:00 |
Central America |
|
Central Asia Standard Time |
UTC+06:00 |
Astana |
|
Central Brazilian Standard Time |
UTC-04:00 |
Cuiaba |
|
Central European Standard Time |
UTC+01:00 |
Belgrade, Bratislava, Budapest, Ljubljana, Prague |
|
Central European Standard Time |
UTC+01:00 |
Sarajevo, Skopje, Warsaw, Zagreb |
|
Central Pacific Standard Time |
UTC+11:00 |
Solomon Islands, New Caledonia |
|
Central Standard Time |
UTC-06:00 |
Central Time (US and Canada) |
|
China Standard Time |
UTC+08:00 |
Beijing, Chongqing, Hong Kong, and Urumqi |
|
E. Africa Standard Time |
UTC+03:00 |
Nairobi |
|
E. Australia Standard Time |
UTC+10:00 |
Brisbane |
|
E. Europe Standard Time |
UTC+02:00 |
Chisinau |
|
E. South America Standard Time |
UTC-03:00 |
Brasilia |
|
Eastern Standard Time |
UTC-05:00 |
Eastern Time (US and Canada) |
|
Georgian Standard Time |
UTC+04:00 |
Tbilisi |
|
GMT Standard Time |
UTC |
Dublin, Edinburgh, Lisbon, London |
|
Greenland Standard Time |
UTC–03:00 |
Greenland |
|
Greenwich Standard Time |
UTC |
Monrovia, Reykjavik |
|
GTB Standard Time |
UTC+02:00 |
Athens, Bucharest |
|
Hawaiian Standard Time |
UTC-10:00 |
Hawaii |
|
India Standard Time |
UTC+05:30 |
Chennai, Kolkata, Mumbai, New Delhi |
|
Jordan Standard Time |
UTC+02:00 |
Amman |
|
Korea Standard Time |
UTC+09:00 |
Seoul |
|
Middle East Standard Time |
UTC+02:00 |
Beirut |
|
Mountain Standard Time |
UTC-07:00 |
Mountain Time (US and Canada) |
|
US Mountain Standard Time |
UTC-07:00 |
Arizona |
|
New Zealand Standard Time |
UTC+12:00 |
Auckland, Wellington |
|
Newfoundland Standard Time |
UTC-03:30 |
Newfoundland |
|
Pacific SA Standard Time |
UTC-03:00 |
Santiago |
|
Pacific Standard Time |
UTC-08:00 |
Pacific Time (US and Canada) |
|
Russian Standard Time |
UTC+03:00 |
Moscow, St. Petersburg, Volgograd |
|
SA Pacific Standard Time |
UTC-05:00 |
Bogota, Lima, Quito, Rio Branco |
|
SE Asia Standard Time |
UTC+07:00 |
Bangkok, Hanoi, Jakarta |
|
China Standard Time |
UTC+08:00 |
Kuala Lumpur, Singapore |
|
Tokyo Standard Time |
UTC+09:00 |
Osaka, Sapporo, Tokyo |
|
US Eastern Standard Time |
UTC-05:00 |
Indiana (East) |
|
UTC |
UTC |
Coordinated Universal Time |
|
UTC-02 |
UTC-02:00 |
Coordinated Universal Time–02 |
|
UTC-08 |
UTC-08:00 |
Coordinated Universal Time–08 |
|
UTC-09 |
UTC-09:00 |
Coordinated Universal Time–09 |
|
UTC-11 |
UTC-11:00 |
Coordinated Universal Time–11 |
|
UTC+12 |
UTC+12:00 |
Coordinated Universal Time+12 |
|
W. Australia Standard Time |
UTC+08:00 |
Perth |
|
W. Central Africa Standard Time |
UTC+01:00 |
West Central Africa |
|
W. Europe Standard Time |
UTC+01:00 |
Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna |
|
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
lower_case_table_names |
No |
String |
Specifies whether table names are case sensitive. The default value is 1. This parameter is supported for MySQL 8.0 only. Value range:
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 are used as examples.
- Request example
Creating a single DB instance:
{ "name": "rds-instance-rep2", "datastore": { "type": "MySQL", "version": "5.6" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb", "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" } ] }Creating a single MySQL 8.0 DB instance with initialization parameters specified:
{ "name": "rds-instance-rep2", "datastore": { "type": "MySQL", "version": "8.0" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "eu-de", "region": "aaa", "availability_zone": "eu-de-01", "availability_zone": "bbb", "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" } ], "unchangeable_param": { "lower_case_table_names": "1" } }Creating a SQL Server DB instance with collation specified
{ "name": "rds-instance-rep2", "datastore": { "type": "MySQL", "version": "8.0" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "eu-de", "region": "aaa", "availability_zone": "eu-de-01", "availability_zone": "bbb", "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" }, "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" } ], }Creating a single DB instance in a DeC:
{ "name": "rds-instance-rep2", "datastore": { "type": "MySQL", "version": "5.6" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb", "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", "dsspool_id":"3278327382738217382173872183721837213", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value2" } ] }Creating primary/standby DB instances:
{ "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", "region": "aaa", "availability_zone": "bbb,ccc", "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" } ] }Creating primary/standby DB instances in a DeC:
{ "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", "region": "aaa", "availability_zone": "bbb,ccc", "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", "dsspool_id":"327832738273821772133432, 21489938273821772133432" "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value2" } ] }Creating a read replica:
{ "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", "region": "aaa", "availability_zone": "bbb", "enterprise_project_id": "fdsa-3rds", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value2" } ] }
Creating a read replica in a DeC:
{
"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",
"region": "aaa",
"availability_zone": "bbb",
"enterprise_project_id": "fdsa-3rds"
"dsspool_id":"3278327382738217382173872183721837213",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value2"
}
]
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 when pay-per-use DB instances are created.
order_id
String
Indicates the order ID. This parameter is returned for the creation of a yearly/monthly DB instance.
Table 13 instance field data structure description Name
Type
Description
id
String
Indicates the DB instance ID.
NOTE:The v3 DB instance ID is incompatible with the v1 DB instance ID.
name
String
Indicates the DB instance name. Indicates the DB instance name. DB instances of the same type can have same names under the same tenant.
The value must be 4 to 64 characters in length and start with a letter. It is case-insensitive and can contain only letters, digits, hyphens (-), and underscores (_).
status
String
Indicates the DB instance status. 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
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, which is the same as the request parameter.
backup_strategy
Object
Indicates the automated backup policy.
For details, see Table 16.
enterprise_project_id
String
Indicates the project ID.
disk_encryption_id
String
Indicates the key ID for disk encryption. By default, this parameter is empty and is returned only when it is specified during the DB instance creation.
flavor_ref
String
Indicates the specification code. The value cannot be empty.
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
Indicates 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: Query the VPC ID through the VPC API. For details, see Querying VPCs.
subnet_id
String
Indicates the network ID. 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 network ID on the displayed page.
- Method 2: Query the network ID through the VPC API. For details, see Querying Subnets.
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: Query the security group through the VPC API. For details, see Querying Security Groups.
charge_info
Object
Indicates the billing information, which is yearly/monthly or pay-per-use.
For details, see Table 18.
collation
String
Indicates the collation set for Microsoft SQL Server.
Table 14 datastore field data structure description Name
Type
Description
type
String
Indicates the DB engine. Value:
- MySQL
- PostgreSQL
- SQLServer
version
String
Indicates the database version.
For details about supported database versions, see section Querying Version Information About a DB Engine.
Table 15 ha field data structure description Name
Type
Description
mode
String
Indicates the DB instance type. The value is Ha (primary/standby DB instances).
replication_mode
String
Indicates the replication mode for the standby DB instance. This parameter is valid when the mode is Ha.
Value:
- For MySQL, the value is async or semisync.
- For PostgreSQL, the value is async or sync.
- For Microsoft 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
Type
Description
start_time
String
Specifies the backup time window. Automated backups will be triggered during the backup time window.
The value cannot be empty. It must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.
- 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
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 2562 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 Name
Type
Description
type
String
Indicates the volume type.
Its value can be any of the following and is case-sensitive:
- ULTRAHIGH: indicates the SSD type.
size
Integer
Indicates the volume size.
Its value range is from 40 GB to 4000 GB. The value must be a multiple of 10.
For some users, storage space ranges from 40 GB to 6000 GB. If you want to create a DB instance with storage space up to 6000 GB or scale up to 10,000 GB, contact customer service to apply for the permission.
Table 18 chargeInfo field data structure description Name
Type
Description
charge_mode
String
Indicates the billing information, which is yearly/monthly or pay-per-use.
period_num
Integer
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).
The values of region and availability_zone are used as examples.
- Example normal response
Creating a single MySQL DB instance:
{ "instance": { "id": "dsfae23fsfdsae3435in01", "name": "trove-instance-rep2", "datastore": { "type": "MySQL", "version": "5.6" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "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" }Creating a single SQL Server DB instance:
{ "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": "aaa", "availability_zone": "bbb", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "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" }Creating primary/standby DB instances:
{ "instance":{ "id": "dsfae23fsfdsae3435in01", "name": "trove-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", "region": "aaa", "availability_zone": "bbb,ccc", "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" }Creating a read replica:
{ "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": "aaa", "availability_zone": "bbb", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "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
For details, see Status Codes.
Error Code
For details, see Error Codes.
Last Article: DB Instance Management
Next Article: Changing a DB Instance Name
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.