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 of compute nodes.

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:

  • MySQL:
    • 5.6
    • 5.7
    • 8.0
  • PostgreSQL: 11.
  • Oracle: 11.
PayType String Yes Postpaid

The billing method. Valid values:

  • Postpaid: the pay-as-you-go billing method.
  • Prepaid: the subscription billing method.
RegionId String Yes cn-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 automatic renewal. Valid values:

  • true: Automatic renewal is enabled.
  • false: Automatic renewal is disabled.

The default value is false.

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

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

  • Year: annual subscription.
  • Month: monthly subscription.
UsedTime String No 1
  • If Period is set to Month, UsedTime can be set to a value from 1 to 9.
  • If Period is set to Month, UsedTime can be set to a value 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:

The default value is 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 RDS instance or the ID of the source 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 ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

    The default value is LATEST.

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

The client token is used to ensure the idempotence of requests. A client token is generated in the client and is unique for different requests. The 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: enables TDE.
  • false: disables TDE. This is the default value.
Note
  • This parameter takes effect 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 you enable the feature.
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 PolarDB service. Valid values:

  • Normal: Cluster Edition
  • Basic: Single Node
  • Archive: Archive Database
Note
  • You can set this parameter to Basic 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 Archive only when DBType is set to MySQL and DBVersion is set to 8.0.

For more information, see Product editions.

DefaultTimeZone String No SYSTEM

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

  • The default value is SYSTEM. By default, the time zone of the cluster is the same as that of the region where the cluster is deployed.
  • You can set the parameter to a value that is on the hour from -12:00 to +13:00. For example, 00:00.
    Note This parameter takes effect only 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.

The default value is 1.

Note This parameter takes effect 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: does not retain backup sets after you delete the cluster.

The default value is NONE when you create the cluster. The system deletes all backup sets after you delete the cluster.

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

The minor version of the database engine.

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

The ID of the parameter template.

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

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