Querying Tasks
Function
This API is used to query tenant tasks by enterprise project, engine type, network type, task status, task name, or task ID.
Constraints
- This API is available only for synchronization from MySQL to MySQL, migration from Redis to GeminiDB Redis, migration from cluster Redis to GeminiDB Redis, and synchronization from Oracle to GaussDB Distributed.
- This API can be used only in certain regions. For details, see Endpoints.
URI
GET /v5/{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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
job_type |
Yes |
String |
Task scenario. Values:
Enumerated values:
|
name |
No |
String |
Task ID or name. You can enter a maximum of 10 task IDs separated by commas (,). |
status |
No |
String |
Task status. Values:
Enumerated values:
|
engine_type |
No |
String |
Engine type. Values:
Enumerated values:
|
net_type |
No |
String |
Network type. Values:
Enumerated values:
|
enterprise_project_id |
No |
String |
Enterprise project ID. Default value: "", indicating that tasks in all enterprise projects are queried. |
offset |
No |
Integer |
Offset. The records after this offset will be queried. |
limit |
No |
Integer |
Maximum number of records that can be returned. |
sort_key |
No |
String |
The keyword based on which the returned results are sorted. The default value is create_time. |
sort_dir |
No |
String |
Result sorting order. The value can be desc (descending order) or asc (ascending order). The default value is desc. |
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. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
MIME type of the request body. Use the default value application/json. For APIs used to upload objects or images, the value varies depending on the flow type. The default value is application/json. |
X-Auth-Token |
Yes |
String |
User token obtained from IAM. It is a response to the API for obtaining a user token. This API is the only one that does not require authentication. After a request is processed, the value of X-Subject-Token in the header is the token value. |
X-Language |
No |
String |
Request language type. Default value: en-us Enumerated values:
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total_count |
Integer |
Total number of tasks in the list, which is irrelevant to pagination. |
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. Values:
Enumerated values:
|
description |
String |
Task description. |
create_time |
String |
Task creation time. |
engine_type |
String |
Engine type. The value can be:
Enumerated values:
|
net_type |
String |
Network type. Values:
Enumerated values:
|
charging_mode |
String |
Billing mode. Values:
Enumerated values:
|
billing_tag |
Boolean |
Whether to support billing. |
job_direction |
String |
Task direction. Values:
Enumerated values:
|
job_type |
String |
Task scenario. Values:
Enumerated values:
|
task_type |
String |
Migration type. Values:
Enumerated values:
|
enterprise_project_id |
String |
Enterprise project ID. |
job_mode |
String |
Task mode. Values:
Enumerated values:
|
job_mode_role |
String |
Task role. Values:
Enumerated values:
|
is_multi_az |
Boolean |
Whether the task is a primary/standby task. |
node_role |
String |
Node role. |
node_new_framework |
Boolean |
Whether the framework is a new framework. |
job_action |
Object |
The set of task operation commands. For details, see Table 7. |
children |
Array of objects |
Information body of a subtask list. For details, see Table 6. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Task ID. |
name |
String |
Task name. |
status |
String |
Task status. Values:
Enumerated values:
|
description |
String |
Task description. |
create_time |
String |
Task creation time. |
engine_type |
String |
Engine type. The value can be:
Enumerated values:
|
net_type |
String |
Network type. Values:
Enumerated values:
|
charging_mode |
String |
Billing mode. Values:
Enumerated values:
|
billing_tag |
Boolean |
Whether to support billing. |
job_direction |
String |
Task direction. Values:
Enumerated values:
|
job_type |
String |
Task scenario. Values:
Enumerated values:
|
task_type |
String |
Task mode. Values:
Enumerated values:
|
enterprise_project_id |
String |
Enterprise project ID. |
job_mode |
String |
Task mode. Values:
Enumerated values:
|
job_mode_role |
String |
Task role. Values:
Enumerated values:
|
is_multi_az |
Boolean |
Whether the task is a primary/standby task. |
node_role |
String |
Node role. |
node_new_framework |
Boolean |
Whether the framework is a new framework. |
job_action |
Object |
The set of task operation commands. For details, see Table 7. |
Parameter |
Type |
Description |
---|---|---|
available_actions |
Array of strings |
The set of operation commands that can be executed for a task. |
unavailable_actions |
Array of strings |
The set of operation commands that cannot be executed for a task. |
current_action |
String |
Current operation command of a task. Values:
Enumerated values:
|
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum length: 12 Maximum length: 12 |
error_msg |
String |
Error message. Minimum length: 1 Maximum length: 512 |
Example Request
- Querying the real-time DR task list
https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs?job_type=cloudDataGuard&name=&status=&engine_type=&net_type=&enterprise_project_id=&offset=0&limit=10&sort_key=create_time&sort_dir=desc
- Querying the real-time migration task list
https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs?job_type=migration&name=&status=&engine_type=&net_type=&enterprise_project_id=&offset=0&limit=10&sort_key=create_time&sort_dir=desc
- Querying the real-time synchronization task list
https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs?job_type=sync&name=&status=&engine_type=&net_type=&enterprise_project_id=&offset=0&limit=10&sort_key=create_time&sort_dir=desc
- Querying the real-time DR task list based on the database IP address
https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs?job_type=cloudDataGuard&name=&status=&engine_type=&net_type=&enterprise_project_id=&offset=0&limit=10&sort_key=create_time&sort_dir=desc&instance_ip=127.0.0.1
- Querying the real-time DR task list based on the database ID
https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs?job_type=cloudDataGuard&name=&status=&engine_type=&net_type=&enterprise_project_id=&offset=0&limit=10&sort_key=create_time&sort_dir=desc&instance_ids=id1&instance_ids=id2
- Querying the real-time synchronization task list using multiple task IDs
https://{endpoint}/v5/5237e10fe9aa4ad5b16b6a5245248314/jobs?name=bee869bc-15c0-4b3b-a34b-bf0d5efjb201,c2a61a77-6e55-4cd8-8be1-a562cc6jb201&job_type=sync
Example Response
Status code: 200
OK
{ "jobs" : [ { "id" : "c7debc9c-8e09-4a5d-8dd6-cc44f78jb20r", "name" : "DRS-1234", "status" : "CONFIGURATION", "create_time" : "2022-11-07T16:15:18Z", "engine_type" : "oracle-to-gaussdbv5", "job_direction" : "up", "task_type" : "FULL_INCR_TRANS", "job_action" : { "available_actions" : [ "FREE_RESOURCE", "PRE_CHECK", "MODIFY_CONFIGURATION", "CHANGE" ], "unavailable_actions" : [ "CREATE", "START", "CHOOSE_OBJECT", "RETRY", "RESET", "DELETE", "QUERY_PRE_CHECK", "CHANGE_MODE", "MODIFY_DB_CONFIG", "SWITCH_OVER", "RESET_DB_PWD", "PAUSE", "JUMP_RETRY", "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", "CLONE" ], "current_action" : null } } ], "total_count" : 1 }
Status code: 400
Bad Request
{ "error_code" : "DRS.10000001", "error_msg" : "Failed." }
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot