Querying Task Execution Status Details
Function
Queries task execution statuses.
After a command of an asynchronous API (for creating an ECS, deleting an ECS, or rebuilding an image) is delivered, a job ID is returned, based on which you can query the execution status of the 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, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
workspace:jobs:get
Read
-
-
-
-
URI
GET /v2/{project_id}/job/{job_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Unique ID of a project |
| job_id | Yes | String | Job ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | No | String | 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 |
|---|---|---|
| id | String | Task ID. |
| job_type | String | Task type. |
| begin_time | String | Task creation time. |
| end_time | String | Task end time. |
| status | String | Task status. |
| sub_jobs_total | Integer | Total number of subtasks. |
| sub_jobs | Array of JobDetailInfo objects | Subtasks. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Subtask ID. |
| job_type | String | Task type: CREATE_SERVER: creating a server DELETE_SERVER: deleting a server UPDATE_FREEZE_STATUS: changing the server freezing status CREATE_SERVER_IMAGE: creating an image REINSTALL_OS: reinstalling the OS CHANGE_SERVER_IMAGE: replacing an image REJOIN_DOMAIN: rejoining the domain MIGRATE_SERVER: migrating a server UPGRADE_ACCESS_AGENT: upgrading the HDA UPDATE_SERVER_TSVI: updating a virtual session IP SCHEDULED_TASK: performing a scheduled task COLLECT_HDA_LOG: collecting HDA logs COLLECT_APS_LOG: collecting application streaming server logs CREATE_SERVER_SNAPSHOT: creating a server snapshot DELETE_SERVER_SNAPSHOT: deleting a server snapshot RESTORE_SERVER_SNAPSHOT: restoring a server snapshot BATCH_INSTALL_APP: installing applications in batches |
| job_resource_info | JobResourceInfo object | Specific resource information. |
| 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. |
| error_message | String | Task failure cause. |
| project_id | String | Project ID. |
| job_id | String | Task ID. |
| Parameter | Type | Description |
|---|---|---|
| resource_id | String | Resource instance ID is displayed on the cloud service console. The value is globally unique and cannot be changed. The value contains up to 64 characters. Note: In specification change scenarios (including upgrading and downgrading), only the specifications are adjusted. Other information (such as resource ID and resource name) and running service data of the resource instance remain unchanged. |
| resource_name | String | Resource name. This field is mandatory in the scenario where a resource is created or a new resource name is available. |
| cloud_service_type | String | Cloud service type code. This field is mandatory in new purchase and specification change scenarios. |
| resource_type | String | Resource type code. This parameter is mandatory in new purchase and specification change scenarios. -hws.resource.type.workspace.volume: Workspace desktop disk -hws.resource.type.workspace.desktop: Workspace desktop -hws.resource.type.workspace.appstream: Workspace Application Streaming -hws.resource.type.workspace.appstreamsession: Workspace Application Streaming multi-session |
| resource_spec_code | String | Resource specification code. This field is mandatory in new purchase and specification change scenarios. |
| spec_type | Map<String,Object> | Type of the specification that needs to be displayed and used for operations. Use multiple key-value pairs to specify different specification types. For example, the bandwidth can be shared or exclusive (shareable:true/false), and a disk can be system disk or data disk (root:true/false). This field is mandatory for shared bandwidth and shared disk setting. |
| spec_size | Double | Specification size, such as the bandwidth and data disk size. |
| measure | Integer | specSize unit code, for example, GB and M. This field is mandatory when specSize is set. |
| processed_time | String | Processing time. |
| is_main_resource | Integer | Whether the resource specified by resourceId is a primary resource. This parameter is used only in service enabling scenario. 1: yes. 0: no. |
| main_resources | Array of RelativeResource objects | Primary resource specified by resourceId. Primary resource to which the resource is attached, bound, included, or associated. For example, the primary resource of an IP address or a data disk can be a cloud server. If resourceId is attached to multiple resources, there will be multiple primary resources. For example, a shared disk is mounted to multiple cloud servers. If no primary resource is associated, leave this field empty, for example, when a data disk is not mounted to any cloud server. |
| extend_params | String | expireTime: expiration time, used for Domain Name Service (DNS). UTC time. Format: yyyy-MM-ddTHH:mm:ssZ. Example: 2016-06-28T00:00:00Z. |
| old_resource_id | String | This field is used only for ECS or BMS OS change. The resource ID changes with the cloud server OS. Enter the resource ID that was used before the change. This field is invalid if the resource ID does not change. |
| old_cloud_service_type | String | This field is used only for ECS or BMS OS change. Specifically, the cloud service type code changes with the cloud server OS. Enter the cloud service type code that was used before the change. This field is invalid if the cloud service type does not change. |
| old_resource_type | String | This parameter is used only for ECS or BMS OS change. The resource type code changes with the cloud server OS. Enter the old resource type code before the change. This field does not exist if the resource type does not change. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 404
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 405
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 503
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Example Requests
GET /v2/29dfe82ada564ac2b927e1ff036d9a9b/job/575768277444198400
Example Responses
Status code: 200
Response to a successful request.
{
"id" : "575768277444198400",
"job_type" : "CREATE_SERVER",
"begin_time" : "2023-06-06T02:30:06.836Z",
"end_time" : "2023-06-06T02:45:49.577Z",
"status" : "SUCCESS",
"sub_jobs_total" : 1,
"sub_jobs" : [ {
"id" : "575768277481947136",
"job_type" : "CREATE_SERVER",
"job_resource_info" : {
"resource_id" : "a2a6f5af-cbf7-4242-8988-109426870886",
"resource_name" : "APS-20230606023006-YM08IXT04C"
},
"begin_time" : "2023-06-06T02:30:06.902Z",
"end_time" : "2023-06-06T02:45:49.564Z",
"status" : "SUCCESS",
"error_code" : "",
"error_message" : "",
"project_id" : "a4da8115c9d8464ead3a38309130523f",
"job_id" : "575768277444198400"
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Response to a successful request. |
| 400 | The request cannot be understood by the server due to malformed syntax. |
| 401 | Authentication failed. |
| 403 | Permissions required. |
| 404 | Resources not found. |
| 405 | The method specified in the request is not allowed. |
| 500 | An internal service error occurred. For details, 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