Creates a PolarDB-X instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 that you want to create.

PayType String Yes PREPAY

The billing method of the instance. Valid values:

  • PREPAY: subscription
  • POSTPAY: pay-as-you-go
DBNodeCount Integer Yes 2

The number of nodes that you want to create in the instance.

DBNodeClass String Yes polarx.x4.2xlarge.2d

The specification of nodes. If you want to use a specification of 16 cores and 64 GB memory, set the value to polarx.x4.2xlarge.2e.

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 value, but you must ensure that it is unique among different requests.

NetworkType String No vpc

The network type of the instance. Valid values:

  • vpc: virtual private cloud (VPC)
  • classic: classic networks
VPCId String No vpc-*****

The ID of the VPC.

VSwitchId String No vsw-*********

The ID of the vSwitch.

UsedTime Integer No 1

The subscription period of the instance. Unit: month or year.

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 value to Year or Month. If you use the pay-as-you-go billing method, the value 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. Default value: true.

  • true: Enable auto-renewal.
  • false: Disable auto-renewal.
EngineVersion String Yes 2.0

The version of the database engine. Set the value to 2.0.

IsReadDBInstance Boolean No false

Specifies whether the instance is a read-only instance.

  • true: The instance is a read-only instance.
  • false: The instance is not a read-only instance.
PrimaryDBInstanceName String No pxc-*********

The name of the primary instance. If you create a read-only instance, you must configure this parameter.

TopologyType String No 3azones/1azone

The topology type of the instance.

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 ID of the zone in which the instance is located.

Response parameters

Name Type Example Description
DBInstanceName String pxc-*********

The name of the instance that you create.

RequestId String 9B2F3840-5C98-475C-B269-2D5C3A31797C

The ID of the request.

OrderId String 12345

The ID of the order.

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/1azone
&PrimaryZone=cn-shenzhen-e
&SecondaryZone=cn-shenzhen-a
&TertiaryZone=cn-shenzhen-e
&ZoneId=cn-hangzhou-a
&<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, visit the API Error Center.