Help Center/ Workspace/ API Reference/ Workspace APIs/ Desktop Pools/ Querying the Script Execution Task List of a Desktop Pool
Updated on 2025-07-14 GMT+08:00

Querying the Script Execution Task List of a Desktop Pool

Function

Desktop pool script execution task list.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/desktop-pools/script-execution-tasks/detail

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

desktop_pool_id

No

String

Desktop pool ID.

script_id

No

String

Script ID.

script_name

No

String

Script name.

status

No

String

Execution status. The value can be SUCCESS (execution succeeded), FAILED (execution failed), RUNNING (being executed), or WAITING (waiting for execution).

task_type

No

String

Type of the task to be queried. SCRIPT and COMMAND are supported.

offset

No

Integer

Start position for pagination query. The value starts from 0.

limit

No

Integer

Maximum number of desktops that can be returned in a pagination query. The value ranges from 0 to 100. The default value is 10.

execute_time_start

No

String

Start time of the query by execution time. If this parameter is specified, all task records after this time are returned. A time example is 2021-10-01T12:00:00Z.

execute_time_end

No

String

End time of the query by execution time. If this parameter is specified, all task records before this time are returned. A time example is 2021-10-01T12:00:00Z.

task_id

No

Array of strings

Task ID.

Request Parameters

Table 3 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 4 Response body parameters

Parameter

Type

Description

script_execution_tasks

Array of ScriptExecutionTask objects

Script execution task list.

total_count

Integer

Total number.

Table 5 ScriptExecutionTask

Parameter

Type

Description

id

String

Task ID.

desktop_pool_id

String

Desktop pool ID.

desktop_pool_name

String

Desktop pool name.

scripts

Array of Script objects

Script information list.

command_content

String

Indicates the command to be executed.

command_type

String

Indicates the command line type.

  • POWERSHELL: used by the Windows operating system.

  • BAT: used by the Windows operating system.

  • SHELL: used by the Linux system.

start_time

String

Task start time in the "yyyy-MM-ddTHH:mm:ssZ" format.

end_time

String

Task end time in the "yyyy-MM-ddTHH:mm:ssZ" format.

status

String

Task status. The value can be:

  • FINISH: The task has been completed.

  • FAILED: The task failed.

  • RUNNING: The task is being executed.

  • INIT: The task is being initialized.

success_num

Integer

Number of successes.

failed_num

Integer

Number of failures.

skip_num

Integer

Number of skips.

Table 6 Script

Parameter

Type

Description

id

String

Script ID.

name

String

Script name.

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 description.

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

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error description.

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

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error description.

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

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error description.

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

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error description.

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

/v2/0bec5db98280d2d02fd6c00c2de791ce/desktops-pools/script-execution-tasks/detail

Example Responses

Status code: 200

Normal.

{
  "script_execution_tasks" : [ {
    "id" : "string",
    "desktop_pool_id" : "string",
    "desktop_pool_name" : "string",
    "scripts" : [ {
      "id" : "string",
      "name" : "string"
    } ],
    "command_content" : "string",
    "command_type" : "string",
    "start_time" : "string",
    "end_time" : "string",
    "status" : "string",
    "success_num" : 0,
    "failed_num" : 0,
    "skip_num" : 0
  } ],
  "total_count" : 0
}

Status Codes

Status Code

Description

200

Normal.

400

The request cannot be understood by the server due to malformed syntax.

401

Authentication failed.

403

No operation permissions.

404

No resources found.

500

An internal service error occurred. For details about the error code, see the error code description.

Error Codes

See Error Codes.