Updated on 2026-02-10 GMT+08:00

Querying Task Details

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, 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}/workspace-jobs/{job_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

job_id

Yes

String

Task ID.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

id

String

Task ID.

job_type

String

Task type.

begin_time

String

Task start time.

end_time

String

Task end time.

status

String

Task status.

job_error_code

String

Task error code.

fail_reason

String

Task failure cause.

sub_jobs_total

Integer

Total number of subtasks.

sub_jobs

Array of JobDetailInfo objects

Subtasks.

Table 3 JobDetailInfo

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.

Table 4 JobEntities

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: 404

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

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: default

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

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-jobs/2382dd96-xxxxx56d-axxxc4b09a35b58

Example Responses

Status code: 200

Response to the request for querying task details.

{
  "id" : "3eeb93ab-3bd0-431e-8260-94733f216785",
  "job_type" : "createDesktops",
  "begin_time" : "2025-04-28T09:53:55Z",
  "end_time" : "2025-04-28T10:01:46Z",
  "status" : "COMPLETE",
  "sub_jobs_total" : 1,
  "sub_jobs" : [ {
    "id" : "362767c6-691c-473d-b533-af80af26a00a",
    "job_type" : "createDesktops",
    "entities" : {
      "desktop_id" : "cf0a55ac-ca64-4e20-999c-ce9b68a80f61",
      "product_id" : "workspace.x86.ultimate.xlarge2",
      "user_name" : "LOCAL\\dsa",
      "ip_address" : "10.1.0.169"
    },
    "begin_time" : "2025-04-28T09:54:27Z",
    "end_time" : "2025-04-28T10:01:45Z",
    "status" : "SUCCESS",
    "error_code" : "",
    "fail_reason" : "",
    "job_id" : "3eeb93ab-3bd0-431e-8260-94733f216785",
    "process" : 100
  } ]
}

Status Codes

Status Code

Description

200

Response to the request for querying task details.

404

No resources found.

default

Default response to a failure.

Error Codes

See Error Codes.