tencent cloud

TDSQL-C MySQL 版

CreateClusters

下载
聚焦模式
字号
最后更新时间: 2026-10-28 10:18:39

1. API Description

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

This API is used to create a cluster.

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

  • MYSQL: MYSQL
DbVersion Yes String

Database version

Enumeration values:

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

Project ID.

Cpu No Integer

Required when DbMode is NORMAL or left empty
Number of Cpu cores of a NORMAL instance

Memory No Integer

Required when DbMode is NORMAL or not specified
Normal instance memory in GB

InstanceCount No Integer

Instance count

Value range: [1, 16]

Default value: 2

  • A value of 2 means one rw instance + one ro instance.
  • The transmitted n means 1 rw instance + n-1 ro instances (identical specifications).
  • If you need a more precise cluster composition, please use InstanceInitInfos.
  • The value set by this parameter is applicable to provisioned resource clusters. To set the specifications and quantity of instances in a 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 can be an uppercase/lowercase letter, digit, or special symbol ('-', '_', '.')

AdminPassword No String

Account password (8-64 characters, containing any three of the following: uppercase and lowercase letters, digits, and symbols ~!@#$%^&*_-+=`|(){}[]:;'<>,.?/)

Port No Integer

Port. Default value: 3306. Value range: [0, 65535)

PayMode No Integer

Billing mode

Enumeration values:

  • 0: pay-as-you-go
  • 1: yearly/monthly subscription

Default value: 0

Count No Integer

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

RollbackStrategy No String

Rollback type

Enumeration values:

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

Snapshot rollback refers to snapshotId; point-in-time rollback refers to queryId. If it is 0, you need to determine whether the time point is valid.

OriginalClusterId No String

During rollback, import 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 the specified time

StorageLimit No Integer

Storage limit of a regular instance, in GB
When DbType is MYSQL and the storage billing mode is prepaid, this parameter cannot exceed the maximum storage specification corresponding to the cpu and memory

TimeSpan No Integer

Annual and monthly subscription duration

TimeUnit No String

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

AutoRenewFlag No Integer

Whether Annual/Monthly Subscription is auto-renewed

Enumeration values:

  • 0: default renewal method
  • 1: auto-renewal
  • 2: no auto-renewal

Default value: 0

AutoVoucher No Integer

Whether to automatically select a voucher. 1: Yes; 0: No. Default is 0.

Enumeration values:

  • 1: Yes
  • 0: No

Default value: 0

HaCount No Integer

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

OrderSource No String

Order Source

ResourceTags.N No Array of Tag

tag array information that needs to be bound for cluster creation

DbMode No String

DB type

Enumeration values:

  • 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 cpu value. For the optional range, see the API return of DescribeServerlessInstanceSpecs

MaxCpu No Float

Required when DbMode is SERVERLESS:
maximum value of cpu. For the optional range, see the API return of DescribeServerlessInstanceSpecs

AutoPause No String

Whether to auto pause

Enumeration values:

  • yes: Yes
  • no: No

Default value: yes

Takes 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

Cluster storage billing mode. Pay-as-you-go: 0; monthly subscription: 1. Default is pay-as-you-go.
When DbType is MYSQL and the cluster compute billing mode is postpaid (including when DbMode is 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. It temporarily supports character_set_server (utf8 | latin1 | gbk | utf8mb4) and lower_case_table_names. 1: not case-sensitive; 0: case-sensitive.

DealMode No Integer

Transaction mode

Enumeration values:

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

Default value: 0

ParamTemplateId No Integer

Parameter template ID, which can be obtained by querying parameter template information through DescribeParamTemplates.

SlaveZone No String

Multi-AZ address

InstanceInitInfos.N No Array of InstanceInitInfo

Instance initialization configuration information, primarily used for selecting different specification instances during cluster purchase.

GdnId No String

Global database unique ID

ProxyConfig No ProxyConfig

Database proxy configuration

AutoArchive No String

Whether to automatically archive

Enumeration values:

  • 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

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, nullable. For example, P0, P1. (This field can be ignored.)

CynosVersion No String

Kernel minor version number.

SyncWay No String

Synchronization method. Available values: async, semisync, sync.

SemiSyncTimeout No Integer

Semi-sync timeout period, in milliseconds. To ensure business stability, semi-sync replication has a degradation logic. When the primary availability zone cluster waits for the standby availability zone cluster to confirm a transaction, if the timeout period is exceeded, the replication method will degrade to asynchronous replication.

Value range: [1000, 4294967295]

Unit: ms

Default value: 10000

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 to query the DescribeResourcesByDealName API to get the cluster ID)

BigDealIds Array of String

Large order number

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 Creating a Cluster

Input Example

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

{
    "Zone": "ap-guangzhou-5",
    "VpcId": "0",
    "SubnetId": "0",
    "DbType": "MYSQL",
    "DbVersion": "8.0",
    "Cpu": 1,
    "Memory": 1,
    "InstanceCount": 1
}

Output Example

{
    "Response": {
        "BigDealIds": [],
        "ClusterIds": [
            "cynosdbmysql-********"
        ],
        "DealNames": [
            "2026*****************11"
        ],
        "RequestId": "7e55656e-37c6-44fe-9f81-34eafa652820",
        "ResourceIds": [
            "cynosdbmysql-ins-********"
        ],
        "TranId": "2026061198**5**9*8*****"
    }
}

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 and pay the order.
FailedOperation.InsufficientBalance Insufficient account balance.
FailedOperation.OperationFailedError Operation failed. Try again later. If the issue persists, contact customer service.
FailedOperation.QuerySpecBySpecCodeError Specification information query failed.
FailedOperation.TradeCreateOrderError Failed to create and pay for the order. Try again later. If the issue persists, contact customer service.
InternalError.DbOperationFailed Query database failed.
InternalError.GetSubnetFailed Failed to obtain the subnet.
InternalError.GetVpcFailed Failed to get the VPC.
InternalError.InternalHttpServerError http request execution error.
InternalError.UnknownError Unknown internal error.
InvalidParameterValue.DBTypeNotFound Unsupported instance type.
InvalidParameterValue.IllegalPassword The password does not meet requirements.
InvalidParameterValue.InvalidDBVersion Invalid instance version.
InvalidParameterValue.InvalidParameterValueError Parameter value is invalid.
InvalidParameterValue.InvalidSpec Invalid instance specification.
InvalidParameterValue.InvalidZoneIdError Invalid AZ.
InvalidParameterValue.ProjectIdNotFound ProjectId not found
InvalidParameterValue.RegionZoneUnavailable The selected region and availability zone are unavailable.
InvalidParameterValue.SubnetNotFound Subnet not found.
InvalidParameterValue.VpcNotFound The selected VPC network is not found.
LimitExceeded.UserInstanceLimit Number of user instances exceeds the limit.
OperationDenied.CynosdbVersionNotSupportError Unsupported for instance kernel version {{1}}
OperationDenied.DisableNewStorageMultiZoneDeploymentError Multi-AZ deployment for the new storage architecture is not yet available.
OperationDenied.InsufficientBalanceError Insufficient account balance.
OperationDenied.NewStorageOnlySupport80Error Storage compression is only supported in storage architecture 2.0 for v8.0.
OperationDenied.OnlyNewStorageSupportStorageCompressionError Only storage architecture 2.0 supports the storage compression feature.
OperationDenied.UserNotAuthenticatedError User not verified with real-name authentication. Please proceed with real-name authentication before purchase.
UnauthorizedOperation.NotRealNameAccount Non-verified users are prohibited from purchasing.
UnauthorizedOperation.PermissionDenied CAM authentication failed.

帮助和支持

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

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

文档反馈