ImportImage
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
Test
RAM authorization
|
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 |
| 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:
|
|
| GpuDriverType |
string |
No |
The GPU driver type. Valid values:
|
gpu_grid12 |
| EnableSecurityCheck |
boolean |
No |
Specifies whether to enable the image security check. Valid values:
|
|
| BizType |
integer |
No |
The business line to which the image belongs. Default value: 1. Valid values:
|
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:
|
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:
|
|
| 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.