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 value for the PostgreSQL database engine: 11
  • Valid value for the Oracle database engine: 11
DBNodeClass String Yes polar.mysql.x2.medium

The specifications of the node.

ClusterNetworkType String No VPC

The network type of the cluster. Only virtual private clouds (VPCs) are supported. Set the value to 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 of the cluster. Valid values:

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

Specifies whether to enable automatic renewal. Valid values:

  • true: enables auto-renewal
  • false: disables auto-renewal

Default value: false.

Note This parameter is valid only when PayType is set to Prepaid.
Period String No Month

The unit of the subscription period. This parameter is required if the PayType parameter is set to Prepaid. The subscription type of the subscription cluster.

  • Year: annual subscription.
  • Month: monthly subscription.
UsedTime String No 1
  • If Period is set to Month, UsedTime can be set to 1, 2, 3, 4, 5, 6, 7, 8, or 9.
  • If Period is set to Year, UsedTime can be set to 1, 2, or 3.
VPCId String No vpc-**********

The VPC ID of the cluster.

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

The vSwitch ID of the cluster.

Note If VPCId is selected, VSwitchId is required.
CreationOption String No Normal

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

Default value: Normal.

Note
  • If DBType is set to MySQL and DBVersion is set to 5.6 or 5.7, this parameter can be set to CloneFromRDS or MigrationFromRDS.
  • If DBType is set to MySQL and DBVersion is set to 8.0, this parameter can be set to CreateGdnStandby.
SourceResourceId String No rm-*************

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

  • If CreationOption is set to MigrationFromRDS or CloneFromRDS, you must set this parameter to the ID of the source RDS instance. The source RDS instance is of the ApsaraDB RDS for MySQL 5.6 or 5.7 High-availability Edition, and storage is local SSD.
  • If CreationOption 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 DBType to MySQL and DBVersion to 8.0 for the destination cluster.
CloneDataPoint String No LATEST

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

  • LATEST: The data of the latest point in time is cloned.
  • BackupID: Specify the ID of a backup set.
  • Timestamp: Specify a point in time in the past. Specify the time in the YYYY-MM-DDThh:mm:ssZ format. The time must be in UTC.

    Default value: LATEST.

Note If CreationOption is set to CloneFromRDS, the value of this parameter must be LATEST.
ClientToken String No 6000170000591aed949d0f5********************

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. The token can only contain ASCII characters and cannot exceed 64 characters in length. The token is case-sensitive.

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). Default value: false. Valid values:

  • true: enables TDE.
  • false: disables TDE.
Note
  • This parameter is valid only when DBType 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.
GDNId String No gdn-***********

The ID of the Global Database Network (GDN).

Note This parameter is required if CreationOption is set to CreateGdnStandby.
CreationCategory String No Normal

The edition of the cluster. Valid values:

  • Normal: Cluster Edition
  • Basic: Single Node Edition
  • ArchiveNormal: Archive Database Cluster Edition
Note
  • Only when DBType is set to MySQL and DBVersion is set to 5.6, 5.7, or 8.0, you can set this parameter to Basic.
  • Only when DBType is set to MySQL and DBVersion is set to 8.0, you can set this parameter to ArchiveNormal.

For more information, see Product editions.

DefaultTimeZone String No SYSTEM

The time zone of the cluster. The time must be in UTC. You can set the parameter to a value that is on the hour from -12:00 to +13:00. Example: 00:00. Default value: SYSTEM, which means that the value is the same as the time zone of the region.

Note This parameter is valid only when DBType is set 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 when DBType is set to MySQL.
BackupRetentionPolicyOnClusterDeletion String No NONE

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. The default value NONE indicates that no backup sets are retained after the cluster is deleted.

Note This parameter is valid only when DBType is set to MySQL.
DBMinorVersion String No 8.0.1

The minor version of the database engine.

  • If DBVersion is 8.0, the valid values of this parameter are:
    • 8.0.2
    • 8.0.1
  • If DBVersion is 5.7, the value of this parameter is 5.7.28.
  • If DBVersion is 5.6, the value of this parameter is 5.6.16.
ParameterGroupId String No pcpg-**************

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.

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
&DBNodeClass=polar.mysql.x2.medium
&DBType=MySQL
&DBVersion=5.6
&PayType=Postpaid
&RegionId=cn-hangzhou
&<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 error message returned because the specified BackupRetentionPolicyOnClusterDeletion parameter is invalid.
400 InvalidLowerCaseTableNames.Malformed The specified LowerCaseTableNames is invalid. The error message returned because the specified LowerCaseTableNames parameter is invalid.
400 InvalidDefaultTimeZone.Malformed The specified DefaultTimeZone is invalid. The error message returned because the specified DefaultTimeZone parameter is invalid.
400 Location.FailedGetSubDomain The 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.

For a list of error codes, visit the API Error Center.