最近更新时间:2023.07.12 14:11:16
首次发布时间:2022.09.02 08:59:36
调用 CreateImage 接口通过实例创建自定义镜像。
- 基于性能型SSD云盘的实例创建自定义镜像,必须先停止实例,方可调用本接口。
- 基于极速型SSD云盘的实例创建自定义镜像,无需停止实例,可直接调用本接口。
- 实例所在地域下自定义镜像数量不超过50个。
名称 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateImage | 要执行的操作,取值:CreateImage。 |
Version | String | 是 | 2020-04-01 | 接口的版本,取值:2020-04-01。 |
InstanceId | String | 是 | i-3teco18f1w5a71****** | 实例ID。您可以调用DescribeInstances接口查询获取实例ID。 |
ImageName | String | 是 | image-1 | 镜像名称。
|
Description | String | 否 | This is my first image | 镜像描述。
|
ProjectName | String | 否 | default | 资源所属项目。 注意 调用接口账号若仅拥有部分项目权限,本参数必填。授权账号操作项目详情,可查看管理项目权限。 |
Tags.N.Key | String | 否 | image-tag-key-1 | 镜像标签的标签键。
说明
|
Tags.N.Value | String | 否 | image-tag-value-1 | 镜像标签的标签值。
说明
|
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
ImageId | String | image-3teco18f1w5a71****** | 镜像ID。 |
GET /?Action=CreateImage&Version=2020-04-01&InstanceId=i-3teco18f1w5a71******&ImageName=image-1 HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing ServiceName: ecs
{ "ResponseMetadata":{ "RequestId":"2021110417394001022514606307*****", "Action":"CreateImage", "Version":"2020-04-01", "Service":"ecs", "Region":"cn-beijing" }, "Result": { "ImageId": "image-3teco18f1w5a71******" } }
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidInstanceStatus | The status of the specified instance does not support this request. | 当前实例的状态不支持此操作。 |
400 | MissingParameter.ImageName | The required parameter ImageName is not supplied. | 镜像名称不能为空。 |
400 | InvalidImageName.Malformed | The specified ImageName is malformed. | 指定的镜像名称不合法。 |
400 | InvalidDescription.Malformed | The specified Description is malformed. | 指定的镜像描述不合法。 |
400 | InvalidInstanceVolumeStatusForCreateImage.Unsupported | The specified instance volume status cannot be used for CreateImage. | 指定的实例云盘状态不支持创建自定义镜像。 |
400 | InvalidParameterCombination | Indicates an incorrect combination of parameters, or a missing parameter. | 参数组合错误或缺失。 |
400 | LimitExceeded.MaximumSystemVolumeSize | You've reached the limit on the number of system volume size that you can create. | 指定的系统盘大小(GiB)超出限制。 |
400 | LimitExceeded.MaximumImageCount | You've reached the limit on the number of image that you can create. | 可拥有的自定义镜像个数超过限制。 |
400 | InvalidTagKey.Malformed | The specified TagKey is malformed. | 指定的标签的键不合法。 |
400 | InvalidTagValue.Malformed | The specified TagValue is malformed. | 指定的标签的值不合法。 |
400 | LimitExceeded.MaximumTags | You've reached the limit on the number of tags that you can create. | 指定的标签数量超过最大限制。 |
404 | InvalidInstance.NotFound | The specified instance does not exist. | 指定的实例不存在。 |
404 | InvalidProject.NotFound | The specified Project does not exist. | 指定的Project不存在。 |
409 | InvalidTagKey.Conflict | The specified TagKey already exists. | 指定的标签键已存在。 |
412 | OperationDenied.ResourceLocked | The specified operation is denied as your resource is locked for another operation. | 指定的操作被拒绝,因为您的资源已被其他操作锁定。 |
500 | InternalError | An internal error has occurred. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |