tencent cloud

TDSQL-C MySQL 版

CreateClusters

下载
聚焦模式
字号
最后更新时间: 2026-05-29 10:55:53

1. API Description

Domain name for API request: cynosdb.intl.tencentcloudapi.com.

This API is used to purchase new clusters.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateClusters.
Version Yes String Common Params. The value used for this API: 2019-01-07.
Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo.
Zone Yes String

AZ.

VpcId Yes String

VPC network ID

SubnetId Yes String

Subnet ID

DbType Yes String

Database type

Enumeration value:

  • MYSQL: MYSQL
DbVersion Yes String

Database version

Enumeration value:

  • 5.7: MySQL 5.7 edition
  • 8.0: MySQL 8.0 edition
ProjectId No Integer

project-ID

Cpu No Integer

Required when DbMode is NORMAL or left blank
Cpu cores of the regular instance

Memory No Integer

Required when DbMode is NORMAL or left blank
Ordinary instance memory in GB

InstanceCount No Integer

Instance count

Value ranges from [1, 16]

Default value: 2

  • A value of 2 means one rw instance + one ro instance.
  • The transmitted n refers to one rw instance + n-1 ro instances (identical specifications).
  • For a more precise cluster composition collocation, please use InstanceInitInfos.
  • The value set by this parameter is suitable for provisioned resource cluster. If needed to set the specifications and quantity of Serverless cluster, please use the InstanceInitInfo structure in InstanceInitInfos.n.
Storage No Integer

This parameter is meaningless and abandoned.
Storage size, in GB.

ClusterName No String

Cluster name, length less than 64 characters, each character value ranges from uppercase/lowercase letters, digits, special symbols ('-', '_', '.')

AdminPassword No String

Account (8-64 characters, a combination of uppercase and lowercase letters, digits and symbols ~!@#$%^&*_-+=`

Port No Integer

Port, default 3306, in the range of [0, 65535)

PayMode No Integer

Billing mode

Enumeration value:

  • 0: Pay-as-you-go billing
  • 1: Monthly Subscription

Default value: 0

Count No Integer

Number of clusters to purchase. Optional value range: [1,50]. Default is 1.

RollbackStrategy No String

Rollback type

Enumeration value:

  • noneRollback: No rollback
  • snapRollback: Snapshot rollback
  • timeRollback: Point-in-time rollback
RollbackId No Integer

Snapshot rollback means snapshotId; point-in-time rollback means queryId. A value of 0 indicates requirement to judge whether the time point is valid.

OriginalClusterId No String

During rollback, input the source cluster ID to search for the source poolId

ExpectTime No String

Point-in-time rollback, specified time; snapshot rollback, snapshot time

ExpectTimeThresh No Integer

This parameter is meaningless and abandoned.
Point-in-time rollback, allowed range of specified time.

StorageLimit No Integer

Ordinary instance storage cap, in GB
When DbType is MYSQL and the storage billing mode is prepaid, this parameter should not exceed the maximum storage specification corresponding to cpu and memory.

TimeSpan No Integer

Annual and monthly subscription duration

TimeUnit No String

Annual and monthly subscription duration unit, ['s', 'd', 'm', 'y']

AutoRenewFlag No Integer

Whether Annual/Monthly Subscription is auto-renewed

Enumeration value:

  • 0: Default renewal method
  • 1: Auto-renewal
  • 2: No auto-renewal

Default value: 0

AutoVoucher No Integer

Whether to automatically select voucher 1 Yes 0 No Default value: 0

Enumeration value:

  • 1: Yes
  • 0: No

Default value: 0

HaCount No Integer

Instance count (this parameter is deprecated and only for existing accommodative)

OrderSource No String

Order source

ResourceTags.N No Array of Tag

tag Array info that should be bound for cluster creation

DbMode No String

Db type

Enumeration value:

  • NORMAL: NORMAL instance
  • SERVERLESS: SERVERLESS instance

Default value: NORMAL

Selectable when DbType is MYSQL (default NORMAL)

MinCpu No Float

Required when DbMode is SERVERLESS
Minimum value of cpu. For optional range, see API response of DescribeServerlessInstanceSpecs

MaxCpu No Float

Required when DbMode is SERVERLESS:
Maximum value of cpu. For optional range, see API response of DescribeServerlessInstanceSpecs.

AutoPause No String

No auto pause

Enumeration value:

  • yes: Yes
  • no: No

Default value: yes

Take effect when DbMode is SERVERLESS

AutoPauseDelay No Integer

When DbMode is SERVERLESS, specify the delay for Cluster Auto-Pause in seconds. Optional range: [600,691200]
Default value: 600

StoragePayMode No Integer

The storage billing mode of the cluster. Pay-As-You-Go: 0, Monthly Subscription: 1. Default is Pay-As-You-Go.
When DbType is MYSQL and the compute billing mode of the cluster is postpaid (including DbMode as SERVERLESS), the storage billing mode can only be Pay-As-You-Go.
Rollback and clone do not support Monthly Subscription storage.

SecurityGroupIds.N No Array of String

Security group id array

AlarmPolicyIds.N No Array of String

Alarm policy Id array

ClusterParams.N No Array of ParamItem

Parameter array, temporarily supports character_set_server (utf8

DealMode No Integer

Transaction mode

Enumeration value:

  • 0: Place order and pay
  • 1: Place order

Default value: 0

ParamTemplateId No Integer

Parameter template ID. The parameter template ID can be obtained through querying parameter template information DescribeParamTemplates.

SlaveZone No String

Multi-AZ address

InstanceInitInfos.N No Array of InstanceInitInfo

Instance initialization configuration information is mainly used to select different specification instances during cluster purchase.

GdnId No String

Global database unique ID

ProxyConfig No ProxyConfig

Database proxy configuration

AutoArchive No String

Auto archive or not

Enumeration value:

  • yes: Yes
  • no: No

Default value: no

This parameter takes effect only when the primary instance of the current cluster is SERVERLESS

AutoArchiveDelayHours No Integer

Archiving processing time after pausing

Measurement unit: hour

Default value: 12

This parameter takes effect only when the primary instance of the current cluster is SERVERLESS.

ClusterLevel No String

Cluster level, optional. Example: P0, P1. (This field can be ignored)

CynosVersion No String

Kernel minor version

3. Output Parameters

Parameter Name Type Description
TranId String

Frozen transaction ID

DealNames Array of String

Order ID

ResourceIds Array of String

Resource ID list (This field is no longer maintained. Please use the dealNames field to query the API DescribeResourcesByDealName to obtain resource IDs)

ClusterIds Array of String

Cluster ID list (This field is no longer maintained. Please use the dealNames field and the query API DescribeResourcesByDealName to get the cluster ID)

BigDealIds Array of String

Large Order ID


Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Purchase a New Cluster

Purchase a new cluster

Input Example

POST / HTTP/1.1
Host: cynosdb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateClusters
<Common request parameters>

{
    "Count": 1,
    "StoragePayMode": 0,
    "VpcId": "vpc-1ptuei0b",
    "Zone": "ap-guangzhou-3",
    "AdminPassword": "passwd@admin",
    "DbType": "MYSQL",
    "ProjectId": 0,
    "DbVersion": "10.0",
    "Storage": 100,
    "PayMode": 0,
    "ClusterName": "newInstance",
    "StorageLimit": 100,
    "RollbackStrategy": "noneRollback",
    "Memory": 4,
    "SubnetId": "subnet-1tmw9t4o",
    "Cpu": 2,
    "HaCount": 1
}

Output Example

{
    "Response": {
        "ResourceIds": [
            "cynosdbmysql-ins-67rmucgk"
        ],
        "RequestId": "132075",
        "TranId": "20190522160000003106844584180998",
        "ClusterIds": [
            "cynosdbmysql-sls-9nts65r2"
        ],
        "BigDealIds": [
            "142759"
        ],
        "DealNames": [
            "20190522112283"
        ]
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.CreateOrder Failed to create the order and make a payment.
FailedOperation.InsufficientBalance Insufficient account balance
FailedOperation.OperationFailedError Operation failed. Try again later. If the problem persists, contact customer service.
FailedOperation.QuerySpecBySpecCodeError Failed to query specifications.
FailedOperation.TradeCreateOrderError Failed to create the order and make a payment. Please try again later. If the problem persists, please contact customer service.
InternalError.DbOperationFailed Failed to query the database.
InternalError.GetSubnetFailed Failed to get the subnet.
InternalError.GetVpcFailed Failed to get the VPC.
InternalError.InternalHttpServerError An exception occurred while executing the HTTP request.
InternalError.UnknownError Unknown internal error.
InvalidParameterValue.DBTypeNotFound Unsupported instance type.
InvalidParameterValue.IllegalPassword The password does not meet the requirement.
InvalidParameterValue.InvalidDBVersion Invalid instance version.
InvalidParameterValue.InvalidParameterValueError Invalid parameter value.
InvalidParameterValue.InvalidSpec Invalid instance specification.
InvalidParameterValue.InvalidZoneIdError Invalid AZ
InvalidParameterValue.ProjectIdNotFound The ProjectId was not found.
InvalidParameterValue.RegionZoneUnavailable The selected region and AZ are unavailable.
InvalidParameterValue.SubnetNotFound The selected subnet could not be found.
InvalidParameterValue.VpcNotFound The selected VPC could not be found.
LimitExceeded.UserInstanceLimit The number of instances exceeds the limit.
OperationDenied.CynosdbVersionNotSupportError Kernel version not supported for the instance
OperationDenied.DisableNewStorageMultiZoneDeploymentError Multi-AZ deployment functionality for the new storage architecture is not yet available.
OperationDenied.InsufficientBalanceError Insufficient account balance.
OperationDenied.NewStorageOnlySupport80Error New storage architecture 2.0 only supports 8.0
OperationDenied.OnlyNewStorageSupportStorageCompressionError Only Storage Architecture 2.0 supports the compression feature
OperationDenied.UserNotAuthenticatedError You need to verify your identity to make a purchase.
UnauthorizedOperation.NotRealNameAccount Users who haven't completed identity verification can’t make purchases.
UnauthorizedOperation.PermissionDenied CAM authentication failed.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈