All Products
Search
Document Center

PolarDB:CreateDBInstance

最終更新日:Nov 09, 2023

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

PayType String Yes PREPAY

The billing method of the instance. Valid values:

  • PREPAY: subscription
  • POSTPAY: pay-as-you-go
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:

  • polarx.x4.medium.2e: 2 CPU cores and 8 GB of memory
  • polarx.x4.large.2e: A node of this specification has 4 CPU cores and 16 GB of memory.
  • polarx.x8.large.2e: A node of this specification has 4 CPU cores and 32 GB of memory.
  • polarx.x4.xlarge.2e: A node of this specification has 8 CPU cores and 32 GB of memory.
  • polarx.x8.xlarge.2e: A node of this specification has 8 CPU cores and 64 GB of memory.
  • polarx.x4.2xlarge.2e: 16 CPU cores and 64 GB of memory
  • polarx.x8.2xlarge.2e: 16 CPU cores and 128 GB of memory
  • polarx.x4.4xlarge.2e: A node of this specification has 32 CPU cores and 128 GB of memory.
  • polarx.x8.4xlarge.2e: A node of this specification has 32 CPU cores and 256 GB of memory.
  • polarx.st.8xlarge.2e: A node of this specification has 60 CPU cores and 470 GB of memory.
  • polarx.st.12xlarge.2e: A node of this specification has 90 CPU cores and 720 GB of memory.
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:

  • true (default)
  • false
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:

  • true
  • false
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:

  • 3azones: The instance is deployed in three zones.
  • 1azone: The instance is deployed in only one zone.
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:

  • polarx.x4.medium.2e: 2 CPU cores and 8 GB of memory
  • polarx.x4.large.2e: A node of this specification has 4 CPU cores and 16 GB of memory.
  • polarx.x8.large.2e: A node of this specification has 4 CPU cores and 32 GB of memory.
  • polarx.x4.xlarge.2e: A node of this specification has 8 CPU cores and 32 GB of memory.
  • polarx.x8.xlarge.2e: A node of this specification has 8 CPU cores and 64 GB of memory.
  • polarx.x4.2xlarge.2e: 16 CPU cores and 64 GB of memory
  • polarx.x8.2xlarge.2e: 16 CPU cores and 128 GB of memory
  • polarx.x4.4xlarge.2e: A node of this specification has 32 CPU cores and 128 GB of memory.
  • polarx.x8.4xlarge.2e: A node of this specification has 32 CPU cores and 256 GB of memory.
  • polarx.st.8xlarge.2e: A node of this specification has 60 CPU cores and 470 GB of memory.
  • polarx.st.12xlarge.2e: A node of this specification has 90 CPU cores and 720 GB of memory.
DnClass String No mysql.n4.medium.25

The instance type of the data node. Valid values:

  • mysql.n4.medium.25: 2 CPU cores and 8 GB of memory
  • mysql.n4.large.25: A node of this specification has 4 CPU cores and 16 GB of memory.
  • mysql.x8.large.25: A node of this specification has 4 CPU cores and 32 GB of memory.
  • mysql.n4.xlarge.25: A node of this specification has 8 CPU cores and 32 GB of memory.
  • mysql.x8.xlarge.25: A node of this specification has 8 CPU cores and 64 GB of memory.
  • mysql.n4.2xlarge.25: 16 CPU cores and 64 GB of memory
  • mysql.x8.2xlarge.25: 16 CPU cores and 128 GB of memory
  • mysql.x4.4xlarge.25: A node of this specification has 32 CPU cores and 128 GB of memory.
  • mysql.x8.4xlarge.25: A node of this specification has 32 CPU cores and 256 GB of memory.
  • mysql.st.8xlarge.25: A node of this specification has 60 CPU cores and 470 GB of memory.
  • mysql.st.12xlarge.25: A node of this specification has 90 CPU cores and 720 GB of memory.
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.