Obtaining Information About a Task with a Specified ID
Function
This API is used to obtain information about a task with a specified ID in the task center.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about request header parameters.
Constraints
- RDS jobs are asynchronous. After a job is generated, it takes several seconds to query the job ID.
- This API is used to query only asynchronous tasks of the last one month in the task center.
- Information of the following asynchronous tasks can be obtained: creating a single-node or primary/standby DB instance, creating a read replica, deleting a DB instance, changing a single-node DB instance to primary/standby DB instance, switching a primary/standby DB instance, scaling up storage space, binding or unbinding an EIP, restoring data to a new DB instance, migrating a standby RDS for MySQL DB instance to another AZ, upgrading a minor version of an RDS for MySQL DB instance, restoring table data to a specified time point for an RDS for MySQL DB instance, and changing an instance class.
URI
- Parameter description
Table 1 Parameters Parameter
Mandatory
Description
project_id
Yes
Definition
Project ID of a tenant in a region.
To obtain the value, see Obtaining a Project ID.
Constraints
N/A
Range
N/A
Default Value
N/A
id
Yes
Definition
Task ID.
Constraints
N/A
Range
N/A
Default Value
N/A
Request
Response
- Normal response
Table 2 Parameters Parameter
Type
Description
job
Object
Definition
Indicates the task information. For details, see Table 3.
Table 3 job field data structure description Parameter
Type
Description
id
String
Definition
Indicates the job ID.
Range
N/A
name
String
Definition
Indicates the task name.
Range
N/A
status
String
Definition
Indicates the task execution status.
Range- Running: The task is being executed.
- Completed: The task is successfully executed.
- Failed: The task fails to be executed.
created
String
Definition
Indicates the creation time.
Range
The value is in the "yyyy-mm-ddThh:mm:ssZ" format.
T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.
ended
String
Definition
Indicates the end time.
Range
The value is in the "yyyy-mm-ddThh:mm:ssZ" format.
T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.
process
String
Definition
Indicates the task execution progress.
Range
The execution progress (such as "60%") is displayed only when the task is being executed. Otherwise, "" is returned.
instance
Object
Definition
Indicates information of the DB instance on which the task is executed.
For details, see Table 4.
entities
Object
Definition
The displayed information varies depending on the tasks.
For details, see Table 5.
NOTE:For asynchronous tasks without the entities field description, {} is returned.
fail_reason
String
Definition
Indicates the error information displayed when a task failed.
Range
N/A
Table 4 instances field data structure description Parameter
Type
Description
id
String
Definition
Indicates the DB instance ID.
Range
N/A
name
String
Definition
Indicates the DB instance name.
Range
N/A
Table 5 entities field data structure description Parameter
Type
Description
instance
Object
Definition
Indicates the information required for creating an instance, changing a single instance to primary/standby, or creating a read replica.
For details, see Table 6.
resource_ids
Array of strings
Definition
Indicates the queried resource ID.
Range
N/A
volume
Object
Definition
Indicates the information about the resized disk.
For details, see Table 8.
public_ip
String
Definition
Indicates the EIP bound to the DB instance.
Range
N/A
switch_strategy
String
Definition
Indicates the primary/standby switchover policy.
Range
N/A
Table 6 entities.instance field data structure description Parameter
Type
Description
endpoint
String
Definition
Indicates the DB instance connection address.
Range
N/A
type
String
Definition
Indicates the DB instance type.
Range
- Single: single-node instance
- Ha: primary/standby instance
- Replica: read replica
datastore
Object
Definition
Indicates the database information. For details, see Table 7.
replica_of
String
Definition
Indicates the primary DB instance ID. This parameter is returned only when a read replica is created.
Range
N/A
Table 7 datastore field data structure description Parameter
Type
Description
type
String
Definition
Indicates the DB engine.
Range
N/A
version
String
Definition
Indicates the database version.
Range
N/A
Table 8 volume field data structure description Parameter
Type
Description
type
String
Definition
Indicates the volume type.
Range
N/A
original_size
String
Definition
Indicates the original volume size in GB.
Range
N/A
target_size
String
Definition
Indicates the target volume size in GB.
Range
N/A
In the response example, some tasks in the task center are used as examples.
- Example normal response
Creating a DB instance:
{ "job": { "id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886", "name": "CreateMysqlSingleHAInstance", "status": "Completed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": { "instance": { "endpoint": "192.168.1.203:3306", "type": "Single", "datastore": { "type": "mysql", "version": "5.7" } }, "resource_ids": ["a48e43ff268f4c0e879652d65e63d0fbin01.vm", "a48e43ff268f4c0e879652d65e63d0fbin01.volume"] } } }
Creating a read replica:{ "job": { "id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886", "name": " CreateMysqlReplicaInstance", "status": "Completed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "288caaa9d05f4ec1a1f58de2e0945685in01", "name": "mysql-replica" }, "entities": { "instance": { "endpoint": "192.168.1.203:3306", "type": "replica", "datastore": { "type": "mysql", "version": "5.7" }, "replica_of": "a48e43ff268f4c0e879652d65e63d0fbin01" }, "resource_ids": ["288caaa9d05f4ec1a1f58de2e0945685in01.vm", "288caaa9d05f4ec1a1f58de2e0945685in01.volume"] } } }
Binding an EIP:{ "job": { "id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886", "name": "MysqlBindEIP", "status": "Completed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": { "public_ip": "10.10.10.1" } } }
Rebooting a DB instance:{ "job": { "id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886", "name": " RestartMysqlInstance", "status": "Completed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": {} } }
Task being executed:{ "job": { "id": "31 b8ae23 - c687 - 4 d80 - b7b4 - 42 a66c9bb886", "name": "CreateMysqlSingleHAInstance"," status": "Running", "created": "2018-08-06T10:41:14+0000", "process": "60% ", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": { "instance": { "type": "Single", "datastore": { "type": "mysql", "version": "5.7" } } } } }
Task fails to be executed:{ "job": { "id": "31 b8ae23 - c687 - 4 d80 - b7b4 - 42 a66c9bb886", "name": "CreateMysqlSingleHAInstance", "status": "Failed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": { "instance": { "type": "Single", "datastore": { "type": "mysql", "version": "5.7" } } }, "fail_reason": "createVM failed." } }
{ "job": { "id": "31 b8ae23 - c687 - 4 d80 - b7b4 - 42 a66c9bb886", "name": "CreatePostgresqlSingleHAInstance", "status": "Failed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-postgresql-single" }, "entities": { "instance": { "type": "Single", "datastore": { "type": "postgresql", "version": "9.6" } } }, "fail_reason": "createVM failed." } }
- Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.
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