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 No CreateDBCluster

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

DBNodeClass String Yes polar.mysql.x2.medium

The specification of the node. For more information, see Specifications and pricing.

DBType String Yes MySQL

The type of the database engine. Valid values:

  • MySQL
  • PostgreSQL
  • Oracle
DBVersion String Yes 5.6

The version number of the database engine. Valid values:

  • The version number range of MySQL:
    • 5.6
    • 5.7
    • 8.0
  • The version number of PostgreSQL: 11
  • The version number of Oracle: 11
PayType String Yes Postpaid

The billing type. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
RegionId String Yes ch-hangzhou

The ID of the region.

Note You can call the DescribeRegions operation to query available regions.
ZoneId String No cn-hangzhou-g

The ID of the zone.

Note You can call the DescribeRegions operation to query available zones.
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:

  • The name cannot start with http:// or https://.
  • The name must be 2 to 256 characters in length.
AutoRenew Boolean No true

Specifies whether to enable auto-renewal. Valid values:

  • true: Enable auto-renewal.
  • false: Disable auto-renewal.

Default value: false

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

If the PayType parameter is set to Prepaid, this parameter is required. This parameter specifies whether the subscription type of the cluster is monthly subscription or annual subscription.

  • Year: annual subscription
  • Month: monthly subscription
UsedTime String No 1
  • If Period is set to Month, the valid values of the UsedTime parameter range from 1 to 9.
  • If Period is set to Year, the valid values of the UsedTime parameter range from 1 to 3.
VPCId String No vpc-**********

The ID of the VPC.

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

The ID of the VSwitch.

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 specified as CloneFromRDS or MigrationFromRDS.
  • If DBType is set to MySQL and DBVersion is set to 8.0, this parameter can be specified as CreateGdnStandby.
SourceResourceId String No rm-*************

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

  • If CreationOption is set to MigrationFromRDS or CloneFromRDS, you must specify the ID of the source RDS instance for this parameter. The edition of the source RDS instance is ApsaraDB RDS for MySQL 5.6 or 5.7 High-availability Edition, and the storage type is the local SSD.
  • If CreationOption is set to CloneFromPolarDB, you must specify the ID of the source PolarDB cluster for this parameter. By default, the value of the DBType parameter of the clone cluster must be consistent with that of the source cluster. For example, if the database engine of the source cluster is MySQL 8.0, you must set DBType to MySQL and DBVersion to 8.0 for the clone cluster.
CloneDataPoint String No LATEST

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

  • LATEST: data of the latest time point.
  • BackupID: ID of the historical backup set. Specify the ID of the specific backup set.
  • Timestamp: historical time point. Specify the specific 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 can be only 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 parameter value, but you must make sure that the parameter value is unique among different requests. The parameter value is case-sensitive, and can contain a maximum of 64 ASCII characters in length.

ResourceGroupId String No rg-************

The ID of the resource group.

SecurityIPList String No 10.***. ***. ***

The whitelist of the PolarDB cluster.

TDEStatus Boolean No true

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

  • true: Enable TDE.
  • false: Disable TDE. Default value: false.
Note
  • This parameter only takes effect when DBType is set to PostgreSQL or Oracle.
  • You can call the ModifyDBClusterTDE operation to enable TDE for a PolarDB for MySQL cluster.
  • You cannot disable TDE after TDE 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. Set the value to Normal. This value indicates Standard Edition.

DefaultTimeZone String No SYSTEM

The time zone of the cluster. The time must be in UTC. Valid values:

  • Default value: SYSTEM. By default, the time zone of the cluster is consistent with that of the region.
  • You can select the time on the hour from -12:00 to +13:00, such as 00:00.
    Note This parameter only takes effect when DBType is set to MySQL.
LowerCaseTableNames String No 1

Specifies whether the table name is case-sensitive. Valid values:

  • 1: not case-sensitive
  • 0: case-sensitive

Default value: 1

Note This parameter only takes effect when DBType is set to MySQL.
BackupRetentionPolicyOnClusterDeletion String No NONE

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

  • ALL: permanently retains all the backups.
  • LATEST: permanently retains the last backup. A backup is automatically created before the cluster is deleted.
  • NONE: retains no backup sets when you delete the cluster.

The default value is NONE when you create the cluster. The default value NONE indicates that no backup sets are retained when the cluster is deleted.

Note This parameter only takes effect when DBType is set to MySQL.

Response parameters

Parameter Type Example Description
DBClusterId String pc-****************

The ID of the cluster.

OrderId String 111111111111111

The ID of the order.

RequestId String E56531A4-E552-40BA-9C58-137B80******

The ID of the request

ResourceGroupId String rg-***************

The ID of the resource group.

Examples

Sample request

http(s)://polardb.aliyuncs.com/? Action=CreateDBCluster
&DBNodeClass=polar.mysql.x2.medium
&DBType=MySQL
&DBVersion=5.6
&PayType=Postpaid
&RegionId=ch-hangzhou
&<Common request parameters>

Sample success responses

XML format

<CreateDBClusterResponse>
  <RequestId>E56531A4-E552-40BA-9C58-137B80******</RequestId>
  <ResourceGroupId>rg-***************</ResourceGroupId>
  <DBClusterId>pc-****************</DBClusterId>
  <OrderId>111111111111111</OrderId>
</CreateDBClusterResponse>

JSON format

{
    "RequestId": "E56531A4-E552-40BA-9C58-137B80******",
    "ResourceGroupId": "rg-***************",
    "DBClusterId": "pc-****************",
    "OrderId": 111111111111111
}

Error codes

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

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