查询任务列表
更新时间:2024-12-06
任务列表
接口描述
本接口用于查询任务列表。
请求结构
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": 17022,
"taskType": "resize",
"taskName": "配置变更",
"instanceId": "rds-HzEHy4bE",
"instanceName": "liushan_online_case_monitor",
"userId": "3aa234fe5a77a4399401a916b",
"region": "bj",
"taskStatus": "success",
"createTime": "2024-12-06 14:50:48",
"updateTime": "2024-12-06 14:52:20",
"finishTime": "2024-12-06 14:52:20",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 14:50:49",
"finishTime": "2024-12-06 14:50:51",
"percentage": 100,
"estimateTime": 0
},
{
"step": "prepare_leader_resource",
"status": "success",
"description": "准备主节点资源",
"startTime": "2024-12-06 14:50:51",
"finishTime": "2024-12-06 14:51:24",
"percentage": 100,
"estimateTime": 0
},
{
"step": "wait_timewindow",
"status": "success",
"description": "等待时间窗口",
"startTime": "2024-12-06 14:51:24",
"finishTime": "2024-12-06 14:51:24",
"percentage": 100,
"estimateTime": 0
},
{
"step": "execute_switchover",
"status": "success",
"description": "执行切换",
"startTime": "2024-12-06 14:51:24",
"finishTime": "2024-12-06 14:51:40",
"percentage": 100,
"estimateTime": 0
},
{
"step": "prepare_follower_resource",
"status": "success",
"description": "准备备节点资源",
"startTime": "2024-12-06 14:51:40",
"finishTime": "2024-12-06 14:52:19",
"percentage": 100,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "success",
"description": "完成任务",
"startTime": "2024-12-06 14:52:19",
"finishTime": "2024-12-06 14:52:20",
"percentage": 100,
"estimateTime": 0
}
]
},
{
"taskId": 17021,
"taskType": "resize",
"taskName": "配置变更",
"instanceId": "rds-dnc5ybIB",
"instanceName": "qa_openapi_read",
"userId": "3aa23ba0fe5a77a4399401a916b",
"region": "bj",
"taskStatus": "success",
"createTime": "2024-12-06 14:36:17",
"updateTime": "2024-12-06 14:47:22",
"finishTime": "2024-12-06 14:47:22",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 14:36:19",
"finishTime": "2024-12-06 14:36:20",
"percentage": 100,
"estimateTime": 0
},
{
"step": "prepare_resource",
"status": "success",
"description": "准备资源",
"startTime": "2024-12-06 14:36:20",
"finishTime": "2024-12-06 14:39:14",
"percentage": 100,
"estimateTime": 0
},
{
"step": "sync_data",
"status": "success",
"description": "同步数据",
"startTime": "2024-12-06 14:39:14",
"finishTime": "2024-12-06 14:47:15",
"percentage": 100,
"estimateTime": 0
},
{
"step": "wait_timewindow",
"status": "success",
"description": "等待时间窗口",
"startTime": "2024-12-06 14:47:15",
"finishTime": "2024-12-06 14:47:16",
"percentage": 100,
"estimateTime": 0
},
{
"step": "execute_switchover",
"status": "success",
"description": "执行切换",
"startTime": "2024-12-06 14:47:16",
"finishTime": "2024-12-06 14:47:22",
"percentage": 100,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "success",
"description": "完成任务",
"startTime": "2024-12-06 14:47:22",
"finishTime": "2024-12-06 14:47:22",
"percentage": 100,
"estimateTime": 0
}
]
},
{
"taskId": 17020,
"taskType": "switch",
"taskName": "主备切换",
"instanceId": "rds-HzEHy4bE",
"instanceName": "liushan_online_case_monitor",
"userId": "3aa2334fe5a77a4399401a916b",
"region": "bj",
"taskStatus": "success",
"createTime": "2024-12-06 14:35:24",
"updateTime": "2024-12-06 14:35:39",
"finishTime": "2024-12-06 14:35:39",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 14:35:26",
"finishTime": "2024-12-06 14:35:26",
"percentage": 100,
"estimateTime": 0
},
{
"step": "wait_timewindow",
"status": "success",
"description": "等待时间窗口",
"startTime": "2024-12-06 14:35:26",
"finishTime": "2024-12-06 14:35:26",
"percentage": 100,
"estimateTime": 0
},
{
"step": "switch_precheck",
"status": "success",
"description": "切换前置检查",
"startTime": "2024-12-06 14:35:26",
"finishTime": "2024-12-06 14:35:30",
"percentage": 100,
"estimateTime": 0
},
{
"step": "execute_switchover",
"status": "success",
"description": "执行切换",
"startTime": "2024-12-06 14:35:30",
"finishTime": "2024-12-06 14:35:39",
"percentage": 100,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "success",
"description": "完成任务",
"startTime": "2024-12-06 14:35:39",
"finishTime": "2024-12-06 14:35:39",
"percentage": 100,
"estimateTime": 0
}
]
},
{
"taskId": 17013,
"taskType": "resize",
"taskName": "配置变更",
"instanceId": "rds-HzEHy4bE",
"instanceName": "liushan_online_case_monitor",
"userId": "3aa23ba0d873a77a4399401a916b",
"region": "bj",
"taskStatus": "success",
"createTime": "2024-12-06 14:01:37",
"updateTime": "2024-12-06 14:18:50",
"finishTime": "2024-12-06 14:18:50",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 14:04:49",
"finishTime": "2024-12-06 14:04:49",
"percentage": 100,
"estimateTime": 0
},
{
"step": "prepare_resource",
"status": "success",
"description": "准备资源",
"startTime": "2024-12-06 14:04:49",
"finishTime": "2024-12-06 14:07:27",
"percentage": 100,
"estimateTime": 0
},
{
"step": "sync_data",
"status": "success",
"description": "同步数据",
"startTime": "2024-12-06 14:07:27",
"finishTime": "2024-12-06 14:18:30",
"percentage": 100,
"estimateTime": 0
},
{
"step": "wait_timewindow",
"status": "success",
"description": "等待时间窗口",
"startTime": "2024-12-06 14:18:30",
"finishTime": "2024-12-06 14:18:30",
"percentage": 100,
"estimateTime": 0
},
{
"step": "execute_switchover",
"status": "success",
"description": "执行切换",
"startTime": "2024-12-06 14:18:30",
"finishTime": "2024-12-06 14:18:49",
"percentage": 100,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "success",
"description": "完成任务",
"startTime": "2024-12-06 14:18:49",
"finishTime": "2024-12-06 14:18:50",
"percentage": 100,
"estimateTime": 0
}
]
},
{
"taskId": 17011,
"taskType": "reboot",
"taskName": "原地重启实例",
"instanceId": "",
"instanceName": "liushan_online_case_monitor",
"userId": "3aa23ba34fe5a77a4399401a916b",
"region": "bj",
"taskStatus": "success",
"createTime": "2024-12-06 13:50:52",
"updateTime": "2024-12-06 13:51:20",
"finishTime": "2024-12-06 13:51:20",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 13:50:53",
"finishTime": "2024-12-06 13:50:53",
"percentage": 100,
"estimateTime": 0
},
{
"step": "wait_timewindow",
"status": "success",
"description": "等待时间窗口",
"startTime": "2024-12-06 13:50:53",
"finishTime": "2024-12-06 13:50:53",
"percentage": 100,
"estimateTime": 0
},
{
"step": "restart_master",
"status": "success",
"description": "重启主库",
"startTime": "2024-12-06 13:50:53",
"finishTime": "2024-12-06 13:51:09",
"percentage": 100,
"estimateTime": 0
},
{
"step": "restart_backup",
"status": "success",
"description": "重启备库",
"startTime": "2024-12-06 13:51:09",
"finishTime": "2024-12-06 13:51:19",
"percentage": 100,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "success",
"description": "完成任务",
"startTime": "2024-12-06 13:51:19",
"finishTime": "2024-12-06 13:51:20",
"percentage": 100,
"estimateTime": 0
}
]
},
{
"taskId": 16932,
"taskType": "resize",
"taskName": "配置变更",
"instanceId": "rds-R2yXwGGP",
"instanceName": "qa_openapi_read",
"userId": "3aa23ba0d8734fe5a77a4399916b",
"region": "bj",
"taskStatus": "running",
"createTime": "2024-12-06 02:41:17",
"updateTime": "2024-12-06 02:42:32",
"finishTime": "0000-00-00 00:00:00",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 02:41:19",
"finishTime": "2024-12-06 02:41:19",
"percentage": 100,
"estimateTime": 0
},
{
"step": "prepare_resource",
"status": "running",
"description": "准备资源",
"startTime": "2024-12-06 02:41:19",
"percentage": 99,
"estimateTime": 300
},
{
"step": "sync_data",
"status": "created",
"description": "同步数据",
"percentage": 0,
"estimateTime": 0
},
{
"step": "wait_timewindow",
"status": "created",
"description": "等待时间窗口",
"percentage": 0,
"estimateTime": 0
},
{
"step": "execute_switchover",
"status": "created",
"description": "执行切换",
"percentage": 0,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "created",
"description": "完成任务",
"percentage": 0,
"estimateTime": 0
}
]
},
{
"taskId": 16931,
"taskType": "resize",
"taskName": "配置变更",
"instanceId": "rds-lExcWNwX",
"instanceName": "liushan_online_case_monitor",
"userId": "3aa23ba0d87347a4399401a916b",
"region": "bj",
"taskStatus": "running",
"createTime": "2024-12-06 02:41:17",
"updateTime": "2024-12-06 02:49:59",
"finishTime": "0000-00-00 00:00:00",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 02:41:19",
"finishTime": "2024-12-06 02:41:19",
"percentage": 100,
"estimateTime": 0
},
{
"step": "prepare_resource_and_sync_data",
"status": "running",
"description": "准备资源并同步数据",
"startTime": "2024-12-06 02:41:19",
"percentage": 99,
"estimateTime": 600
},
{
"step": "wait_timewindow",
"status": "created",
"description": "等待时间窗口",
"percentage": 0,
"estimateTime": 0
},
{
"step": "execute_switchover",
"status": "created",
"description": "执行切换",
"percentage": 0,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "created",
"description": "完成任务",
"percentage": 0,
"estimateTime": 0
}
]
},
{
"taskId": 16930,
"taskType": "changeAzone",
"taskName": "迁移可用区",
"instanceId": "rds-lExcWNwX",
"instanceName": "liushan_online_case_monitor",
"userId": "3aa23b34fe5a77a4399401a916b",
"region": "bj",
"taskStatus": "success",
"createTime": "2024-12-06 02:34:23",
"updateTime": "2024-12-06 02:40:52",
"finishTime": "2024-12-06 02:40:52",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 02:34:24",
"finishTime": "2024-12-06 02:34:25",
"percentage": 100,
"estimateTime": 0
},
{
"step": "prepare_resource",
"status": "success",
"description": "准备资源",
"startTime": "2024-12-06 02:34:25",
"finishTime": "2024-12-06 02:36:25",
"percentage": 100,
"estimateTime": 0
},
{
"step": "sync_data",
"status": "success",
"description": "同步数据",
"startTime": "2024-12-06 02:36:25",
"finishTime": "2024-12-06 02:40:26",
"percentage": 100,
"estimateTime": 0
},
{
"step": "wait_timewindow",
"status": "success",
"description": "等待时间窗口",
"startTime": "2024-12-06 02:40:26",
"finishTime": "2024-12-06 02:40:26",
"percentage": 100,
"estimateTime": 0
},
{
"step": "execute_switchover",
"status": "success",
"description": "执行切换",
"startTime": "2024-12-06 02:40:26",
"finishTime": "2024-12-06 02:40:39",
"percentage": 100,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "success",
"description": "完成任务",
"startTime": "2024-12-06 02:40:39",
"finishTime": "2024-12-06 02:40:52",
"percentage": 100,
"estimateTime": 0
}
]
},
{
"taskId": 16929,
"taskType": "reboot_switchover",
"taskName": "切换重启实例",
"instanceId": "rds-lExcWNwX",
"instanceName": "liushan_online_case_monitor",
"userId": "3aa23ba0d8e5a77a4399401a916b",
"region": "bj",
"taskStatus": "success",
"createTime": "2024-12-06 02:33:48",
"updateTime": "2024-12-06 02:34:13",
"finishTime": "2024-12-06 02:34:13",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 02:33:48",
"finishTime": "2024-12-06 02:33:48",
"percentage": 100,
"estimateTime": 0
},
{
"step": "wait_timewindow",
"status": "success",
"description": "等待时间窗口",
"startTime": "2024-12-06 02:33:48",
"finishTime": "2024-12-06 02:33:49",
"percentage": 100,
"estimateTime": 0
},
{
"step": "instance_precheck",
"status": "success",
"description": "实例状态检查",
"startTime": "2024-12-06 02:33:49",
"finishTime": "2024-12-06 02:33:49",
"percentage": 100,
"estimateTime": 0
},
{
"step": "restart_backup",
"status": "success",
"description": "重启备库",
"startTime": "2024-12-06 02:33:49",
"finishTime": "2024-12-06 02:34:01",
"percentage": 100,
"estimateTime": 0
},
{
"step": "execute_switchover",
"status": "success",
"description": "执行切换",
"startTime": "2024-12-06 02:34:01",
"finishTime": "2024-12-06 02:34:07",
"percentage": 100,
"estimateTime": 0
},
{
"step": "restart_master",
"status": "success",
"description": "重启主库",
"startTime": "2024-12-06 02:34:07",
"finishTime": "2024-12-06 02:34:12",
"percentage": 100,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "success",
"description": "完成任务",
"startTime": "2024-12-06 02:34:12",
"finishTime": "2024-12-06 02:34:13",
"percentage": 100,
"estimateTime": 0
}
]
},
{
"taskId": 16928,
"taskType": "resize",
"taskName": "配置变更",
"instanceId": "rds-R2yXwGGP",
"instanceName": "qa_openapi_read",
"userId": "3aa23ba0d8734fe5399401a916b",
"region": "bj",
"taskStatus": "success",
"createTime": "2024-12-06 02:12:35",
"updateTime": "2024-12-06 02:33:17",
"finishTime": "2024-12-06 02:33:17",
"cancelFlag": 0,
"progress": [
{
"step": "initialize_task",
"status": "success",
"description": "初始化任务",
"startTime": "2024-12-06 02:12:36",
"finishTime": "2024-12-06 02:12:37",
"percentage": 100,
"estimateTime": 0
},
{
"step": "prepare_resource",
"status": "success",
"description": "准备资源",
"startTime": "2024-12-06 02:12:37",
"finishTime": "2024-12-06 02:23:41",
"percentage": 100,
"estimateTime": 0
},
{
"step": "sync_data",
"status": "success",
"description": "同步数据",
"startTime": "2024-12-06 02:23:41",
"finishTime": "2024-12-06 02:32:43",
"percentage": 100,
"estimateTime": 0
},
{
"step": "wait_timewindow",
"status": "success",
"description": "等待时间窗口",
"startTime": "2024-12-06 02:32:43",
"finishTime": "2024-12-06 02:32:43",
"percentage": 100,
"estimateTime": 0
},
{
"step": "execute_switchover",
"status": "success",
"description": "执行切换",
"startTime": "2024-12-06 02:32:43",
"finishTime": "2024-12-06 02:32:50",
"percentage": 100,
"estimateTime": 0
},
{
"step": "finish_task",
"status": "success",
"description": "完成任务",
"startTime": "2024-12-06 02:32:50",
"finishTime": "2024-12-06 02:33:17",
"percentage": 100,
"estimateTime": 0
}
]
}
],
"count": 38
}