All Products
Search
Document Center

PolarDB:CreateDBCluster

Last Updated:Mar 01, 2024

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.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
polardb:CreateDBClusterWRITE
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the cluster.

Note You can call the DescribeRegions operation to query available regions.
cn-hangzhou
ZoneIdstringNo

The zone ID of the cluster.

Note You can call the DescribeRegions operation to query available zones.
cn-hangzhou-g
DBTypestringYes

The type of the database engine. Valid values:

  • MySQL
  • PostgreSQL
  • Oracle
MySQL
DBVersionstringYes

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

5.6
DBNodeClassstringYes

The specifications of the node.

polar.mysql.x2.medium
ClusterNetworkTypestringNo

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

VPC
DBClusterDescriptionstringNo

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

The billing method. Valid values:

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

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

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.
Month
UsedTimestringNo
  • 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.
1
VPCIdstringNo

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

vpc-**********
VSwitchIdstringNo

The vSwitch ID of the cluster.

Note If the VPCId parameter is specified, the VSwitchId parameter is required.
vsw-**********
CreationOptionstringNo

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.

Normal
SourceResourceIdstringNo

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.
rm-*************
CloneDataPointstringNo

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

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.

6000170000591aed949d0f5********************
ResourceGroupIdstringNo

The ID of the resource group.

rg-************
SecurityIPListstringNo

The IP whitelist of the cluster.

Note The whitelist can contain multiple IP addresses. Separate multiple IP addresses with commas (,).
10.***.***.***
TDEStatusbooleanNo

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.

true
GDNIdstringNo

The ID of the Global Database Network (GDN).

Note This parameter is required only when the CreationOption parameter is set to CreateGdnStandby.
gdn-***********
CreationCategorystringNo

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

  • Normal: Cluster Edition
  • Basic: Single Node Edition
  • ArchiveNormal: X-Engine 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.

Normal
DefaultTimeZonestringNo

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 the DBType parameter is set to MySQL.
SYSTEM
LowerCaseTableNamesstringNo

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

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.

NONE
StorageSpacelongNo

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

50
DBMinorVersionstringNo

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

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.
pcpg-**************
Tagobject []No

1

KeystringNo

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 the Tag.N.Key parameter is paired with a value of the Tag.N.Value parameter.
type
ValuestringNo

The value 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 the Tag.N.Value parameter is paired with a value of the Tag.N.Key parameter.
test
ServerlessTypestringNo

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

Note This parameter is valid only for serverless clusters.
AgileServerless
ScaleMinstringNo

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

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

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

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

Note This parameter is valid only for serverless clusters.
2
ScaleRoNumMaxstringNo

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

Note This parameter is valid only for serverless clusters.
4
StorageTypestringNo

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

E56531A4-E552-40BA-9C58-137B80******
ResourceGroupIdstring

The ID of the resource group.

rg-***************
DBClusterIdstring

The ID of cluster.

pc-bp1s826a1up******
OrderIdstring

The ID of the order.

211454967******

Examples

Sample success responses

JSONformat

{
  "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 specified BackupRetentionPolicyOnClusterDeletion parameter is invalid.
400InvalidLowerCaseTableNames.MalformedThe specified LowerCaseTableNames is invalid.The specified LowerCaseTableNames parameter is invalid.
400InvalidDefaultTimeZone.MalformedThe specified DefaultTimeZone is invalid.The specified DefaultTimeZone parameter is invalid.
400Location.FailedGetSubDomainThe specified regionId does not match the zoneId or the zoneId does not exist.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 specified lowercase letter name is invalid.
400MissParameter.GDNIdThe GDNId parameter is required.The GDNId parameter is required.
400EntityNotExist.ResourceGroupThe resource group does not exist..The resource group does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-16The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: ProvisionedIops
2023-10-12The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
2023-08-03The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: StorageAutoScale
    Added Input Parameters: StorageUpperBound
2023-08-01The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: StoragePayType
2023-06-20The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Architecture
2023-05-25The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: LoosePolarLogBin
    Added Input Parameters: LooseXEngine
    Added Input Parameters: LooseXEngineUseMemoryPct
2023-04-19The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: StrictConsistency
    Added Input Parameters: StandbyAZ
2023-03-14The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: DBNodeNum
    Added Input Parameters: ProxyType
    Added Input Parameters: ProxyClass
2022-11-16The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
2022-11-02The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: StorageType