Creates a PolarDB cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | CreateDBCluster | The operation that you want to perform. Set the value to CreateDBCluster. |
RegionId | String | Yes | cn-hangzhou | The region ID of the cluster. Note You can call the DescribeRegions operation to query available regions. |
ZoneId | String | No | cn-hangzhou-g | The zone ID of the cluster. Note You can call the DescribeRegions operation to query available zones. |
DBType | String | Yes | MySQL | The type of the database engine. Valid values:
|
DBVersion | String | Yes | 5.6 | The version of the database engine
|
DBNodeClass | String | Yes | polar.mysql.x2.medium | The specifications of the node. For information about node specifications, see the following topics:
Note To create a serverless cluster, set this parameter to polar.mysql.sl.small. |
ClusterNetworkType | String | No | VPC | The network type of the cluster. Only virtual private clouds (VPCs) are supported. Valid value: VPC. |
DBClusterDescription | String | No | test | The name of the cluster. The name must meet the following requirements:
|
PayType | String | Yes | Postpaid | The billing method. Valid values:
|
AutoRenew | Boolean | No | true | Specifies whether to enable auto-renewal. Valid values:
Default value: false. Note This parameter is valid only if you set PayType to Prepaid. |
Period | String | No | Month | The unit of the subscription period. This parameter is required if you set PayType to Prepaid. Valid values:
|
UsedTime | String | No | 1 |
|
VPCId | String | No | vpc-********** | The ID of the VPC. |
VSwitchId | String | No | vsw-********** | The ID of the vSwitch. Note If you specify VPCId, VSwitchId is required. |
CreationOption | String | No | Normal | The method that is used to create a cluster. Valid values:
Default value: Normal. Note If you set DBType to MySQL and DBVersion to 8.0, you can set this parameter to CreateGdnStandby. |
SourceResourceId | String | No | rm-************* | The ID of the source ApsaraDB RDS instance or PolarDB cluster. This parameter is required only if you set CreationOption to MigrationFromRDS, CloneFromRDS, or CloneFromPolarDB.
|
CloneDataPoint | String | No | LATEST | The time point of the data to be cloned. Valid values:
Note If you set CreationOption to CloneFromRDS, you need to set this parameter to LATEST. |
ClientToken | String | No | 6000170000591aed949d0f5******************** | The client token that is used to ensure the idempotence of the request. The value is generated by the client ,and is unique and case-sensitive. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
ResourceGroupId | String | No | rg-************ | The ID of the resource group. |
SecurityIPList | String | No | 10.***.***.*** | The IP whitelist of the cluster. Note The whitelist can contain multiple IP addresses. Separate multiple IP addresses with commas (,). |
TDEStatus | Boolean | No | true | Specifies whether to enable Transparent Data Encryption (TDE). Valid values:
Note
|
GDNId | String | No | gdn-*********** | The ID of the Global Database Network (GDN). Note This parameter is required if you set CreationOption to CreateGdnStandby. |
CreationCategory | String | No | Normal | The edition of the cluster. Valid values:
Note
|
DefaultTimeZone | String | No | SYSTEM | The time zone of the cluster. You can set this parameter to a specific hour from -12:00 to +13:00 based on UTC. Example: 00:00. Default value: SYSTEM. This value specifies that the time zone of the cluster is the same as the time zone of the region. Note This parameter is valid only if you set DBType to MySQL. |
LowerCaseTableNames | String | No | 1 | Specifies whether the table name is case-sensitive. Valid values:
Default value: 1. Note This parameter is valid only if you set DBType to MySQL. |
BackupRetentionPolicyOnClusterDeletion | String | No | NONE | The retention policy for the backup sets when you delete the cluster. Valid values:
Default value: NONE. Note
|
StorageSpace | Long | No | 50 | The storage space that uses the subscription billing method. Unit: GB. Note Valid values for PolarDB for MySQL Standard Edition: 20 to 32000. |
DBMinorVersion | String | No | 8.0.1 | The minor version of the cluster. Valid values:
Note This parameter is valid only if you set DBType to MySQL and DBVersion to 8.0. |
ParameterGroupId | String | No | pcpg-************** | The ID of the parameter template. Note You can call the DescribeParameterGroups operation to query the parameter templates of a region, including the IDs of the parameter templates. |
Tag.N.Key | String | No | type | The key of the tag that you want to create for the cluster. To create multiple tags for a cluster at the same time, click the + icon. Note You can create up to 20 key-value pairs of tags at a time. Each Tag.N.Key is paired with Tag.N.Value . |
Tag.N.Value | String | No | test | The value of the tag that you want to create. To create multiple tags for a cluster at the same time, click the + icon. Note You can create up to 20 key-value pairs of tags at the same time. Each Tag.N.Value is paired with a Tag.N.Key . |
ServerlessType | String | No | AgileServerless | The type of the serverless cluster. Valid value: AgileServerless. Note This parameter is valid only for serverless clusters. |
ScaleMin | String | No | 1 | The minimum number of PolarDB capacity units (PCUs) per node for scaling. Valid values: 1 to 31. Note This parameter is valid only for serverless clusters. |
ScaleMax | String | No | 3 | The maximum number of PCUs per node for scaling. Valid values: 1 to 32. Note This parameter is valid only for serverless clusters. |
AllowShutDown | String | No | true | Specifies whether to enable the no-activity suspension feature. Valid values:
|
ScaleRoNumMin | String | No | 2 | The minimum number of read-only nodes for scaling. Valid values: 0 to 15. Note This parameter is valid only for serverless clusters. |
ScaleRoNumMax | String | No | 4 | The maximum number of read-only nodes for scaling. Valid values: 0 to 15. Note This parameter is valid only for serverless clusters. |
StorageType | String | No | PSL4 | The storage type of the cluster. Valid values for Enterprise Edition:
Valid values for Standard Edition:
|
DBNodeNum | Integer | No | 1 | The number of nodes in the cluster. Valid values:
Note
|
HotStandbyCluster | String | No | ON | Specifies whether to enable the hot standby storage cluster feature. Valid values:
|
StrictConsistency | String | No | ON | Specifies whether to enable the multi-zone data consistency feature. Valid values:
|
StandbyAZ | String | No | cn-hangzhou-g | The zone where the hot standby storage cluster is stored. This is valid for Standard Edition clusters of Multi-zone Edition. Note This parameter takes effect only if the multi-zone data consistency feature is enabled. |
ProxyType | String | No | Exclusive | The type of PolarProxy. Valid values:
|
ProxyClass | String | No | polar.maxscale.g2.medium.c | The specifications of the Standard Edition PolarProxy. Valid values:
|
LoosePolarLogBin | String | No | ON | Specifies whether to enable the binary log feature. Valid values:
|
LooseXEngine | String | No | ON | Specifies whether to enable X-Engine. Valid values:
|
LooseXEngineUseMemoryPct | String | No | 50 | The proportion of the storage space that uses X-Engine. Valid values: integers from 10 to 90. Note This parameter is valid only if you set LooseXEngine to ON. |
Response parameters
Parameter | Type | Example | Description |
RequestId | String | E56531A4-E552-40BA-9C58-137B80****** | The ID of the request. |
ResourceGroupId | String | rg-*************** | The ID of the resource group. |
DBClusterId | String | pc-bp1s826a1up****** | The ID of the cluster. |
OrderId | String | 211454967****** | The ID of the order. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/?Action=CreateDBCluster
&RegionId=cn-hangzhou
&ZoneId=cn-hangzhou-g
&DBType=MySQL
&DBVersion=5.6
&DBNodeClass=polar.mysql.x2.medium
&ClusterNetworkType=VPC
&DBClusterDescription=test
&PayType=Postpaid
&AutoRenew=true
&Period=Month
&UsedTime=1
&VPCId=vpc-**********
&VSwitchId=vsw-**********
&CreationOption=Normal
&SourceResourceId=rm-*************
&CloneDataPoint=LATEST
&ClientToken=6000170000591aed949d0f5********************
&ResourceGroupId=rg-************
&SecurityIPList=10.***.***.***
&TDEStatus=true
&GDNId= gdn-***********
&CreationCategory=Normal
&DefaultTimeZone=SYSTEM
&LowerCaseTableNames=1
&BackupRetentionPolicyOnClusterDeletion=NONE
&StorageSpace=50
&DBMinorVersion=8.0.1
&ParameterGroupId=pcpg-**************
&Tag=[{"Key":"type","Value":"test"}]
&ServerlessType=AgileServerless
&ScaleMin=1
&ScaleMax=3
&AllowShutDown=true
&ScaleRoNumMin=2
&ScaleRoNumMax=4
&StorageType=PSL4
&DBNodeNum=1
&HotStandbyCluster=ON
&ProxyType=Exclusive
&ProxyClass=polar.maxscale.g2.medium.c
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDBClusterResponse>
<RequestId>E56531A4-E552-40BA-9C58-137B80******</RequestId>
<ResourceGroupId>rg-***************</ResourceGroupId>
<DBClusterId>pc-bp1s826a1up******</DBClusterId>
<OrderId>211454967******</OrderId>
</CreateDBClusterResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "E56531A4-E552-40BA-9C58-137B80******",
"ResourceGroupId" : "rg-***************",
"DBClusterId" : "pc-bp1s826a1up******",
"OrderId" : "211454967******"
}
Error codes
HTTP status code | Error code | Error message | Description |
400 | InvalidBackupRetentionPolicyOnClusterDeletion.Malformed | The specified BackupRetentionPolicyOnClusterDeletion is invalid. | The value of BackupRetentionPolicyOnClusterDeletion is invalid. |
400 | InvalidLowerCaseTableNames.Malformed | The specified LowerCaseTableNames is invalid. | The value of LowerCaseTableNames is invalid. |
400 | InvalidDefaultTimeZone.Malformed | The specified DefaultTimeZone is invalid. | The value of DefaultTimeZone is invalid. |
400 | Location.FailedGetSubDomain | The specified regionId does not match the zoneId or the zoneId does not exist. | The specified regionId does not match the zoneId or the zoneId does not exist. |
400 | InvalidLowerCaseTableNames.Malformed | The specified LowerCaseTableNames value is invalid. | The value of LowerCaseTableNames is invalid. |
400 | MissParameter.GDNId | The GDNId parameter is required. | GDNId is not specified. |
For a list of error codes, see Service error codes.