Creates a PolarDB-X instance.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | CreateDBInstance | The operation that you want to perform. Set the value to CreateDBInstance. |
RegionId | String | Yes | cn-hangzhou | The region ID of the instance. |
PayType | String | Yes | PREPAY | The billing method of the instance. Valid values:
|
DBNodeCount | Integer | No | 2 | The number of nodes in the instance. Minimum value: 2. |
DBNodeClass | String | No | polarx.x4.2xlarge.2d | The instance type of the node. Valid values:
|
ClientToken | String | No | xxxxxx-xxx | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. |
NetworkType | String | No | vpc | The network type of the instance. Set the value to vpc. |
VPCId | String | No | vpc-***** | The ID of the virtual private cloud (VPC) to which the instance belongs. |
VSwitchId | String | No | vsw-********* | The vSwitch ID of the instance. |
UsedTime | Integer | No | 1 | The subscription period of the instance. Unit: month or year. Note If you set the Period parameter to Year, you can set this parameter to 1, 2, or 3. |
Period | String | No | Month | The unit of the billing cycle for the instance. The valid values vary based on the billing method. If you use the subscription billing method, set the parameter to Year or Month. If you use the pay-as-you-go billing method, the parameter is automatically set to Hour. |
ResourceGroupId | String | No | null | The ID of the resource group to which the instance belongs. This parameter is currently unavailable and can be set to null. |
AutoRenew | Boolean | No | true | Specifies whether to enable auto-renewal for the instance. Valid values:
|
EngineVersion | String | Yes | 2.0 | The database engine version of the instance. Set the value to 2.0. |
IsReadDBInstance | Boolean | No | false | Specifies whether the instance is a read-only instance. Valid values:
|
PrimaryDBInstanceName | String | No | pxc-********* | The name of the primary instance. If you create a read-only instance, you must specify this parameter. |
TopologyType | String | Yes | 3azones | The topology type of the instance. Valid values:
|
PrimaryZone | String | No | cn-shenzhen-e | The primary zone. |
SecondaryZone | String | No | cn-shenzhen-a | The secondary zone. |
TertiaryZone | String | No | cn-shenzhen-e | The tertiary zone. |
ZoneId | String | No | cn-hangzhou-a | The zone ID of the instance. |
CnClass | String | No | polarx.x4.medium.2e | The instance type of the compute node. Valid values:
|
DnClass | String | No | mysql.n4.medium.25 | The instance type of the data node. Valid values:
|
CNNodeCount | String | No | 2 | The number of compute nodes in the instance. |
DNNodeCount | String | No | 2 | The number of data nodes in the instance. |
Response parameters
Parameter |
Type |
Example |
Description |
DBInstanceName | String | pxc-********* | The name of the instance. |
RequestId | String | 9B2F3840-5C98-475C-B269-2D5C3A31797C | The request ID. |
OrderId | String | 12345 | The order ID. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CreateDBInstance
&RegionId=cn-hangzhou
&PayType=PREPAY
&DBNodeCount=2
&DBNodeClass=polarx.x4.2xlarge.2d
&ClientToken=xxxxxx-xxx
&NetworkType=vpc
&VPCId=vpc-*****
&VSwitchId=vsw-*********
&UsedTime=1
&Period=Month
&ResourceGroupId=null
&AutoRenew=true
&EngineVersion=2.0
&IsReadDBInstance=false
&PrimaryDBInstanceName=pxc-*********
&TopologyType=3azones
&PrimaryZone=cn-shenzhen-e
&SecondaryZone=cn-shenzhen-a
&TertiaryZone=cn-shenzhen-e
&ZoneId=cn-hangzhou-a
&CnClass=polarx.x4.medium.2e
&DnClass=mysql.n4.medium.25
&CNNodeCount=2
&DNNodeCount=2
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDBInstanceResponse>
<DBInstanceName>pxc-*********</DBInstanceName>
<RequestId>9B2F3840-5C98-475C-B269-2D5C3A31797C</RequestId>
<OrderId>12345</OrderId>
</CreateDBInstanceResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"DBInstanceName" : "pxc-*********",
"RequestId" : "9B2F3840-5C98-475C-B269-2D5C3A31797C",
"OrderId" : "12345"
}
Error codes
For a list of error codes, see Service error codes.