查询任务列表
更新时间:2023-03-09
任务列表
接口描述
本接口用于查询任务列表。
请求结构
POST /v1/instance/task HTTP/1.1
Host: rds.bj.baidubce.com
Authorization: authorization string
{
"taskType" : "resize",
"instanceId" : "rds-Z0BbYVD9",
"instanceName" : "mysql57",
"pageNo" : "1",
"pageSize" : "100",
"endTime" : "2023-02-22 23:59:59",
"taskId" : 151,
"taskStatus" : "success"
}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
pageSize | String | 否 | RequestBody参数 | 每页的大小 |
pageNo | String | 否 | RequestBody参数 | 页码 |
instanceId | String | 否 | RequestBody参数 | 实例ID |
instanceName | String | 否 | RequestBody参数 | 实例名称 |
taskId | Integer | 否 | RequestBody参数 | 任务ID |
taskType | String | 否 | RequestBody参数 | 任务类型,可取值:resize/switch/reboot/changeAzone |
taskStatus | String | 否 | RequestBody参数 | 任务状态,可取值:created/running/success/failed/cancelled |
startTime | String | 否 | RequestBody参数 | 任务开始时间 |
endTime | String | 否 | RequestBody参数 | 任务结束时间 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
请求示例
POST http://rds.bj.baidubce.com/v1/instance/task
Host: rds.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"taskType" : "resize",
"instanceId" : "rds-Z0BbYVD9",
"instanceName" : "mysql57",
"pageNo" : "1",
"pageSize" : "100",
"endTime" : "2023-02-22 23:59:59",
"taskId" : 151,
"taskStatus" : "success"
}
响应示例
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Date: Wed, 08 Jul 2015 03:28:11 GMT
x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Server: BWS
{
"tasks": [
{
"taskId": 151,
"taskType": "resize",
"taskName": "配置变更",
"instanceId": "rds-Z0BbYVD9",
"instanceName": "mysql57",
"userId": "3aqr4r57rg677899tsll399401a916b",
"region": "bj",
"taskStatus": "success",
"createTime": "2023-02-22 20:57:22",
"updateTime": "2023-02-22 21:11:05",
"finishTime": "2023-02-22 21:11:01",
"cancelFlag": 0,
"progress": [
{
"step": "resource_prepare",
"status": "success", // created:已创建;running:执行中;success:执行成功;failed:执行失败;cancelled:已取消
"description": "资源准备"
},
{
"step": "initialize_instance",
"status": "success", // created:已创建;running:执行中;success:执行成功;failed:执行失败;cancelled:已取消
"description": "初始化实例"
},
{
"step": "copy_data",
"status": "success", // created:已创建;running:执行中;success:执行成功;failed:执行失败;cancelled:已取消
"description": "导入冷备"
},
{
"step": "sync_binlog",
"status": "success", // created:已创建;running:执行中;success:执行成功;failed:执行失败;cancelled:已取消
"description": "增量日志同步"
},
{
"step": "waitfor_switch",
"status": "success", // created:已创建;running:执行中;success:执行成功;failed:执行失败;cancelled:已取消
"description": "等待切换"
},
{
"step": "execute_switch",
"status": "success", // created:已创建;running:执行中;success:执行成功;failed:执行失败;cancelled:已取消
"description": "执行切换"
},
{
"step": "resize_complete",
"status": "success", // created:已创建;running:执行中;success:执行成功;failed:执行失败;cancelled:已取消
"description": "升级完成"
}
]
}
],
"count": 1
}