Querying Task Status
Function
This API is used to query the execution status of a task. It can be used to query the execution status of a disk creation, capacity expansion, or deletion task.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/jobs/{job_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
job_id |
Yes |
String |
The task ID. |
project_id |
Yes |
String |
The project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
The user token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
status |
String |
The task status. SUCCESS: The task was successful. RUNNING: The task is in progress. FAIL: The task failed. INIT: The task is being initialized. Enumeration values:
|
entities |
JobEntities object |
The task response information. |
job_id |
String |
The task ID. |
job_type |
String |
The task type.
|
begin_time |
String |
The start time. |
end_time |
String |
The end time. |
error_code |
String |
The error code returned if the task execution fails. |
fail_reason |
String |
The cause of the task execution failure. |
Parameter |
Type |
Description |
---|---|---|
volume_type |
String |
The disk type. |
size |
Integer |
The disk size, in GiB. |
volume_id |
String |
The disk ID. |
name |
String |
The disk name. |
sub_jobs |
Array of SubJob objects |
The information of a subtask. If there is a subtask, other fields in entities are not returned. |
Parameter |
Type |
Description |
---|---|---|
status |
String |
The subtask status. SUCCESS: The task was successful. RUNNING: The task is in progress. FAIL: The task failed. INIT: The task is being initialized. Enumeration values:
|
entities |
SubJobEntities object |
The subtask response information. |
job_id |
String |
The subtask ID. |
job_type |
String |
The subtask type.
|
begin_time |
String |
The start time. |
end_time |
String |
The end time. |
error_code |
String |
The error code returned if the subtask execution fails. |
fail_reason |
String |
The cause of the subtask execution failure. |
Parameter |
Type |
Description |
---|---|---|
volume_type |
String |
The disk type. |
size |
Integer |
The disk size, in GiB. |
volume_id |
String |
The disk ID. |
name |
String |
The disk name. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
The error message returned if an error occurs. For details, seeParameters in the error field. |
Parameter |
Type |
Description |
---|---|---|
code |
String |
The error code returned if an error occurs. For the error codes and their meanings, see Error Codes. |
message |
String |
The error message returned if an error occurs. |
Example Requests
GET https://{endpoint}/v1/{project_id}/jobs/{job_id} https://{endpoint}/v1/{project_id}/jobs/{job_id}
Example Responses
Status code: 200
OK
{ "status" : "RUNNING", "entities" : { "volume_id" : "bdf1bb37-f20f-4266-9a04-f43e0a127376" }, "job_id" : "4010a32d535527910153552b492c0002", "job_type" : "createVolume", "begin_time" : "2016-03-08T07:40:13.219Z", "end_time" : "" }
Status code: 400
Bad Request
{ "error" : { "message" : "XXXX", "code" : "XXX" } }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
Error Codes
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