查询租户任务列表
功能介绍
查询租户任务列表,可以根据引擎类型,网络类型,任务状态,任务名称,任务ID进行查询。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
POST /v3/{project_id}/jobs
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
租户在某一Region下的Project ID。 获取方法请参见获取项目ID。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
Content-Type |
是 |
String |
指定类型为application/json。 缺省值:application/json。 |
X-Auth-Token |
是 |
String |
从IAM服务获取的用户Token。 |
X-Language |
否 |
String |
请求语言类型。 缺省值:en-us 取值:
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
cur_page |
是 |
Integer |
当前页,填0获取全部item。当per_page填0时,cur_page只能填0或者1。 缺省值:1 |
per_page |
是 |
Integer |
每页记录数。填0时,cur_page只能填0或者1。
|
db_use_type |
是 |
String |
迁移场景。migration:实时迁移;sync:实时同步;cloudDataGuard:实时灾备。 取值:
|
engine_type |
否 |
String |
DRS任务引擎类型。 缺省值:mysql 取值:
详细取值可参考引擎类型说明。 |
enterprise_project_id |
否 |
String |
企业项目,不传值的话,设置为null,不能设置为空字符串。当企业项目开关打开时,可以传值。 |
name |
否 |
String |
Name或ID。支持传入多个任务ID,逗号分隔,最多100个。 |
net_type |
否 |
String |
网络类型。取值:
|
service_name |
否 |
String |
服务名称。 |
status |
否 |
String |
任务状态。
枚举值:
|
tags |
否 |
Map<String,String> |
标签。 详情请参见表7。 |
instance_ids |
否 |
Array of strings |
数据库实例ID列表,缺省值:null,表示不使用数据库实例ID过滤。 |
instance_ip |
否 |
String |
DRS绑定的数据库实例IP,缺省值:"",表示不使用DRS绑定数据库IP过滤。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
total_record |
Integer |
任务总数。 |
jobs |
Array of objects |
任务信息列表。 详情请参见表5。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
任务ID。 |
name |
String |
任务名称。 |
status |
String |
任务状态。
枚举值:
|
description |
String |
任务描述。 |
create_time |
String |
任务创建时间。 |
engine_type |
String |
DRS任务引擎类型。取值:
详细取值可参考引擎类型说明。 |
net_type |
String |
网络类型。取值:
|
billing_tag |
Boolean |
计费字段。 |
job_direction |
String |
任务方向。取值:
|
db_use_type |
String |
任务场景。取值:
|
task_type |
String |
任务模式。取值:
|
children |
Array of objects |
子任务信息体。 详情请参见表6。 |
node_newFramework |
Boolean |
是否新框架。 |
job_action |
Object |
任务操作命令矩阵。 详情请参见表7。 |
参数 |
参数类型 |
描述 |
---|---|---|
billing_tag |
Boolean |
计费字段。 |
create_time |
String |
任务创建时间。 |
db_use_type |
String |
复制场景。取值:
|
description |
String |
任务描述。 |
engine_type |
String |
DRS任务引擎类型。取值:
详细取值可参考引擎类型说明。 |
error_msg |
String |
任务失败原因。 |
id |
String |
任务ID。 |
job_direction |
String |
迁移方向。取值:
|
name |
String |
任务名称。 |
net_type |
String |
网络类型。取值:
|
node_newFramework |
Boolean |
新框架。 |
status |
String |
任务状态。
枚举值:
|
task_type |
String |
任务模式。取值:
|
job_action |
Object |
任务操作命令矩阵。 详情请参见表7。 |
参数 |
参数类型 |
描述 |
---|---|---|
available_actions |
Array of strings |
任务可操作命令集合。 取值:
|
unavailable_actions |
Array of strings |
任务不可操作命令集合。 取值:
|
current_action |
String |
当前操作。取值:
|
请求示例
- 查询实时同步任务列表示例:
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs { "cur_page" : 1, "db_use_type" : "sync", "engine_type" : "", "name" : "", "net_type" : "", "per_page" : 5, "status" : "" }
- 查询实时迁移任务列表示例:
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs { "cur_page" : 1, "db_use_type" : "migration", "engine_type" : "", "name" : "", "net_type" : "", "per_page" : 5, "status" : "" }
- 通过数据库实例ID,查询实时同步任务列表示例:
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs { "cur_page" : 1, "db_use_type" : "sync", "engine_type" : "", "enterprise_project_id" : "", "name" : "", "net_type" : "", "per_page" : 5, "instance_ids" : [ "id1", "id2" ], "status" : "" }
- 通过数据库实例IP,查询实时同步任务列表示例:
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs { "cur_page" : 1, "db_use_type" : "sync", "engine_type" : "", "enterprise_project_id" : "", "name" : "", "net_type" : "", "per_page" : 5, "instance_ip" : "127.0.0.1", "status" : "" }
- 查询实时同步任务列表多个任务ID示例:
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs { "cur_page": 1, "db_use_type": "sync", "engine_type": "", "name": "bee869bc-15c0-4b3b-a34b-bf0d5efjb201,c2a61a77-6e55-4cd8-8be1-a562cc6jb201", "net_type": "", "per_page": 100, "status": "" }
响应示例
状态码: 200
OK
- 查询实时迁移任务列表响应示例 :
{ "jobs" : [ { "id" : "24834eb6-be30-464e-a299-f7aa730jb101", "name" : "DRS-3999-lws", "status" : "INCRE_TRANSFER_FAILED", "description" : "", "create_time" : "2020-12-21 10:57:49", "error_msg" : "service LOGMANAGER failed, cause by: Unable to connect to DBMS: url=jdbc:mysql://172.22.74.56:3306?useUnicode=true&allowLoadLocalInfile=false&characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true&verifyServerCertificate=false&serverTimezone=UTC user=root", "engine_type" : "mysql", "net_type" : "eip", "billing_tag" : false, "job_direction" : "up", "db_use_type" : "migration", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action":{ "available_actions": [ "CREATE", "CHOOSE_OBJECT", "PRE_CHECK", "CHANGE_MODE", "FREE_RESOURCE", "MODIFY_DB_CONFIG", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", "RETRY", "RESET", ], "unavailable_actions": [ "START", "CHANGE", "DELETE", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "API_CONFIGURATION_ACTION", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR", "CLONE" ] } }, { "id" : "140b5236-88ad-43c8-811c-1268453jb101", "name" : "DRS-0042-linxiaolu", "status" : "CONFIGURATION", "description" : "", "create_time" : "2020-12-19 16:23:24", "engine_type" : "mysql", "net_type" : "eip", "billing_tag" : false, "job_direction" : "up", "db_use_type" : "migration", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action": { "available_actions": [ "CREATE", "START", "CHANGE", "CHOOSE_OBJECT", "PRE_CHECK", "CHANGE_MODE", "FREE_RESOURCE", "MODIFY_DB_CONFIG", "API_CONFIGURATION_ACTION" ], "unavailable_actions": [ "RETRY", "RESET", "DELETE", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", "JUMP_RETRY", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR", "CLONE" ] } }, { "id" : "7f8e6f74-72d2-4ddd-bb8f-6c41397jb101", "name" : "DRS-0796", "status" : "RELEASE_RESOURCE_COMPLETE", "description" : "", "create_time" : "2020-12-18 10:48:11", "engine_type" : "mysql", "net_type" : "eip", "billing_tag" : false, "job_direction" : "non-dbs", "db_use_type" : "migration", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action": { "available_actions": [ "CREATE", "DELETE", "PRE_CHECK", "CHANGE_MODE", "MODIFY_DB_CONFIG", "CLONE" ], "unavailable_actions": [ "FREE_RESOURCE", "START", "CHANGE", "CHOOSE_OBJECT", "RETRY", "RESET", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", "JUMP_RETRY", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR" ] } }, { "id" : "14d88eeb-ee7e-4d30-a46e-a5ec8eajb101", "name" : "masj-mysql_migration_down-1", "status" : "INCRE_TRANSFER_STARTED", "description" : "[using] api test 2\n1. 本接口是用来配置源库/目标库信息的,选表前必须执行\n2. 配置中的任务修改描述信息成功,202 success\n3. 增量迁移中的任务修改描述信息失败,202 failed DRS.M01504\nAnother operation is being performed on the migration task or the migration task is abnormal. Try again later./", "create_time" : "2020-12-15 15:43:02", "engine_type" : "mysql", "net_type" : "eip", "billing_tag" : true, "job_direction" : "down", "db_use_type" : "migration", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action":{ "available_actions": [ "CREATE", "CHOOSE_OBJECT", "PRE_CHECK", "CHANGE_MODE", "FREE_RESOURCE", "MODIFY_DB_CONFIG", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", ], "unavailable_actions": [ "START", "RETRY", "RESET", "CHANGE", "DELETE", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "API_CONFIGURATION_ACTION", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR", "CLONE" ] } }, { "id" : "d54691d2-f105-434d-a75d-809b017jb101", "name" : "masj-2-mysql_migration_down", "status" : "CONFIGURATION", "description" : "[using] api test 2\n1. 本接口是用来配置源库/目标库信息的,选表前必须执行\n2. 配置中的任务修改描述信息成功,202 success\n3. 增量迁移中的任务修改描述信息失败,202 failed DRS.M01504\nAnother operation is being performed on the migration task or the migration task is abnormal. Try again later./", "create_time" : "2020-12-14 21:39:07", "engine_type" : "mysql", "net_type" : "eip", "billing_tag" : false, "job_direction" : "down", "db_use_type" : "migration", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action": { "available_actions": [ "CREATE", "START", "CHANGE", "CHOOSE_OBJECT", "PRE_CHECK", "CHANGE_MODE", "FREE_RESOURCE", "MODIFY_DB_CONFIG", "API_CONFIGURATION_ACTION" ], "unavailable_actions": [ "RETRY", "RESET", "DELETE", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", "JUMP_RETRY", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR", "CLONE" ] } } ], "total_record" : 7 }
- 查询实时同步任务列表示例 :
{ "jobs" : [ { "id" : "7994aac9-0a15-4fdb-bcc5-667f088jb20b", "name" : "DRS-8200", "status" : "CREATE_FAILED", "description" : "", "create_time" : "2020-12-21 18:02:36", "error_msg" : "system error!", "engine_type" : "oracle-to-mysql", "net_type" : "eip", "billing_tag" : false, "job_direction" : "up", "db_use_type" : "sync", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action": { "available_actions": [ "CREATE", "DELETE", "START", "CHANGE", "CHOOSE_OBJECT", "PRE_CHECK", "CHANGE_MODE", "MODIFY_DB_CONFIG", "API_CONFIGURATION_ACTION" ], "unavailable_actions": [ "FREE_RESOURCE", "RETRY", "RESET", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", "JUMP_RETRY", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR", "CLONE" ] } }, { "id" : "f463331d-e079-4689-bbef-4553202jb20b", "name" : "DRS-1285", "status" : "CONFIGURATION", "description" : "", "create_time" : "2020-12-21 17:19:38", "engine_type" : "oracle-to-mysql", "net_type" : "eip", "billing_tag" : false, "job_direction" : "up", "db_use_type" : "sync", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action": { "available_actions": [ "CREATE", "START", "CHANGE", "CHOOSE_OBJECT", "PRE_CHECK", "CHANGE_MODE", "FREE_RESOURCE", "MODIFY_DB_CONFIG", "API_CONFIGURATION_ACTION" ], "unavailable_actions": [ "RETRY", "RESET", "DELETE", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", "JUMP_RETRY", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR", "CLONE" ] } }, { "id" : "7f13c511-c35b-4f82-92ae-83bcbf0jb201", "name" : "DRS-9383", "status" : "CONFIGURATION", "description" : "", "create_time" : "2020-12-21 17:18:44", "engine_type" : "mysql", "net_type" : "eip", "billing_tag" : false, "job_direction" : "up", "db_use_type" : "sync", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action": { "available_actions": [ "CREATE", "START", "CHANGE", "CHOOSE_OBJECT", "PRE_CHECK", "CHANGE_MODE", "FREE_RESOURCE", "MODIFY_DB_CONFIG", "API_CONFIGURATION_ACTION" ], "unavailable_actions": [ "RETRY", "RESET", "DELETE", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", "JUMP_RETRY", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR", "CLONE" ] } }, { "id" : "7686e879-46a4-4d6b-bda9-5540424jb201", "name" : "DRS-9272", "status" : "CONFIGURATION", "description" : "", "create_time" : "2020-12-21 16:53:36", "engine_type" : "mysql", "net_type" : "eip", "billing_tag" : false, "job_direction" : "up", "db_use_type" : "sync", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action": { "available_actions": [ "CREATE", "START", "CHANGE", "CHOOSE_OBJECT", "PRE_CHECK", "CHANGE_MODE", "FREE_RESOURCE", "MODIFY_DB_CONFIG", "API_CONFIGURATION_ACTION" ], "unavailable_actions": [ "RETRY", "RESET", "DELETE", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", "JUMP_RETRY", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR", "CLONE" ] } }, { "id" : "5b2c2ec8-430e-4de0-937b-9d9547ajb201", "name" : "DRS-2899", "status" : "RELEASE_RESOURCE_COMPLETE", "description" : "", "create_time" : "2020-12-21 16:24:24", "engine_type" : "mysql", "net_type" : "eip", "billing_tag" : false, "job_direction" : "up", "db_use_type" : "sync", "task_type" : "FULL_INCR_TRANS", "node_newFramework" : false "job_action": { "available_actions": [ "CREATE", "DELETE", "PRE_CHECK", "CHANGE_MODE", "MODIFY_DB_CONFIG", "CLONE" ], "unavailable_actions": [ "FREE_RESOURCE", "START", "CHANGE", "CHOOSE_OBJECT", "RETRY", "RESET", "QUERY_PRE_CHECK", "SWITCH_OVER", "MODIFY_SPECIFICATION_ID", "RESET_DB_PWD", "MODIFY_CONFIGURATION", "PAUSE", "JUMP_RETRY", "START_INCR", "MODIFY_TASK_NUMBER", "CONTINUE_JOB", "STOP_JOB", "CONTINUE_CAPTURE", "STOP_CAPTURE", "CONTINUE_APPLY", "STOP_APPLY", "PAY_ORDER", "UNSUBSCRIBE", "TO_PERIOD", "TO_RENEW", "ORDER_INFO", "CHANGE_FLAVOR" ] } } ], "total_record" : 18 }
状态码
状态码 |
描述 |
---|---|
200 |
OK |
400 |
Bad Request |
错误码
请参见错误码。