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 |
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. Default value: 1 |
per_page | Yes | Integer | Number of records on each page.
|
db_use_type | Yes | String | The 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. |
net_type | No | String | Network type. Values:
|
service_name | No | String | Service name. |
status | No | String | Status. The value can be CREATING, CREATE_FAILED, or CONFIGURATION. STARTJOBING: The task is being started. WAITING_FOR_START: The task is waiting to be started. START_JOB_FAILED: The task fails to be started. FULL_TRANSFER_STARTED: Full migration is in progress, and the DR scenario is initialized. FULL_TRANSFER_FAILED: Full migration failed. Initialization failed in the DR scenario. FULL_TRANSFER_COMPLETE: Full migration is complete, and the initialization is complete in the DR scenario. INCRE_TRANSFER_STARTED: Incremental migration is being performed, and the DR task is in progress. INCRE_TRANSFER_FAILED: Incremental migration fails and a DR exception occurs. RELEASE_RESOURCE_STARTED: The task is being stopped. RELEASE_RESOURCE_FAILED: Stop task failed. RELEASE_RESOURCE_COMPLETE: The task is stopped. CHANGE_JOB_STARTED: The task is being changed. CHANGE_JOB_FAILED: Change task failed. CHILD_TRANSFER_STARTING: The subtask is being started. CHILD_TRANSFER_STARTED: The subtask is being migrated. CHILD_TRANSFER_COMPLETE: The subtask migration is complete. CHILD_TRANSFER_FAILED: Migrate subtask failed. RELEASE_CHILD_TRANSFER_STARTED: The subtask is being stopped. RELEASE_CHILD_TRANSFER_COMPLETE: The subtask is complete. Values:
|
tags | No | Array of ResourceTag objects | Tags. |
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
total_record | Integer | Total number of tasks |
jobs | Array of JobInfo objects | Task details. |
Parameter | Type | Description |
---|---|---|
id | String | Task ID. |
name | String | Task name. |
status | String | Task status. 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 ChildrenJobInfo objects | Subtask information body. |
node_newFramework | Boolean | Whether the framework is a new framework. |
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. |
task_type | String | Task mode. Values:
|
Example Request¶
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 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 }, { "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 }, { "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 }, { "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 }, { "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 } ], "total_record" : 7 }
Status Code¶
Status Code | Description |
---|---|
200 | OK |
400 | Bad Request |
Error Code¶
For details, see Error Code.