Help Center/ Workspace/ API Reference/ Workspace Application Streaming APIs/ Task Management/ Querying Task Execution Statuses (discarded)
Updated on 2026-05-21 GMT+08:00

Querying Task Execution Statuses (discarded)

Function

Queries the job execution status.

job_id, which is returned after the creation of an Application Streaming server starts. job_id can be used for querying the job execution status.

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 /v1/{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

job

JobDetail object

Job details.

Table 4 JobDetail

Parameter

Type

Description

job_id

String

Job ID.

job_type

Integer

Task type. The value is fixed to 1.

job_status

Integer

Task execution status.

0: failed (If a subscription fails, CBC refunds the fee to the customer after confirming the subscription status. If a change fails, an O&M service ticket is generated, and the fee will not be refunded to the customer.)

1: successful (Request handling succeeded.)

2: handling

3: initializing

sub_jobs

Array of SubJobInfo objects

Subjob information.

begin_time

String

Start time for handling a job.

end_time

String

End time for handling a job.

expected_end_time

String

Estimated job processing end time of the cloud service. This parameter is valid only for jobs.

execute_code

String

Result code for job execution.

execute_message

String

Description of the execution result of the job and subjobs.

Table 5 SubJobInfo

Parameter

Type

Description

job_id

String

Subjob ID.

job_type

Integer

Job type. The value is fixed to 2, indicating a subjob.

job_status

Integer

Job status. Options:

0: failed.

1: successful.

2: processing.

3: initializing.

entities

Array of JobResourceInfo objects

The cloud service/resource object to be processed in a subjob. This field is mandatory for object creation and specification change, and optional for scenarios such as freezing, unfreezing, and deletion.

begin_time

String

Job start time.

end_time

String

Job end time.

expected_end_time

String

Estimated job processing end time of the cloud service. This parameter is valid only for jobs.

execute_code

String

Result code for job execution.

execute_message

String

Description of the execution result of the job and subjobs.

Table 6 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 7 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 8 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 9 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 10 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 11 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 12 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 13 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 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Example Requests

GET /v1/29dfe82ada564ac2b927e1ff036d9a9b/job/575768277444198400

Example Responses

Status code: 200

Response to a successful request.

{
  "job" : {
    "job_id" : "575768277444198400",
    "job_type" : 1,
    "job_status" : 0,
    "sub_jobs" : [ {
      "job_id" : "575768277481947136",
      "job_type" : 2,
      "job_status" : 0,
      "entities" : [ ],
      "begin_time" : "2023-06-06T02:30:06Z",
      "end_time" : "2023-06-06T02:45:49Z"
    } ],
    "begin_time" : "2023-06-06T02:30:06Z",
    "end_time" : "2023-06-06T02:45:49Z",
    "expected_end_time" : "2023-06-06T15:55:57Z",
    "execute_code" : "",
    "execute_message" : ""
  }
}

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.