Updated on 2026-05-21 GMT+08:00

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}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique ID of a project

job_id

Yes

String

Job ID.

Request Parameters

Table 2 Request header 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

Table 3 Response body parameters

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.

Table 4 JobDetailInfo

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.

Table 5 JobResourceInfo

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.

  • hws.service.type.vdi

  • hws.service.type.marketplace

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.

Table 6 RelativeResource

Parameter

Type

Description

relative_resource_id

String

Associated resource ID.

relative_resource_name

String

If a cloud resource has a name, resourceName is returned. If the value is empty, "" is returned.

relative_type

Integer

  • Association type, which describes the relationship between relativeResourceId and resourceId. Options:

    • However, they can be used or make transactions separately without affecting the use of the entire cloud service, such as cloud servers and data disks. *

    1: binding (strong association), indicating that relativeResourceId and resourceId are strongly associated with each other.

0: mounting (weak association), indicating that relativeResourceId and resourceId are associated with each other.

They must be used together for transactions. If either of them is missing, the entire cloud service is unavailable, such as cloud servers and data disks.

The default value is 0 (mounting).

This field is mandatory for RelativeResource in subResources, and optional for RelativeResource in mainResources.

relative_cloud_service_type

String

Depended cloud service type.

  • hws.service.type.ec2

relative_resource_type

String

Depended resource type.

  • hws.resource.type.vm

extend_params

String

Extended information in key-value pair format.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 405

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 500

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 503

Table 13 Response body parameters

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.