You need to enable JavaScript to run this app.
导航
ModifyDBInstanceSpec
最近更新时间:2024.03.21 18:34:51首次发布时间:2023.02.02 17:41:21

调用 ModifyDBInstanceSpec 接口修改实例配置。

请求类型

异步请求。

请求参数

名称类型是否必选示例值描述
InstanceIdStringmysql-e26822cf****实例 ID。

NodeInfo

Array of NodeInfoObject

[
{
"NodeId": "mysql-7d1efb9f****-0",

"NodeType": "Primary",
"NodeSpec": "rds.mysql.1c2g",
"NodeOperateType": "Modify"
},
{
"NodeId": "mysql-7d1efb9f****-1",
"NodeType": "Secondary",
"NodeSpec": "rds.mysql.1c2g",
"NodeOperateType": "Modify"
},
{
"NodeId": "mysql-7d1efb9f****-r****",
"NodeType": "ReadOnly",
"NodeSpec": "rds.mysql.1c2g",
"NodeOperateType": "Delete"
},
{
"NodeType": "ReadOnly",
"NodeSpec": "rds.mysql.1c2g",
"NodeOperateType": "Create"
},
{
"NodeId": "mysql-7d1efb9f****-r****",
"NodeType": "ReadOnly",
"NodeSpec": "rds.mysql.1c2g",
"NodeOperateType": "Modify"
}
]

实例规格配置。主节点和备节点有且只有 1 个,只读节点可选 0~10 个。除新增只读节点场景外,其他场景忽略 ZoneId。更多关于 NodeInfo 信息,请参见数据结构

说明

  • 该参数与 StorageSpace 二者必选其一,且这两个参数可同时修改。
  • 云数据库 MySQL 版支持将主节点、备节点创建在不同可用区,但只读节点必须添加在主节点或备节点的可用区。
ModifyTypeStringUsually实例规格的变更类型。取值为 Usually,常规变配。
StorageTypeStringLocalSSD实例存储类型。当传入 StorageSpace 参数时,该参数必传。取值为 LocalSSD,本地 SSD 盘。

StorageSpace

Integer

100

实例存储空间。取值范围:[20, 3000],单位为 GB,步长为 10GB。默认与当前值相同。

说明

该参数与 NodeInfo 二者必选其一,且这两个参数可同时修改。

SwitchType

String

Immediate

变配类型,取值:

  • Immediate:立即切换(默认)。
  • MaintainTime:可维护时间内进行切换。

返回参数

名称类型示例值描述
InstanceIdStringmysql-7d1efb9f****实例 ID。
OrderIdStringOrder71220115095297****订单 ID。

请求示例

POST /?Action=ModifyDBInstanceSpec&Version=2022-01-01 HTTP/1.1
Content-Type: application/json
Host: rds.volcengineapi.com
X-Date: 20211202T101010Z
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_mysql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c645****

{
    "InstanceId" : "mysql-f4cba23f****",
    "NodeInfo" : [
        {
            "NodeId": "mysql-f4cba23f****-0",
            "NodeType": "Primary",
            "NodeSpec": "rds.mysql.2c4g",
            "NodeOperateType": "Modify"
        },
        {
            "NodeId": "mysql-f4cba23f****-1",
            "NodeType": "Secondary",
            "NodeSpec": "rds.mysql.2c4g",
            "NodeOperateType": "Modify"
        },
        {
            "ZoneId" : "cn-beijing-a",
            "NodeType": "ReadOnly",
            "NodeSpec": "rds.mysql.2c4g",
            "NodeOperateType": "Create"
        }
    ],
    "StorageType":"LocalSSD",
    "StorageSpace":200
}

返回示例

正常返回示例

{
    "ResponseMetadata": {
        "RequestId": "20220719173634010212035227001977AC",
        "Action": "ModifyDBInstanceSpec",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result": {
        "InstanceId": "mysql-f4cba23f****",
        "OrderId": "Order71220115095297****"
    }
}

错误码

更多详情,请参见错误码