ImportImage

Updated at:

Imports an image file from Object Storage Service (OSS) as a custom Cloud Desktop image and returns the image ID and version ID.

Operation description

Currently, only ProductType=CloudDesktop is supported. Upload the image file first, and then pass its OSS object path to initiate the import. You can call GetUploadInfo to obtain upload credentials. After the API returns the image and version IDs, you can call GetImageById or GetImageDistributeInfo to query the creation and distribution status. A successful response indicates that the import request has been accepted, not that the image is already available.

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

appstreaming:ImportImage

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

OssObjectPath

string

No

The complete OSS object URL of the image file to be imported, including the bucket domain name and file path. The file must be uploaded before you call this operation. Example: https://BucketName.oss-cn-hangzhou.aliyuncs.com/FilePath.

https://appstream-example.oss-cn-hangzhou.aliyuncs.com/tenant/100931896542****/task/image.vhd

ImageName

string

No

The name of the image after it is imported. This parameter cannot be empty.

DemoImage

OsType

string

No

The operating system type of the image file. It must be consistent with the actual operating system of the image, such as Windows or Linux.

Windows

SystemDiskSize

integer

No

The size of the system cloud disk. Unit: GiB.

40

ProtocolType

string

No

The image connection protocol. Valid values: ASP and HDX. Default value: ASP.

ASP

LicenseType

string

No

The operating system license type. Valid values:

  • Auto: Automatically selected.

  • Aliyun: Provided by Alibaba Cloud.

  • BYOL: Bring your own license. Default value: Auto.

Auto

Description

string

No

The description of the image.

Custom Cloud Desktop image

GpuCategory

boolean

No

Specifies whether the image is a GPU image. Valid values:

  • true: Yes.

  • false: No.

GpuDriverType

string

No

The GPU driver type. Valid values:

  • gpu_grid9: GRID 9 driver.

  • gpu_grid12: GRID 12 driver.

  • gpu_custom: Custom driver.

gpu_grid12

EnableSecurityCheck

boolean

No

Specifies whether to enable the image security check. Valid values:

  • true: Enabled.

  • false: Disabled.

BizType

integer

No

The business line to which the image belongs. Default value: 1.

Valid values:

  • 1 :

    Enterprise Edition.

  • 10 :

    Personal Edition.

  • 20 :

    Commercial Edition.

1

ProductType

string

No

The product type. Currently, only CloudDesktop (Cloud Desktop) is supported.

CloudDesktop

BizRegionId

string

No

The business region ID, such as cn-hangzhou.

cn-hangzhou

BootMode

string

No

The image boot mode. Valid values:

  • BIOS: Legacy BIOS boot.

  • UEFI: UEFI boot.

UEFI

Response elements

Element

Type

Description

Example

object

The API call result.

Data

object

The image identifiers returned for the import request.

ImageId

string

The image ID.

imgc-xxxx

VersionId

string

The image version ID.

iv-xxx

Success

boolean

Indicates whether the API call is successful. Valid values:

  • true: Successful.

  • false: Failed.

Code

string

The response code. A value of 200 indicates success. If the call fails, the corresponding error code is returned.

200

Message

string

The processing message returned by the API.

success

RequestId

string

The request ID, which is used to locate and troubleshoot the request.

8737D130-BFD0-5D51-96F6-C08EB1139A25

Examples

Success response

JSON format

{
  "Data": {
    "ImageId": "imgc-xxxx",
    "VersionId": "iv-xxx"
  },
  "Success": false,
  "Code": "200",
  "Message": "success",
  "RequestId": "8737D130-BFD0-5D51-96F6-C08EB1139A25"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidImageOperation.Failed Invalid image operation. Image operation failed.
400 InternalError Internal error. An internal error occurred.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.