tencent cloud

APIs

ModifyDBInstance

下载
聚焦模式
字号
最后更新时间: 2026-11-09 16:18:59

1. API Description

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

This API is used to modify instance configurations. It combines the ability to vertically and horizontally modify instances, and supports composite modifications of CPU, memory, disk, number of nodes, availability zone, and storage type. It supports DryRun precheck mode, allowing you to obtain the modification plan without actual execution.

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: ModifyDBInstance.
Version Yes String Common Params. The value used for this API: 2021-11-22.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
InstanceId Yes String

Instance ID.

DryRun Yes Boolean

Whether to only perform pre-check without actually executing the configuration change. true: only return the configuration change plan and pre-check result; false: actually execute the configuration change (default)

HybridNodeCpu No Integer

Number of CPU cores of peer nodes. If not passed, maintain current value unchanged

HybridNodeMem No Integer

Peer-to-peer node memory size in GB. If not passed, maintain current value unchanged

HybridNodeNum No Integer

Number of peer nodes. If not passed, maintain current value unchanged

Disk No Integer

Peer-to-peer node disk capacity in GB. If not passed, maintain current value unchanged

StorageType No String

Storage type. Available values: CLOUD_HSSD (enhanced SSD cloud disk), CLOUD_TCS (local disk), CLOUD_BSSD (universal SSD cloud disk). If not specified, the current value remains unchanged.

SpecCode No String

Specification code, for example, 4c8g, 16c32g

Zones.N No Array of String

Target AZ list. If not passed, maintain current value unchanged

AZMode No Integer

Availability zone mode. 1: single availability zone. 3: multi-availability zone primary AZ mode

PrimaryAZ No String

Primary AZ. This parameter is valid only when AZMode is 3

FullReplications No Integer

Number of replicas, value ranges from 1 to 3

3. Output Parameters

Parameter Name Type Description
FlowId Integer

Asynchronous task ID, returned when DryRun=false. You can call the Query Task API with this ID to get task status.

DealName String

Order number, returned in prepaid scenarios

IsInPlaceModification Boolean

Whether to perform in-place configuration changes. Returned when DryRun=true.

IsMigrateModification Boolean

Whether to perform configuration adjustment. Returned when DryRun=true

ModifyPlan String

Configuration change plan description. Returned when DryRun=true, describing the sub-process orchestration to be executed

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 Vertical Scaling

Input Example

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

{
    "InstanceId": "tdsql3-7d3ymevo4z",
    "DryRun": false,
    "HybridNodeCpu": 2,
    "HybridNodeMem": 4,
    "HybridNodeNum": 3,
    "Disk": 30,
    "SpecCode": "2c4g"
}

Output Example

{
    "Response": {
        "FlowId": 110149,
        "RequestId": "2340d9d0-5e20-46a6-8078-eece8d2d46a0"
    }
}

Example2 Pre-check the configuration change plan (DryRun mode)

Pre-check the configuration adjustment plan without executing it, and return the configuration adjustment method and sub-process orchestration description.

Input Example

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

{
    "InstanceId": "tdsql3-ecab00ac",
    "HybridNodeCpu": 16,
    "HybridNodeMem": 32,
    "Disk": 8000,
    "HybridNodeNum": 20,
    "DryRun": true
}

Output Example

{
    "Response": {
        "IsInPlaceModification": false,
        "IsMigrateModification": true,
"ModifyPlan": "Vertical configuration change: specification 4c8g -> 16c32g, Disk 500GB -> 8000GB; Horizontal configuration change: number of nodes 6 -> 20"
        "RequestId": "5b104d05-7e16-4869-87fe-dbd2e8f30b70"
    }
}

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
AuthFailure.CamAuthError CAM authentication error.
AuthFailure.CheckCamAuthError CAM authentication request parameter check failed.
AuthFailure.UnauthorizedOperation CAM authentication failed.
FailedOperation.BillingError Billing call error.
FailedOperation.CheckSpecError FailedOperation.CheckSpecError
FailedOperation.UpgradeInstanceError Instance vertical scale-out failed.
LimitExceeded.OutOfSpecLimitError The specification exceeds the limit.
OperationDenied.InstanceOperationNotAllowedError This operation is not supported for the instance currently.
OperationDenied.InstanceStatusError Incorrect instance status.
OperationDenied.InstanceTypeCheckError OperationDenied.InstanceTypeCheckError

帮助和支持

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

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

文档反馈