Create a custom image from a deployed instance. This allows you to quickly create more instances with the same configurations and avoid repeatedly configuring the instance environment each time you create the instance.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| appstreaming:CreateImageByInstance | create | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ImageName | string | No | The name of the image. | test |
| Description | string | No | The description of the image. | my test image v1.0 |
| InstanceId | string | No | The ID of the RDS instance. The instance can be a CloudDesktop instance, a workstation instance. To ensure data consistency in the image, we recommend that you shut down the instance before you create an image. | ws-0buj1s9gm****** |
| SubInstanceId | string | No | The ID of the child instance. This parameter is not used in cloud computing scenarios. Workstation scenarios, you need to specify a persistent session ID to ensure that a specific instance is located. | p-0cc7s3n1l***** |
| InstanceType | string | No | The instance type. Valid values:
| WuyingServer |
| AutoCleanUserdata | boolean | No | This parameter is applicable only to scenarios in which the instance type is Cloud Desktop. Specifies whether to clear private data of users. If this parameter is set to true, the created image clears data in directories other than Administrator and Public in the C:\Users directory. Valid values:
| false |
| DiskType | string | No | The type of disk data contained in the image. By default, the system disk and data disk of the instance are included. Valid values:
| ALL |
| BizType | integer | No | This parameter is not publicly available. | 1 |
| ProductType | string | No | This parameter is not publicly available. | WuyingServer |
Response parameters
Examples
Sample success responses
JSONformat
{
"Data": {
"ImageId": "imgc-07hnjj5fp****",
"VersionId": "iv-0abxi0lbi*****",
"TaskId": "tid-0abxi0lbih******"
},
"Success": true,
"Code": 200,
"Message": "NULL",
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | Instance.NotFound | The instance is not found. | The instance is not found. |
| 400 | DesktopInstance.NotFound | The cloud computer instance does not exist. | The cloud computer instance does not exist. |
| 400 | Instance.ImageUnsupported | A non-centralized image does not support this type of operation. | A non-centralized image does not support this type of operation. |
| 400 | Instance.PhysicalNodeNotExist | The instance physical node does not exist. | The physical node of this instance does not exist. |
| 400 | ImageCreateByInstance.TaskExist | The image task of instance creation already exists. | The image task of instance creation already exists. |
| 400 | ExceedBuilderQuota | The maximum number of builders is reached. | The maximum number of builders is reached. |
| 400 | InvalidBaseImage.NotConfigured | Configuration required for Vhd/Container images. | Configuration required for Vhd/Container images. |
| 400 | CreateDesktopImageRecord.Failed | Create cloud computer image failed. | Failed to create the cloud computer image. |
| 400 | Image.NotExist | The image does not exist. | The image does not exist. |
| 400 | ImageRegionDistribute.NotAllow | This image cannot be distributed. | This image cannot be distributed. |
| 400 | ImageUpdateFailed.NotAllow | The image is not allowed to be modified. | The image is not allowed to be modified. |
| 400 | ImageUpdateSharedImageFailed.NotAllow | The shared image is not allowed to be modified. | The shared image is not allowed to be modified. |
| 400 | ParentImageRegionDistribute.NotExist | The target distribution region of the parent image does not exist. | The target distribution region of the parent image does not exist. |
| 400 | InternalError | Internal error. | - |
For a list of error codes, visit the Service error codes.
