Help Center/ Workspace/ API Reference/ Workspace APIs/ Upgrade Policy Management Service/ Updating Application Objects of an Upgrade Policy in Batches
Updated on 2026-07-24 GMT+08:00

Updating Application Objects of an Upgrade Policy in Batches

Function

Performs batch operations on application objects associated with a specified policy.

  • Two operation types are supported: batch deletion and batch addition.

  • If operate_type is set to 1, batch deletion is performed. If operate_type is set to 2, batch addition is performed.

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:upgradeStrategy:updateApplyObjects

    Write

    -

    -

    -

    -

URI

POST /v2/{project_id}/upgrade-strategy/{strategy_id}/apply-objects

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

strategy_id

Yes

String

Policy ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

operate_type

Yes

Integer

Operation type. The value can be 1 (batch deletion) or 2 (batch addition).

delete_ids

No

Array of strings

List of IDs of application objects to be deleted in batches (This parameter is mandatory when operate_type is set to 1.)

add_objects

No

Array of ApplyObjectInfo objects

List of application objects to be added in batches (This parameter is mandatory when operate_type is set to 2.)

Table 3 ApplyObjectInfo

Parameter

Mandatory

Type

Description

object_type

No

String

Application object type. The value can be DESKTOP (single desktop), ALL_DESKTOPS (all desktops), DESKTOP_POOL (desktop pool), DESKTOP_TAG (desktop tag), ALL_USERS (all users), USER (single user), and USER_GROUP (user group).

object_id

No

String

Object ID. This value can be null when object_type is set to ALL_DESKTOPS or ALL_USERS.

Response Parameters

Status code: 200

ok

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Service error code.

error_msg

String

Service error message.

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Service error code.

error_msg

String

Service error message.

Example Requests

{
  "operate_type" : 1,
  "delete_ids" : [ ],
  "add_objects" : [ {
    "object_type" : "DESKTOP",
    "object_id" : "desktop-001"
  } ]
}

Example Responses

Status code: 200

ok

{
  "strategy_ids" : [ "strategy-001" ]
}

Status Codes

Status Code

Description

200

ok

400

Invalid request parameter.

500

Internal server error.

Error Codes

See Error Codes.