Help Center/ Workspace/ API Reference/ Workspace APIs/ Scheduled Tasks/ Querying Lifecycle Type Configurations
Updated on 2026-05-21 GMT+08:00

Querying Lifecycle Type Configurations

Function

Queries the Apollo configuration item life.cycle.type.action based on the type to obtain the corresponding configuration information. If type is not transferred, all configuration items are returned.

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:scheduledTasks:listLifeCycleConfigurations

    List

    -

    -

    -

    -

URI

GET /v2/{project_id}/scheduled-tasks/life-cycle-type/configurations

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

type

No

String

Triggering condition type. The value can be POST_CREATE_DESKTOP_SUCCESS (after the desktop is created), POST_REBUILD_DESKTOP_SUCCESS (after the desktop is rebuilt), POST_REATTACH_DESKTOP_SUCCESS (after the desktop assignment task for triggering the rebuilding is successfully executed), POST_DESKTOP_DISCONNECTED (after the desktop is disconnected), or POST_DESKTOP_CANNOT_CONNECT (when the desktop cannot be connected). If this parameter is not transferred, all configuration items are returned.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

{User defined key}

Map<String,LifeCycleTypeConfigRsp>

Response to the request for configuring the lifecycle type.

Table 4 LifeCycleTypeConfigRsp

Parameter

Type

Description

min_wait_time

Integer

Minimum waiting duration, in minutes.

default_wait_time

Integer

Default waiting duration, in minutes.

min_exec_time

Integer

Minimum execution period, in minutes.

default_exec_time

Integer

Default execution period, in minutes.

support_exec_time

Boolean

Whether the execution period is supported.

actions

Array of ActionConfig objects

List of actions that can be performed.

Table 5 ActionConfig

Parameter

Type

Description

action

String

Action name. The value can be STOP (stopping a desktop), HIBERNATE (hibernating a desktop), REBOOT (restarting a desktop), or EXECUTE_SCRIPT (executing a script).

min_wait_time

Integer

Minimum waiting duration, in minutes. If the parameter is not specified, the parent min_wait_time is used.

default_wait_time

Integer

Default waiting duration, in minutes. If the parameter is not specified, the parent min_wait_time is used.

min_exec_time

Integer

Minimum execution period, in minutes. If the parameter is not specified, the parent min_exec_time is used.

default_exec_time

Integer

Default execution period, in minutes. If the parameter is not specified, the parent default_exec_time is used.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

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 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

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

None

Example Responses

Status code: 200

OK.

{
  "POST_CREATE_DESKTOP_SUCCESS" : {
    "min_wait_time" : 0,
    "default_wait_time" : 0,
    "min_exec_time" : 0,
    "default_exec_time" : 0,
    "actions" : [ {
      "action" : "STOP"
    }, {
      "action" : "HIBERNATE"
    }, {
      "action" : "REBOOT"
    }, {
      "action" : "EXECUTE_SCRIPT"
    } ]
  },
  "POST_DESKTOP_CANNOT_CONNECT" : {
    "min_wait_time" : 0,
    "default_wait_time" : 10,
    "min_exec_time" : 0,
    "default_exec_time" : 1440,
    "actions" : [ {
      "action" : "STOP"
    }, {
      "action" : "HIBERNATE"
    }, {
      "action" : "REBOOT",
      "min_wait_time" : 3,
      "default_wait_time" : 10,
      "min_exec_time" : 60,
      "default_exec_time" : 1440
    }, {
      "action" : "EXECUTE_SCRIPT"
    } ]
  }
}

Status Codes

Status Code

Description

200

OK.

400

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

500

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

Error Codes

See Error Codes.