You need to enable JavaScript to run this app.
导航
RestartDBInstance
最近更新时间:2024.11.05 16:00:05首次发布时间:2023.02.02 17:41:21

调用 RestartDBInstance 接口重启实例。

请求类型

异步请求。

调试

请求参数

参数
类型
是否必选
示例值
描述
InstanceId
String
mysql-e26822cf****
实例 ID。
ApplyScope
String
AllNode

重启场景,取值:

  • AllNode:所有节点。
  • CustomNode:自定义只读节点。
CustomNodeIds
String[]
["mysql-e26822cf****-r90ab","mysql-e26822cf****-r84eb"]

需要重启的节点 ID,多个节点 ID 之间使用英文逗号(,)隔开。

说明

  • ApplyScope 取值为 AllNode 时,不需要传入该参数,表示重启整个实例。
  • ApplyScope 取值为 CustomNode 时,该参数传入需要重启的只读节点 ID。
SwitchType
String
Immediate

变配类型,取值:

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

返回参数

null

示例

请求示例 1

重启整个实例

POST /?Action=RestartDBInstance&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=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****
{
    "InstanceId":"mysql-759174bd****",
    "ApplyScope":"AllNode"
}

返回示例 1

{
    "ResponseMetadata": {
        "RequestId": "2023120413593055A48DA4D95A611CCBDF",
        "Action": "RestartDBInstance",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result": null
}

请求示例 2

重启指定只读节点

POST /?Action=RestartDBInstance&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=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****
{
    "InstanceId":"mysql-759174bd****",
    "ApplyScope":"CustomNode",
    "CustomNodeIds":[
    	"mysql-e26822cf****-r90ab",
    	"mysql-e26822cf****-r84eb"
    ]
}

返回示例 2

{
    "ResponseMetadata" : {
        "RequestId": "2023120413593055A48DA4D95A611CCBDF",
        "Action": "RestartDBInstance",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result":  null
}

请求示例 3

在可维护时间段内重启整个实例

POST /?Action=RestartDBInstance&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=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****
{
    "InstanceId":"mysql-759174bd****",
    "ApplyScope":"AllNode",
    "SwitchType":"MaintainTime"
}

返回示例 3

{
    "ResponseMetadata" : {
        "RequestId": "2023120413593055A48DA4D95A611CCBDF",
        "Action": "RestartDBInstance",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result":  null
}

错误码

更多详情,请参见错误码