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.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
GET /v1/{project_id}/jobs/{job_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
job_id |
Yes |
String |
Definition The task ID. Constraints N/A Range N/A Default Value N/A |
|
project_id |
Yes |
String |
Definition The project ID. For details, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition The user token. You can obtain it by calling the IAM API for obtaining a user token. The token is the value of X-Subject-Token in the response header. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
status |
String |
Definition The task status. Range
|
|
entities |
JobEntities object |
Definition The task response information. Range N/A |
|
job_id |
String |
Definition The task ID. Range N/A |
|
job_type |
String |
Definition The task type. Range
|
|
begin_time |
String |
Definition The start time. Range N/A |
|
end_time |
String |
Definition The end time. Range N/A |
|
error_code |
String |
Definition The error code returned if the task execution fails. Range N/A |
|
fail_reason |
String |
Definition The cause of the task execution failure. Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
volume_type |
String |
Definition The disk type. Range N/A |
|
size |
Integer |
Definition The disk size, in GiB. Range N/A |
|
volume_id |
String |
Definition The disk ID. Range N/A |
|
name |
String |
Definition The disk name. Range N/A |
|
sub_jobs |
Array of SubJob objects |
Definition The subtask information. If there is subtask information, other fields in entities are not returned. Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
status |
String |
Definition The subtask status. Range
|
|
entities |
SubJobEntities object |
Definition The subtask response information. Range N/A |
|
job_id |
String |
Definition The subtask ID. Range N/A |
|
job_type |
String |
Definition The subtask type. Range
|
|
begin_time |
String |
Definition The start time. Range N/A |
|
end_time |
String |
Definition The end time. Range N/A |
|
error_code |
String |
Definition The error code returned if the subtask execution fails. Range N/A |
|
fail_reason |
String |
Definition The cause of the subtask execution failure. Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
volume_type |
String |
Definition The disk type. Range N/A |
|
size |
Integer |
Definition The disk size, in GiB. Range N/A |
|
volume_id |
String |
Definition The disk ID. Range N/A |
|
name |
String |
Definition The disk name. Range N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
Error object |
Definition The error code returned if an error occurs. For details about the error code, see Error Codes. Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition The error code returned if an error occurs. Range For details about the error code, see Error Codes. |
|
message |
String |
Definition The error message returned if an error occurs. Range N/A |
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