All Products
Search
Document Center

App Streaming:CreateImageByInstance

Last Updated:Dec 17, 2025

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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 Resources is 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.
OperationAccess levelResource typeCondition keyAssociated operation
appstreaming:CreateImageByInstancecreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ImageNamestringNo

The name of the image.

test
DescriptionstringNo

The description of the image.

my test image v1.0
InstanceIdstringNo

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******
SubInstanceIdstringNo

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*****
InstanceTypestringNo

The instance type.

Valid values:

  • CloudDesktop: Cloud Desktop.
  • WuyingServer: Workstation
WuyingServer
AutoCleanUserdatabooleanNo

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:

  • true: cleanup.
  • false: does not clear.
false
DiskTypestringNo

The type of disk data contained in the image. By default, the system disk and data disk of the instance are included.

Valid values:

  • SYSTEM: only system disk.
  • ALL: system disk + data disk
ALL
BizTypeintegerNo

This parameter is not publicly available.

1
ProductTypestringNo

This parameter is not publicly available.

WuyingServer

Response parameters

ParameterTypeDescriptionExample
object

The request response structure.

Dataobject

The returned data.

ImageIdstring

The ID of the RDS image.

imgc-07hnjj5fp****
VersionIdstring

The version of the image.

iv-0abxi0lbi*****
TaskIdstring

The ID of the image creation task.

tid-0abxi0lbih******
Successboolean

Indicates whether the request was successful. Valid values: true and false.

true
Codestring

The error code.

200
Messagestring

The error message.

NULL
RequestIdstring

The request ID.

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

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 codeError codeError messageDescription
400Instance.NotFoundThe instance is not found.The instance is not found.
400DesktopInstance.NotFoundThe cloud computer instance does not exist.The cloud computer instance does not exist.
400Instance.ImageUnsupportedA non-centralized image does not support this type of operation.A non-centralized image does not support this type of operation.
400Instance.PhysicalNodeNotExistThe instance physical node does not exist.The physical node of this instance does not exist.
400ImageCreateByInstance.TaskExistThe image task of instance creation already exists.The image task of instance creation already exists.
400ExceedBuilderQuotaThe maximum number of builders is reached.The maximum number of builders is reached.
400InvalidBaseImage.NotConfiguredConfiguration required for Vhd/Container images.Configuration required for Vhd/Container images.
400CreateDesktopImageRecord.FailedCreate cloud computer image failed.Failed to create the cloud computer image.
400Image.NotExistThe image does not exist.The image does not exist.
400ImageRegionDistribute.NotAllowThis image cannot be distributed.This image cannot be distributed.
400ImageUpdateFailed.NotAllowThe image is not allowed to be modified.The image is not allowed to be modified.
400ImageUpdateSharedImageFailed.NotAllowThe shared image is not allowed to be modified.The shared image is not allowed to be modified.
400ParentImageRegionDistribute.NotExistThe target distribution region of the parent image does not exist.The target distribution region of the parent image does not exist.
400InternalErrorInternal error.-

For a list of error codes, visit the Service error codes.