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

ParameterTypeRequiredExampleDescription
ActionStringYesCreateDBCluster

The operation that you want to perform. Set the value to CreateDBCluster.

RegionIdStringYescn-hangzhou

The region ID of the cluster.

Note You can call the DescribeRegions operation to query available regions.
ZoneIdStringNocn-hangzhou-g

The zone ID of the cluster.

Note You can call the DescribeRegions operation to query available zones.
DBTypeStringYesMySQL

The type of the database engine. Valid values:

  • MySQL
  • PostgreSQL
  • Oracle
DBVersionStringYes5.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
DBNodeClassStringYespolar.mysql.x2.medium

The specifications of the node.

ClusterNetworkTypeStringNoVPC

The network type of the cluster. Only virtual private clouds (VPCs) are supported. Set the value to VPC.

DBClusterDescriptionStringNotest

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

The billing method. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
AutoRenewBooleanNotrue

Specifies whether to enable automatic renewal. Valid values:

  • true
  • false

Default value: false.

Note This parameter is valid only when the PayType parameter is set to Prepaid.
PeriodStringNoMonth

The subscription type of the subscription cluster. This parameter is required only when the PayType parameter is set to Prepaid. Valid values:

  • Year: annual subscription. Unit: years.
  • Month: monthly subscription. Unit: months.
UsedTimeStringNo1
  • If the Period parameter is set to Month, the UsedTime parameter can be set to 1, 2, 3, 4, 5, 6, 7, 8, or 9.
  • If the Period parameter is set to Year, the UsedTime parameter can be set to 1, 2, or 3.
VPCIdStringNovpc-**********

The virtual private cloud (VPC) ID of the cluster.

VSwitchIdStringNovsw-**********

The vSwitch ID of the cluster.

Note If the VPCId parameter is specified, the VSwitchId parameter is required.
CreationOptionStringNoNormal

The method that is used to create a cluster. Valid values:

Default value: Normal.

Note If the DBType parameter is set to MySQL and the DBVersion parameter is set to 8.0, this parameter can be set to CreateGdnStandby.
SourceResourceIdStringNorm-*************

The ID of the source ApsaraDB RDS instance or PolarDB cluster. This parameter is required only when the CreationOption parameter is set to MigrationFromRDS, CloneFromRDS, or CloneFromPolarDB.

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

The point in time when you want to clone data. Valid values:

  • LATEST: The data of the latest point in time is cloned.
  • BackupID: You can specify the ID of a backup set. In this case, data is cloned based on the specified backup set.
  • Timestamp: You can specify a point in time in the past in the YYYY-MM-DDThh:mm:ssZ format. The time must be in UTC.

    Default value: LATEST.

Note If the CreationOption parameter is set to CloneFromRDS, the value of this parameter must be LATEST.
ClientTokenStringNo6000170000591aed949d0f5********************

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 make sure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length. The token is case-sensitive.

ResourceGroupIdStringNorg-************

The ID of the resource group.

SecurityIPListStringNo10.***.***.***

The IP whitelist of the cluster.

Note The whitelist can contain multiple IP addresses. Separate multiple IP addresses with commas (,).
TDEStatusBooleanNotrue

Specifies whether to enable transparent data encryption (TDE). Default value: false. Valid values:

  • true
  • false
Note
  • This parameter is valid only when the DBType parameter is set to PostgreSQL or Oracle.
  • You can call the ModifyDBClusterTDE operation to enable TDE for a PolarDB for MySQL cluster.
  • TDE cannot be disabled after it is enabled.
GDNIdStringNo gdn-***********

The ID of the Global Database Network (GDN).

Note This parameter is required only when the CreationOption parameter is set to CreateGdnStandby.
CreationCategoryStringNoNormal

The edition of the cluster. Default value: Normal. Valid values:

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

For more information, see Product editions.

DefaultTimeZoneStringNoSYSTEM

The time zone of the cluster. You can set the parameter to a value that is on the hour from -12:00 to +13:00 based on UTC. Example: 00:00. Default value: SYSTEM. This value indicates that the time zone of the cluster is the same as the time zone of the region.

Note This parameter is valid only when the DBType parameter is set to MySQL.
LowerCaseTableNamesStringNo1

Specifies whether the table names are case-sensitive. Valid values:

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

Default value: 1.

Note This parameter is valid only when the DBType parameter is set to MySQL.
BackupRetentionPolicyOnClusterDeletionStringNoNONE

The retention policy for the backup sets when you delete the cluster. Valid values:

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

The default value is NONE after you create a cluster.

Note
  • This parameter is valid only when the DBType parameter is set to MySQL.
  • This parameter is invalid for serverless clusters.
StorageSpaceLongNo50

The storage space that uses the subscription billing method. Unit: GB.

DBMinorVersionStringNo8.0.1

The minor version of the database engine. Valid values:

  • 8.0.2
  • 8.0.1
Note This parameter is valid only when the DBType parameter is set to MySQL and the DBVersion parameter is set to 8.0.
ParameterGroupIdStringNopcpg-**************

The ID of the parameter template.

Note You can call the DescribeParameterGroups operation to query the details of all parameter templates of a specified region, such as the ID of a parameter template.
Tag.N.KeyStringNotype

The key of the tag that you want to create for the cluster. To create multiple tags for a cluster at a time, click the + icon.

Note You can create up to 20 key-value pairs of tags at a time. Each value of Tag.N.Key is paired with a value of Tag.N.Value.
Tag.N.ValueStringNotest

The value of the tag that you want to create. To create multiple tags for a cluster at a time, click the + icon.

Note You can create up to 20 key-value pairs of tags at a time. Each value of the Tag.N.Value parameter is paired with a value of the Tag.N.Key parameter.
ServerlessTypeStringNoAgileServerless

The type of the serverless cluster. Set the value to AgileServerless.

Note This parameter is valid only for serverless clusters.
ScaleMinStringNo1

The minimum number of PCUs per node for scaling. Valid values: 1 PCU to 31 PCUs.

Note This parameter is valid only for serverless clusters.
ScaleMaxStringNo3

The maximum number of PCUs per node for scaling. Valid values: 1 PCU to 32 PCUs.

Note This parameter is valid only for serverless clusters.
AllowShutDownStringNotrue

Specifies whether to enable the no-activity suspension feature. Default value: false. Valid values:

  • true
  • false
    Note This parameter is valid only for serverless clusters.
ScaleRoNumMinStringNo2

The minimum number of read-only nodes for scaling. Valid values: 0 to 15.

Note This parameter is valid only for serverless clusters.
ScaleRoNumMaxStringNo4

The maximum number of read-only nodes for scaling. Valid values: 0 to 15.

Note This parameter is valid only for serverless clusters.
StorageTypeStringNoPSL4

The storage type. Valid values for Enterprise Edition:

  • PSL5
  • PSL4

Valid values for Standard Edition:

  • ESSDPL1
  • ESSDPL2
  • ESSDPL3
    Note This parameter is invalid for serverless clusters.
DBNodeNumIntegerNo1

The number of Standard Edition nodes. Default value: 1. Valid values:

  • 1: only one primary node.
  • 2: one read-only node and one primary node.
HotStandbyClusterStringNoON

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

  • ON
  • OFF
ProxyTypeStringNoExclusive

The type of PolarProxy. Default value: OFF. Valid values:

  • OFF: disables PolarProxy.
  • EXCLUSIVE: Dedicated Enterprise Edition
  • GENERAL: Standard Enterprise Edition
ProxyClassStringNopolar.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

Response parameters

ParameterTypeExampleDescription
RequestIdStringE56531A4-E552-40BA-9C58-137B80******

The ID of the request.

ResourceGroupIdStringrg-***************

The ID of the resource group.

DBClusterIdStringpc-bp1s826a1up******

The ID of the cluster.

OrderIdString211454967******

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 codeError codeError messageDescription
400InvalidBackupRetentionPolicyOnClusterDeletion.MalformedThe specified BackupRetentionPolicyOnClusterDeletion is invalid.The error message returned because the specified BackupRetentionPolicyOnClusterDeletion parameter is invalid.
400InvalidLowerCaseTableNames.MalformedThe specified LowerCaseTableNames is invalid.The error message returned because the specified LowerCaseTableNames parameter is invalid.
400InvalidDefaultTimeZone.MalformedThe specified DefaultTimeZone is invalid.The error message returned because the specified DefaultTimeZone parameter is invalid.
400Location.FailedGetSubDomainThe specified regionId does not match the zoneId or the zoneId does not exist.The error message returned because the specified region ID or zone ID is invalid or the specified zone ID does not exist.
400InvalidLowerCaseTableNames.MalformedThe specified LowerCaseTableNames value is invalid.The error message returned because the specified lowercase letter name is invalid.
400MissParameter.GDNIdThe GDNId parameter is required.The error message returned because the GDNId parameter is not specified.

For a list of error codes, see Service error codes.