All Products
Search
Document Center

PolarDB:CreateDBCluster

最終更新日:Nov 25, 2024

CreateDBCluster.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:CreateDBClustercreate
*All Resources
*
  • polardb:EncryptionRequired
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

Region ID.

Note You can view available regions through the DescribeRegions interface.
cn-hangzhou
ZoneIdstringNo

Availability Zone ID.

Note You can view the available zones through the DescribeRegions interface.
cn-hangzhou-j
ArchitecturestringNo

CPU architecture. Available values include:

  • X86
  • ARM
X86
DBTypestringYes

Database engine type, with available values as follows:

  • MySQL
  • PostgreSQL
  • Oracle
MySQL
DBVersionstringYes

Database engine version number.

  • For MySQL, the version numbers are as follows:
    • 5.6
    • 5.7
    • 8.0
  • For PostgreSQL, the version numbers are as follows:
    • 11
    • 14
    • 15
  • For Oracle, the version numbers are as follows:
    • 11
    • 14
5.6
DBNodeClassstringYes

Node specifications. For details, refer to the following documents:

Note
  • For a Serverless cluster in PolarDB MySQL, enter polar.mysql.sl.small.
  • polar.mysql.x4.medium
    ClusterNetworkTypestringNo

    Cluster network type, currently only VPC is supported, with a fixed value of VPC.

    VPC
    DBClusterDescriptionstringNo

    Cluster name, which must meet the following requirements:

    • Cannot start with http:// or https://.
    • Length should be between 2 and 256 characters.
    test
    PayTypestringYes

    Payment type, with available values as follows:

    • Postpaid: Pay-as-you-go.
    • Prepaid: Subscription (monthly or yearly).
    Postpaid
    AutoRenewbooleanNo

    Whether to enable auto-renewal, with available values as follows:

    • true: Auto-renew.
    • false: Do not auto-renew.

    The default is false.

    Note This parameter takes effect only when PayType is set to Prepaid.
    true
    PeriodstringNo

    If the payment type is Prepaid, this parameter is required. It specifies whether the prepaid cluster is on a monthly or yearly basis.

    • Year: Yearly subscription.
    • Month: Monthly subscription.
    Month
    UsedTimestringNo

    If the payment type is Prepaid, this parameter is required.

    • When Period is Month, UsedTime should be an integer within [1-9].
    • When Period is Year, UsedTime should be an integer within [1-3].
    1
    VPCIdstringNo

    VPC ID.

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

    Virtual switch ID.

    Note If VPCId has been selected, VSwitchId is mandatory.
    vsw-**********
    CreationOptionstringNo

    Creation method, with the following values supported:

    The default value is Normal.

    Note When DBType is MySQL and DBVersion is 8.0, this parameter can also take the value CreateGdnStandby.
    Normal
    SourceResourceIdstringNo

    Source RDS instance ID or source PolarDB cluster ID. This parameter is mandatory only when CreationOption is set to MigrationFromRDS, CloneFromRDS, CloneFromPolarDB, or RecoverFromRecyclebin.

    • If CreationOption is MigrationFromRDS or CloneFromRDS, you need to input the source RDS instance ID. The source RDS instance version must be RDS MySQL 5.6, 5.7, or 8.0 High Availability edition.

    • If CreationOption is CloneFromPolarDB, you need to input the source PolarDB cluster ID. The DBType of the cloned cluster will default to match the source cluster. For example, if the source cluster is MySQL 8.0, the cloned cluster must also have DBType set to MySQL and DBVersion to 8.0.

    • If CreationOption is RecoverFromRecyclebin, you need to input the released source PolarDB cluster ID. The DBType of the cluster being recovered from the recycle bin must match the source cluster. For example, if the source cluster was MySQL 8.0, the recovered cluster must also have DBType set to MySQL and DBVersion to 8.0.

    rm-*************
    CloneDataPointstringNo

    The point in time to clone data, with the following options:

    • LATEST: Data from the latest time point.
    • BackupID: Historical backup set ID, please enter the specific backup set ID.
    • Timestamp: Historical time point, please enter the specific time in the format YYYY-MM-DDThh:mm:ssZ (UTC time).

    The default value is LATEST.

    Note If CreationOption is CloneFromRDS, this parameter can only be set to LATEST.
    LATEST
    ClientTokenstringNo

    Used to ensure idempotency of the request. Generated by the client, ensuring uniqueness across different requests, case-sensitive, and not exceeding 64 ASCII characters.

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

    Resource group ID.

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

    PolarDB cluster whitelist IP address.

    Note Supports configuring multiple whitelist IP addresses, with English commas separating multiple IP addresses.
    10.***.***.***
    TDEStatusbooleanNo

    Enables TDE encryption. Valid values are as follows:

    • true: Enabled.
    • false: Disabled (default).
    Note
  • This parameter takes effect only when DBType is PostgreSQL or Oracle.
  • You can call the ModifyDBClusterTDE interface to enable TDE encryption for a PolarDB MySQL cluster.
  • Once the TDE feature is enabled, it cannot be disabled.
  • true
    GDNIdstringNo

    Global Database Network (GDN) ID.

    Note This parameter is required when CreationOption is CreateGdnStandby.
    gdn-***********
    CreationCategorystringNo

    Product series, with valid values as follows:

    • Normal: Cluster Edition (default)
    • Basic: Single-node
    • ArchiveNormal: High Compression Engine (X-Engine)
    • NormalMultimaster: Multi-master Cluster Edition
    • SENormal: Standard Edition
    Note
  • MySQL 5.6, 5.7, 8.0, PostgreSQL 14, and Oracle Syntax Compatible 2.0 support Basic.
  • MySQL 8.0 supports ArchiveNormal and NormalMultimaster.
  • MySQL 5.6, 5.7, 8.0, and PostgreSQL 14 support SENormal.
  • For more information about product series, see Product Series.

    Normal
    DefaultTimeZonestringNo

    Cluster timezone (UTC), with selectable values ranging from -12:00 to +13:00 at whole-hour intervals, e.g., 00:00. The default value is SYSTEM, which matches the Region's timezone.

    Note This parameter applies only when DBType is MySQL.
    SYSTEM
    LowerCaseTableNamesstringNo

    Whether table names are case-sensitive, with valid values as follows:

    • 1: Case-insensitive
    • 0: Case-sensitive

    The default value is 1.

    Note This parameter applies only when DBType is MySQL.
    1
    BackupRetentionPolicyOnClusterDeletionstringNo

    Backup retention policy upon cluster deletion, with valid values as follows:

    • ALL: Permanently retain all backups.
    • LATEST: Permanently retain the latest backup (automatically backed up before deletion).
    • NONE: Do not retain backup sets upon cluster deletion.

    By default, the value is set to NONE, indicating no backup sets are retained upon cluster deletion.

    Note This parameter applies only when DBType is MySQL. Serverless clusters do not support this parameter.
    NONE
    StorageSpacelongNo

    Storage space for pay-by-space (subscription) billing. Unit: GB.

    Note
  • For PolarDB MySQL Standard Edition, the storage space range is 20 to 32000.
  • When the Standard Edition storage type is ESSDAUTOPL, the storage space range is 40 to 64000, with a minimum step size of 10, meaning you can only enter values like 40, 50, 60, and so on.
  • 50
    DBMinorVersionstringNo

    Database engine minor version number. Valid values include:

    • 8.0.2
    • 8.0.1
    Note This parameter takes effect only when DBType is MySQL and DBVersion is 8.0.
    8.0.1
    ParameterGroupIdstringNo

    Parameter template ID.

    Note You can view the list of parameter templates in the target region, including the parameter template ID, by calling the DescribeParameterGroups interface.
    pcpg-**************
    Tagarray<object>No

    List of tags.

    objectNo
    KeystringNo

    Tag key. If you need to add multiple tags to the target cluster at once, click Add to add a tag key.

    Note Up to 20 pairs of tags can be added each time, where Tag.N.Key corresponds to Tag.N.Value.
    type
    ValuestringNo

    Tag value. If you need to add multiple tags to the target cluster at once, click Add to add tag values.

    Note Up to 20 pairs of tags can be added each time, where Tag.N.Value corresponds to Tag.N.Key.
    test
    ServerlessTypestringNo

    Serverless type. The current value is fixed to AgileServerless (sensitive mode).

    Note This parameter is only supported by Serverless clusters.
    AgileServerless
    ScaleMinstringNo

    Minimum scaling limit for a single node. The value range is: 1 PCU~31 PCU.

    Note Only supported by Serverless clusters.
    1
    ScaleMaxstringNo

    Maximum scaling limit for a single node. The value range is: 1 PCU~32 PCU.

    Note Only supported by Serverless clusters.
    3
    AllowShutDownstringNo

    Whether to enable idle pause. Values:

    • true: Enabled

    • false: Disabled (default)

    Note Only supported by Serverless clusters.
    true
    ScaleRoNumMinstringNo

    Minimum scaling limit for the number of read-only nodes. The value range is: 0~15.

    Note Only supported by Serverless clusters.
    2
    ScaleRoNumMaxstringNo

    Maximum scaling limit for the number of read-only nodes. The value range is: 0~15.

    Note Only supported by Serverless clusters.
    4
    StorageTypestringNo

    Enterprise edition storage types include:

    • PSL5
    • PSL4

    Standard edition storage types include:

    • ESSDPL0
    • ESSDPL1
    • ESSDPL2
    • ESSDPL3
    • ESSDAUTOPL
    PSL4
    DBNodeNumintegerNo

    The number of nodes. This parameter is supported for Standard Edition clusters. Valid values:

    • 1 (default): only one primary node.
    • 2: one read-only node and one primary node.
    Note
    • By default, an Enterprise Edition cluster has two nodes and a Standard Edition cluster has one node.

    • This parameter is supported only for PolarDB for MySQL clusters.

    1
    HotStandbyClusterstringNo

    Whether to enable the hot standby cluster. Values are as follows:

    • ON (default): Enables the hot standby cluster.
    • OFF: Disables the hot standby cluster.
    • STANDBY: Enables the hot standby cluster for the standard edition.
    Note The default value for standard edition clusters is STANDBY.
    ON
    StrictConsistencystringNo

    Whether the cluster has enabled strong data consistency across multiple zones. Values are as follows:

    • ON: Indicates strong data consistency across multiple zones is enabled, applicable to the standard edition 3AZ scenario.

    • OFF: Indicates strong data consistency across multiple zones is not enabled.

    ON
    StandbyAZstringNo

    The availability zone where the hot standby cluster is stored. Applicable to the standard edition 3AZ scenario.

    Note This parameter takes effect only when multi-zone data strong consistency is enabled.
    cn-hangzhou-g
    ProxyTypestringNo

    Database proxy type, with values including:

    • EXCLUSIVE: Enterprise Exclusive Edition
    • GENERAL: Enterprise General Purpose Edition
    Note The proxy type must match the type of the cluster's node specifications, i.e.,
  • If the node specification is general, the proxy type should be Enterprise General Purpose Edition;
  • If the node specification is dedicated, the proxy type should be Enterprise Exclusive Edition.
  • Exclusive
    ProxyClassstringNo

    Standard edition database proxy specifications. Values are as follows:

    • polar.maxscale.g2.medium.c: 2 cores.
    • polar.maxscale.g2.large.c: 4 cores.
    • polar.maxscale.g2.xlarge.c: 8 cores.
    • polar.maxscale.g2.2xlarge.c: 16 cores.
    • polar.maxscale.g2.3xlarge.c: 24 cores.
    • polar.maxscale.g2.4xlarge.c: 32 cores.
    • polar.maxscale.g2.8xlarge.c: 64 cores.
    polar.maxscale.g2.medium.c
    LoosePolarLogBinstringNo

    Enable Binlog feature, valid values are as follows:

    • ON: Cluster enables the Binlog feature. - OFF: Cluster disables the Binlog feature. > This parameter takes effect only when the DBType parameter is set to MySQL.
    ON
    LooseXEnginestringNo

    Enable the X-Engine storage engine feature, with valid values as follows:

    • ON: The cluster enables the X-Engine engine.
    • OFF: The cluster disables the X-Engine engine.
    Note This parameter is effective only when CreationOption is not CreateGdnStandby, DBType is MySQL, and DBVersion is 8.0. The memory specification of nodes that enable the X-Engine engine must be at least 8 GB.
    ON
    LooseXEngineUseMemoryPctstringNo

    Set the ratio for enabling the X-Engine storage engine, with a range of integers from 10 to 90.

    Note This parameter takes effect only when LooseXEngine is ON.
    50
    StoragePayTypestringNo

    The storage billing type, with valid values as follows:

    • Postpaid: Pay-as-you-go (hourly).
    • Prepaid: Pay-per-use based on space (subscription).
    Prepaid
    StorageAutoScalestringNo

    Whether to enable automatic storage expansion for standard edition clusters, with valid values as follows:

    • Enable: Enables automatic storage expansion.
    • Disable: Disables automatic storage expansion.
    Enable
    StorageUpperBoundlongNo

    Set the upper limit for automatic storage expansion of standard edition clusters, in GB.

    Note The maximum value is 32000.
    800
    ProvisionedIopslongNo

    The provisioned read and write IOPS for ESSD AutoPL cloud disks. Possible values: 0 to min{50,000, 1000*capacity-Baseline Performance}.

    Baseline Performance = min{1,800+50*capacity, 50000}.

    Note This parameter is supported only when StorageType is ESSDAUTOPL.
    1000

    Response parameters

    ParameterTypeDescriptionExample
    object
    DBClusterIdstring

    Cluster ID.

    pc-bp1s826a1up******
    OrderIdstring

    Order ID.

    211454967******
    RequestIdstring

    Request ID.

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

    Resource group ID.

    rg-***************

    Examples

    Sample success responses

    JSONformat

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

    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 changedView Change Details
    2023-10-12The Error code has changedView Change Details
    2023-08-03The Error code has changed. The request parameters of the API has changedView Change Details
    2023-08-01The Error code has changed. The request parameters of the API has changedView Change Details
    2023-06-20The Error code has changed. The request parameters of the API has changedView Change Details
    2023-05-25The Error code has changed. The request parameters of the API has changedView Change Details
    2023-04-19The Error code has changed. The request parameters of the API has changedView Change Details
    2023-03-14The Error code has changed. The request parameters of the API has changedView Change Details
    2022-11-16The Error code has changedView Change Details
    2022-11-02The Error code has changed. The request parameters of the API has changedView Change Details