通过已部署好的无影实例创建自定义镜像,以便快速创建更多相同配置的无影实例,避免每次创建时重复配置实例环境。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
 - 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
 - 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
 - 对于不支持资源级授权的操作,用
全部资源表示。 
 - 条件关键字:是指云产品自身定义的条件关键字。
 - 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
 
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 | 
|---|---|---|---|---|
| appstreaming:CreateImageByInstance | create | *全部资源 * | 
  | 无 | 
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| ImageName | string | 否 | 镜像名称。  | test | 
| Description | string | 否 | 镜像描述。  | my test image v1.0 | 
| InstanceId | string | 否 | 无影实例 ID。该实例可以是云桌面实例,工作站实例。为了保障镜像中的数据数据一致性, 建议将实例关机之后再发起镜像制作。  | ws-0buj1s9gm****** | 
| SubInstanceId | string | 否 | 子实例 ID,云电脑场景不涉及。工作站场景,需要传入持久会话 ID,确保定位到一个具体的实例。  | p-0cc7s3n1l***** | 
| InstanceType | string | 否 | 实例类型。 枚举值: 
  | WuyingServer | 
| AutoCleanUserdata | boolean | 否 | 该参数目前仅适用于实例类型是云桌面场景。 是否清除用户个人数据。若设为 true,制作的镜像会清除 C:\Users 目录下除 Administrator、Public 之外的其他目录的数据。 枚举值: 
  | false | 
| DiskType | string | 否 | 镜像中包含的磁盘数据种类,默认包含实例的系统盘和数据盘。 枚举值: 
  | ALL | 
| BizType | integer | 否 | 该参数暂不对外使用。  | 1 | 
| ProductType | string | 否 | 该参数暂不对外使用。  | WuyingServer | 
返回参数
示例
正常返回示例
JSON格式
{
  "Data": {
    "ImageId": "imgc-07hnjj5fp****",
    "VersionId": "iv-0abxi0lbi*****",
    "TaskId": "tid-0abxi0lbih******"
  },
  "Success": true,
  "Code": 200,
  "Message": "NULL",
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 400 | Instance.NotFound | The instance is not found. | 实例找不到。 | 
| 400 | DesktopInstance.NotFound | The cloud computer instance does not exist. | 云电脑实例不存在。 | 
| 400 | Instance.ImageUnsupported | A non-centralized image does not support this type of operation. | 使用非中心化镜像不支持该操作。 | 
| 400 | Instance.PhysicalNodeNotExist | The instance physical node does not exist. | 物理节点不存在。 | 
| 400 | ImageCreateByInstance.TaskExist | The image task of instance creation already exists. | 实例创建镜像任务已存在。 | 
| 400 | ExceedBuilderQuota | The maximum number of builders is reached. | Builder数量达到了上限。 | 
| 400 | InvalidBaseImage.NotConfigured | Configuration required for Vhd/Container images. | Vhd/Container镜像类型需要配置BaseImageId。 | 
| 400 | CreateDesktopImageRecord.Failed | Create cloud computer image failed. | 创建云电脑镜像失败。 | 
| 400 | Image.NotExist | The image does not exist. | 镜像不存在。 | 
| 400 | ImageRegionDistribute.NotAllow | This image cannot be distributed. | 镜像不允许分发操作。 | 
| 400 | ImageUpdateFailed.NotAllow | The image is not allowed to be modified. | 镜像不允许修改。 | 
| 400 | ImageUpdateSharedImageFailed.NotAllow | The shared image is not allowed to be modified. | 共享镜像不允许修改。 | 
| 400 | ParentImageRegionDistribute.NotExist | The target distribution region of the parent image does not exist. | 依赖父镜像分发地址不存在。 | 
| 400 | InternalError | Internal error. | 内部错误 | 
访问错误中心查看更多错误码。
