RebuildDesktops

更新时间:
复制 MD 格式

Replaces the image of one or more cloud computers.

Operation description

This operation is subject to the following limitations:

  • For cloud computers in the China (Hong Kong) region and regions outside the Chinese mainland, you cannot switch to an image with a different operating system. For example, you cannot switch from a Windows image to a Linux image.

  • You cannot switch between GPU images and non-GPU images. Graphics-optimized cloud computers must use GPU images, and non-graphics cloud computers can only use non-GPU images.

Changing the image re-initializes the cloud computer's system disk with the new image. This action has the following effects:

  • All data on the original system disk is erased. Any snapshots created from the original system disk become invalid, and the system automatically deletes them.

  • If the new image has a different operating system, all data on the data disk is erased. Snapshots created from the data disk become invalid, and the system automatically deletes them. If the new image has the same operating system, data on the data disk is retained and its snapshots remain usable.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecd:RebuildDesktops

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation to find the regions where Elastic Desktop Service is available.

cn-hangzhou

DesktopId

array

Yes

The IDs of the cloud computers to rebuild. You can specify 1 to 20 IDs.

ecd-gx2x1dhsmucyy****

string

No

The desktop ID.

ecd-gx2x1dhsmucyy****

ImageId

string

No

The ID of the new image.

m-84mztzatmlnys****

OperateType

string

No

Specifies how to handle the data disk.

Note

This parameter is optional.

  • If a cloud computer does not have a data disk, this parameter is ignored.

  • If a cloud computer has a data disk:
    1. If the new image has the same operating system as the original one:
      • If you set this parameter to replace, the data disk is replaced.

      • If you do not specify this parameter, the data disk is retained.

    2. If the new image has a different operating system:
      • If you set this parameter to replace, the data disk is replaced.

      • If you do not specify this parameter, the data disk is erased.

replace

Language

string

No

The operating system language. This parameter applies only to system images. For Linux cloud computers, only English is supported.

Valid values:

  • en-US :

    English

  • zh-HK :

    Traditional Chinese (Hong Kong)

  • zh-CN :

    Simplified Chinese

  • ja-JP :

    Japanese

en-US

AfterStatus

string

No

Response elements

Element

Type

Description

Example

object

The response object.

RequestId

string

The request ID.

1CBAFFAB-B697-4049-A9B1-67E1FC5F****

RebuildResults

array<object>

The rebuild results.

object

The rebuild result.

Code

string

The operation result. A value of Success indicates the rebuild was initiated. Otherwise, an error code is returned.

IncorrectDesktopStatus

Message

string

The error message. This parameter is returned only if the value of Code is not Success.

The current status of the desktop does not support this operation.

DesktopId

string

The desktop ID.

ecd-gx2x1dhsmucyy****

  • If the HTTP status code is 200, the request was successful. The RebuildResults array shows the outcome for each cloud computer: a Code of Success indicates the rebuild has started; otherwise, the returned error code explains why the process failed to start.

  • A 4xx HTTP status code indicates an invalid parameter. In this case, the rebuild is not initiated for any of the specified cloud computers.

Examples

Success response

JSON format

{
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****",
  "RebuildResults": [
    {
      "Code": "IncorrectDesktopStatus",
      "Message": "The current status of the desktop does not support this operation.",
      "DesktopId": "ecd-gx2x1dhsmucyy****"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.