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

Default value: false.

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

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

  • Year: annual subscription. Unit: year.
  • Month: monthly subscription. Unit: month.
UsedTime String No 1
  • 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.
VPCId String No vpc-**********

The VPC ID of the cluster.

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

The vSwitch ID of the cluster.

Note If the VPCId parameter is specified, the VSwitchId parameter is required.
CreationOption String No Normal

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 5.6 or 5.7, this parameter can be set to CloneFromRDS or MigrationFromRDS.
  • If the DBType parameter is set to MySQL and the DBVersion parameter 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 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 RDS instance. The source RDS instance must run MySQL 5.6 or 5.7 and be of the RDS High-availability Edition. Its storage type must be local SSD.
  • 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.
CloneDataPoint String No LATEST

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

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
  • 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.
GDNId String No gdn-***********

The ID of the Global Database Network (GDN).

Note This parameter is required only when the CreationOption parameter is set to CreateGdnStandby.
CreationCategory String No Normal

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

  • Normal: Cluster Edition
  • Basic: Single Node Edition
  • ArchiveNormal: Archive Database Cluster Edition
  • NormalMultimaster: Multi-master Cluster 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.

For more information, see Product editions.

DefaultTimeZone String No SYSTEM

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.
LowerCaseTableNames String No 1

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

Note This parameter is valid only when the DBType parameter is set to MySQL.
DBMinorVersion String No 8.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.
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.
Tag.N.Key String No type

The key 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 tags at a time. A tag consists of a key and a value. Each value of Tag.N.Key is paired with a value of 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 a time, click the + icon.

Note You can create up to 20 tags at a time. A tag consists of a key and a value. Each value of Tag.N.Key is paired with a value of Tag.N.Value.
StorageType String No PSL4

The storage type. Valid values:

  • PSL5
  • PSL4

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 request

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 response

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

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.
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.
400 InvalidLowerCaseTableNames.Malformed The Specified LowerCaseTableNames is not valid. The error message returned because the specified LowerCaseTableNames value is invalid.
400 MissParameter.GDNId The Specified GDNId is needed. The error message returned because the GDNId parameter is not specified.
400 EntityNotExist.ResourceGroup The resource-group does not exist. The error message returned because the resource group does not exist.

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