You need to enable JavaScript to run this app.
导航

DeleteImages

最近更新时间2024.03.22 16:45:43

首次发布时间2022.07.01 09:23:23

调用 DeleteImages 接口删除已导入的自定义镜像。

调试

请求参数

名称类型是否必填示例值描述
ActionStringDeleteImages要执行的操作,取值:DeleteImages
VersionString2020-04-01接口的版本,取值:2020-04-01。

ImageIds.N

String

ImageIds.1=image-ebgy1og99tfct0******&ImageIds.2=image-2asdv4n6ay3vj0******

自定义镜像ID,最多支持100个ID。您可以调用DescribeImages接口并传入Visibility=private参数,查询获取自定义镜像ID。

  • 参数 -N:表示镜像的序号。
  • 多个Image ID之间用&分隔。

DeleteBindedSnapshots

Boolean

false

删除镜像是否同时删除快照或快照一致性组。取值:

  • true(默认):删除
  • false:不删除

返回数据

名称类型
示例值
描述
OperationDetailsArray of struct-自定义镜像操作详情,具体请参见“ ImageOperationResult 结构 ”。

ImageOperationResult 结构

名称类型示例值描述
ImageIdStringimage-ebgy1og99tfct0******镜像ID。
ErrorStruct-某个镜像删除失败的错误信息。具体请参见“ Error 结构 ”。

Error 结构

名称类型示例值描述
CodeStringInvalidImage.NotFound批量请求处理中,单个请求操作失败的错误码,具体请参见下表“错误码(批量操作时具体单个请求失败的异常)”。
MessageStringThe specified image does not exist.批量请求处理中,单个请求的异常信息。具体请参见下表“错误码(批量操作时具体单个请求失败的异常)”中的错误信息。

错误码(批量操作时具体单个请求失败)

错误码错误信息描述
InvalidImage.NotFoundThe specified image does not exist.指定的镜像不存在。
InvalidImageStatusThe specified image is not in the correct status for the request.当前镜像状态不支持此操作。
InvalidImage.SharedThe specified image has already been shared and may be in use by other users.指定的镜像已被共享给其他用户。
OperationDenied.ImageIsCopyingThe specified operation is denied as your image is copying.指定的操作被拒绝,因为该镜像正在复制。
OperationDenied.ImageIsExportingThe specified operation is denied as your image is exporting.指定的操作被拒绝,因为该镜像正在导出。
InternalErrorAn internal error has occurred.内部错误,请重试。如果多次尝试失败,请提交工单。

请求示例

GET /?Action=DeleteImages&Version=2020-04-01&ImageIds.1=image-ebgy1og99tfct0****** HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: ecs

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20210611144510010225243100005******",
        "Action": "DeleteImages",
        "Version": "2020-04-01",
        "Service": "ecs",
        "Region": "cn-beijing"
    },
    "Result": {
        "OperationDetails": [
            {
                "ImageId": "image-ebgy1og99tfct0******",
                "Error": {
                    "Code": "InvalidImage.NotFound",
                    "Message": "The specified image does not exist."
                }
            }
        ]
    }
}

错误码

HttpCode错误码错误信息描述
400MissingParameter.ImageIdThe required parameter ImageId is not supplied.镜像ID不能为空。
400InvalidArgumentThe specified argument is invalid.指定的参数不合法。
400LimitExceeded.MaximumImageIdsYou've reached the limit on the number of ImageIds that you can set.指定的镜像ID数量超过限制。
500InternalErrorAn internal error has occurred.内部错误,请重试。如果多次尝试失败,请提交工单。