DeleteImage

Last Updated: Feb 12, 2018

Description

Deletes a specified custom image.

  • A deleted image cannot be used again to create or reset an ECS instance.

  • If the specified image does not exist, the request is ignored.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: DeleteImage.
RegionId String Yes ID of an Alibaba Cloud region to where the image belongs. See Regions and zones for region IDs.
ImageId String Yes ID of an image.
Force String No Whether to directly delete the custom image or not. Optional values:
  • true: Directly delete the custom image, and ignore the usage status of the image.
  • false: Verify whether the image has been used by any instance before the deletion.
Default value: false.

Response parameters

All are common response parameters. For more information, see Common parameters.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=DeleteImage
  2. &RegionId=cn-hangzhou
  3. &ImageId=m-63DFD5FB2
  4. &<Common Request Parameters>

Response example

XML format

  1. <DeleteImageResponse>
  2. <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
  3. </DeleteImageResponse>

JSON format

  1. {
  2. "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
  3. }

Error codes

Error code Error message HTTP status code Meaning
ImageUsingByInstance The specified image has been used to create instances. 403 The specified image is used by other instances and cannot be deleted.
ImageIsCreating The specified image is being created. 403 The specified custom image is being created, please try again later.
ImageUseShared The specified image has been shared to others. 403 The specified image cannot be deleted because you have shared it to other users.
OperationDenied.ImageCopying The specified image is being copied. 403 The specified custom image is being copied, please try again later.
InvalidRegionId.NotFound The specified region does not exist. 404 The specified RegionId does not exist. For more information, see Regions and zones.
Thank you! We've received your feedback.