All Products
Search
Document Center

PolarDB:CreateDBCluster

Last Updated:Sep 05, 2023

Creates a PolarDB cluster.

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

  • MySQL
  • PostgreSQL
  • Oracle
DBVersion String Yes 5.6

The version of the database engine

  • Valid values for the MySQL database engine:
    • 5.6
    • 5.7
    • 8.0
  • Valid values for the PostgreSQL database engine:
    • 11
    • 14
  • Valid value for the Oracle database engine: 11
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:

  • It cannot start with http:// or https://.
  • It must be 2 to 256 characters in length.
PayType String Yes Postpaid

The billing method. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
AutoRenew Boolean No true

Specifies whether to enable auto-renewal. Valid values:

  • true
  • false

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:

  • Year
  • Month
UsedTime String No 1
  • If you set Period to Month, you can set UsedTime to 1, 2, 3, 4, 5, 6, 7, 8, or 9.
  • If you set Period to Year, you can set UsedTime to 1, 2, or 3.
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.

  • If you set CreationOption to MigrationFromRDS or CloneFromRDS, you need to set this parameter to the ID of the source RDS instance. The source ApsaraDB RDS instance must use ApsaraDB RDS for MySQL 5.6, 5.7, or 8.0 High-availability Edition.
  • If you set CreationOption to CloneFromPolarDB, you need to set this parameter to the ID of the source PolarDB cluster. By default, the DBType of the destination cluster need to be the same as that of the source cluster. For example, if you use a MySQL 8.0 cluster as the source cluster, you need to set DBType to MySQL and DBVersion to 8.0 for the destination cluster.
CloneDataPoint String No LATEST

The time point of the data to be cloned. Valid values:

  • LATEST: the data of the latest point in time is cloned.
  • BackupID: the data is cloned based on a backup set. You need to specify the ID of the backup set.
  • Timestamp: the data of a point in time is cloned. You need to specify a timestamp in the YYYY-MM-DDThh:mm:ssZ format. The time must be in UTC.

    Default value: LATEST.

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:

  • true
  • false (default)
Note
  • This parameter is valid only if you set DBType to PostgreSQL or Oracle.
    Note
    • You can call the ModifyDBClusterTDE operation to enable TDE for a PolarDB for MySQL cluster.
      Note
      • You cannot disable TDE after it is enabled.
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:

  • Normal (default): Cluster Edition
  • Basic: Single Node Edition
  • ArchiveNormal: X-Engine Edition
  • NormalMultimaster: Multi-master Cluster Edition
  • SENormal: Standard Edition
Note
  • If you set DBType to MySQL and DBVersion is set to 5.6, 5.7, or 8.0, you can set this parameter to Basic.
    Note
    • If you set DBType to MySQL and DBVersion is set to 8.0, you can set this parameter to ArchiveNormal or NormalMultimaster.
      Note
      • If you set DBType to MySQL and DBMinorVersion is set to 8.0.1, you can set this parameter to SENormal.

      For more information, see Product editions.

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:

  • 1: The table names on the instance are case-insensitive.
  • 0: The table names on the instance are case-sensitive.

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:

  • ALL: permanently retains all backup sets.
  • LATEST: permanently retains the last backup set. A backup set is automatically created before you delete the cluster.
  • NONE: No backup sets are retained after the cluster is deleted.

Default value: NONE.

Note
  • This parameter is valid only if you set DBType to MySQL.
    Note
    • This parameter is invalid for serverless clusters.
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:

  • 8.0.2
  • 8.0.1
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:

  • true
  • false (default)
    Note This parameter is valid only for serverless clusters.
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:

  • PSL5
  • PSL4

Valid values for Standard Edition:

  • ESSDPL1
  • ESSDPL2
  • ESSDPL3
    Note This parameter is invalid for serverless clusters.
DBNodeNum Integer No 1

The number of nodes in the cluster. Valid values:

  • 1: only one read-write node.
  • 2: one read-only node and one read-write node.
Note
  • Default value for Enterprise Edition: 2. Default value for Standard Edition:1.
  • This parameter is valid only for PolarDB for MySQL clusters.
HotStandbyCluster String No ON

Specifies whether to enable the hot standby storage cluster feature. Valid values:

  • ON (default)
  • OFF
  • STANDBY: enables the hot standby storage cluster feature only for Standard Edition clusters.
    Note The default value for Standard Edition clusters is STANDBY.
StrictConsistency String No ON

Specifies whether to enable the multi-zone data consistency feature. Valid values:

  • ON: enables the multi-zone data consistency feature, which is valid for Standard Edition clusters of Multi-zone Edition.
  • OFF
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:

  • OFF (default)
  • EXCLUSIVE: Dedicated Enterprise Edition
  • GENERAL: Standard Enterprise Edition
ProxyClass String No polar.maxscale.g2.medium.c

The specifications of the Standard Edition PolarProxy. Valid values:

  • polar.maxscale.g2.medium.c: 2 cores
  • polar.maxscale.g2.large.c: 4 cores
  • polar.maxscale.g2.xlarge.c: 8 cores
  • polar.maxscale.g2.2xlarge.c: 16 cores
  • polar.maxscale.g2.3xlarge.c: 24 cores
  • polar.maxscale.g2.4xlarge.c: 32 cores
  • polar.maxscale.g2.8xlarge.c: 64 cores
LoosePolarLogBin String No ON

Specifies whether to enable the binary log feature. Valid values:

  • ON
  • OFF
    Note This parameter is valid only if you set DBType to MySQL.
LooseXEngine String No ON

Specifies whether to enable X-Engine. Valid values:

  • ON
  • OFF
    Note This parameter is valid only if you do not set CreationOption to CreateGdnStandby, and you set DBType to MySQL, and DBVersion to 8.0. To enable X-Engine, the memory size of the node must be no less than 16 GB.
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.