Querying Subtasks
Function
Queries the execution status of an asynchronous task, such as a desktop creation task.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
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 /v2/{project_id}/workspace-sub-jobs
Parameter | Mandatory | Type | Description |
|---|---|---|---|
project_id | Yes | String | Project ID. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
total_count | Integer | Total number of tasks in the task list. |
jobs | Array of JobDetailInfo objects | Task list. |
Parameter | Type | Description |
|---|---|---|
id | String | Subtask ID. |
job_type | String | Task type. |
entities | JobEntities object | Task. |
begin_time | String | Task creation time. |
end_time | String | Task end time. |
status | String | Task status. |
error_code | String | Error code of a failed task. |
fail_reason | String | Task failure cause. |
host | String | IP address of the server where the task is executed. |
project_id | String | Project ID. |
job_id | String | Task ID. |
process | Integer | Task progress. |
attach_user | String | Associate user. |
entity | String | Operation object. |
ip_address | String | IP address. |
Parameter | Type | Description |
|---|---|---|
desktop_id | String | Desktop ID. |
product_id | String | Package ID. |
user_name | String | Username. |
desktop_name | String | Desktop name. |
ip_address | String | IP address. |
Status code: 400
Parameter | Type | Description |
|---|---|---|
error_code | String | Error code. |
error_msg | String | Error message. |
error_detail | String | Error Details. |
encoded_authorization_message | String | Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 401
Parameter | Type | Description |
|---|---|---|
error_code | String | Error code. |
error_msg | String | Error message. |
error_detail | String | Error Details. |
encoded_authorization_message | String | Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 403
Parameter | Type | Description |
|---|---|---|
error_code | String | Error code. |
error_msg | String | Error message. |
error_detail | String | Error Details. |
encoded_authorization_message | String | Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 404
Parameter | Type | Description |
|---|---|---|
error_code | String | Error code. |
error_msg | String | Error message. |
error_detail | String | Error Details. |
encoded_authorization_message | String | Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 405
Parameter | Type | Description |
|---|---|---|
error_code | String | Error code. |
error_msg | String | Error message. |
error_detail | String | Error Details. |
encoded_authorization_message | String | Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 500
Parameter | Type | Description |
|---|---|---|
error_code | String | Error code. |
error_msg | String | Error message. |
error_detail | String | Error Details. |
encoded_authorization_message | String | Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 503
Parameter | Type | Description |
|---|---|---|
error_code | String | Error code. |
error_msg | String | Error message. |
error_detail | String | Error Details. |
encoded_authorization_message | String | Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Example Requests
GET /v2/ac234de25c6741d2b1273da49eea1b9e/workspace-sub-jobs?status=FAILED&status=RUNNING&job_type=createDesktops null
Example Responses
Status code: 200
Response to task details.
{
"total_count" : 2,
"jobs" : [ {
"status" : "RUNNING",
"entities" : {
"user_name" : "user-test-01",
"product_id" : "workspace.c2.large.windows",
"desktop_id" : "9d30c8ac-77b5-4453-80da-8f027223ee99"
},
"job_id" : "0e2dae94-23ff-449a-bb9c-1b808cf2106d",
"job_type" : "createDesktops",
"begin_time" : "2020-04-10 06:45:14",
"end_time" : "2020-04-10 07:06:10",
"id" : "e43caef5-e478-4624-9e8c-b0b636331cbc"
}, {
"status" : "RUNNING",
"entities" : {
"user_name" : "user-test-01",
"product_id" : "workspace.c2.large.windows",
"desktop_id" : "14cccba0-12a6-4b66-9fd9-57290328f8da"
},
"job_id" : "0e2dae94-23ff-449a-bb9c-1b808cf2106d",
"job_type" : "createDesktops",
"begin_time" : "2020-04-10 06:45:14",
"end_time" : "2020-04-10 07:05:49",
"id" : "cf5043e9-dd94-43be-9c07-6dba5d43c4d2"
} ]
} Status Codes
Status Code | Description |
|---|---|
200 | Response to task details. |
400 | The request cannot be understood by the server due to malformed syntax. |
401 | Authentication failed. |
403 | No operation permissions. |
404 | No resources found. |
405 | The method specified in the request is not allowed. |
500 | An internal service error occurred. For details about the error code, see the error code description. |
503 | Service unavailable. |
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
