Querying Tasks of a Tenant
Function
This API is used to query tenant tasks by engine type, network type, task status, task name, or task ID.
URI
POST /v3/{project_id}/jobs
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region For details about how to obtain the project ID, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
The content type. The default value is application/json. |
X-Auth-Token |
Yes |
String |
User token obtained from IAM. |
X-Language |
No |
String |
Request language type Default value: en-us Values:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
cur_page |
Yes |
Integer |
Current page. Set the value to 0 to obtain all items. If per_page is set to 0, cur_page can only be set to 0 or 1. Default value: 1 |
per_page |
Yes |
Integer |
Number of records on each page. If this parameter is set to 0, cur_page can only be set to 0 or 1.
|
db_use_type |
Yes |
String |
Migration scenario. The value can be migration (real-time migration), sync (real-time synchronization), or cloudDataGuard (real-time disaster recovery). Values:
|
engine_type |
No |
String |
Engine type of a DRS task. Default value: mysql Values:
|
enterprise_project_id |
No |
String |
Enterprise project. If no value is specified, this parameter is set to null. This parameter cannot be left blank. When enterprise project is enabled, this parameter can be set. |
name |
No |
String |
Name or ID. You can enter a maximum of 100 task IDs separated by commas (,). |
net_type |
No |
String |
Network type. Values:
|
service_name |
No |
String |
Service name. |
status |
No |
String |
Task status.
Enumerated values:
|
tags |
No |
Map<String,String> |
Tags. For details, see Table 7. |
instance_ids |
No |
Array of strings |
List of database instance IDs. The default value is null, indicating that database instance IDs are not used for task filtering. |
instance_ip |
No |
String |
IP address of the database instance bound to the DRS. The default value is "", indicating that the IP address of the database instance bound to the DRS is not used for task filtering. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total_record |
Integer |
Total number of tasks |
jobs |
Array of objects |
Task details. For details, see Table 5. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Task ID. |
name |
String |
Task name. |
status |
String |
Task status.
Enumerated values:
|
description |
String |
Task description. |
create_time |
String |
Time when a task is created |
engine_type |
String |
Engine type of a DRS task. Values:
|
net_type |
String |
Network type. Values:
|
billing_tag |
Boolean |
Billing tag. |
job_direction |
String |
Task direction. Values:
|
db_use_type |
String |
Task scenario. Values:
|
task_type |
String |
Task mode. Values:
|
children |
Array of objects |
Subtask information body. For details, see Table 6. |
node_newFramework |
Boolean |
Whether the framework is a new framework. |
job_action |
Object |
The matrix of task operation commands. For details, see Table 7. |
Parameter |
Type |
Description |
---|---|---|
billing_tag |
Boolean |
Billing tag. |
create_time |
String |
Time when a task is created |
db_use_type |
String |
Replication scenario. Values:
|
description |
String |
Task description. |
engine_type |
String |
Engine type of a DRS task. Values:
|
error_msg |
String |
Task failure cause. |
id |
String |
Task ID. |
job_direction |
String |
Migration direction. Values:
|
name |
String |
Task name. |
net_type |
String |
Network type. Values:
|
node_newFramework |
Boolean |
New framework |
status |
String |
Task status.
Enumerated values:
|
task_type |
String |
Task mode. Values:
|
job_action |
Object |
The matrix of task operation commands. For details, see Table 7. |
Parameter |
Type |
Description |
---|---|---|
available_actions |
Array of strings |
The collection of operation commands that can be executed for a task. Values:
|
unavailable_actions |
Array of strings |
The collection of operation commands that cannot be executed for a task. Values:
|
current_action |
String |
The current operation. Values:
|
Example Request
- Example of querying the real-time synchronization task list:
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs { "cur_page" : 1, "db_use_type" : "sync", "engine_type" : "", "name" : "", "net_type" : "", "per_page" : 5, "status" : "" }
- Example of querying the real-time migration task list:
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs { "cur_page" : 1, "db_use_type" : "migration", "engine_type" : "", "name" : "", "net_type" : "", "per_page" : 5, "status" : "" }
- Example of querying the real-time synchronization tasks based on the database instance 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" : "" }
- Example of querying the real-time synchronization tasks based on the database instance IP address:
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" : "" }
- Querying the real-time synchronization task list using multiple task IDs
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": "" }
Example Response
Status code: 200
OK
- Example response for querying the real-time migration tasks:
{ "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. This API is used to configure the source and destination database information. Before selecting a table, you must perform this operation. \n2. If the description of a task in the configuration is successfully modified, 202 success is returned. \n3. If the description of a task in an incremental migration fails to be modified, 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. This API is used to configure the source and destination database information. Before selecting a table, you must perform this operation. \n2. If the description of a task in the configuration is successfully modified, 202 success is returned. \n3. If the description of a task in an incremental migration fails to be modified, 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 }
- Example response for querying the real-time synchronization tasks:
{ "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 }
Status Code
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
Error Code
For details, see Error Code.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.