DeleteImage

Last Updated: Dec 12, 2017

Description

Delete 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 Required parameter, with a value: DeleteImage.
RegionId String Yes The region ID of the image. See Regions and zones for region IDs.
ImageId String Yes ID of an image.
Force String No Value: true or false. The default value is “false”. When Force is set to “true”, the custom image is deleted without verifying whether any instance that are created using this image exists.

Response parameters

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

Error Code

Error code Error message HTTP status code Meaning
MissingParameter The input parameter RegionId that is mandatory for processing this request is not supplied. 400 RegionId field missing. See Regions and zones for region IDs.
MissingParameter The input parameter ImageId that is mandatory for processing this request is not supplied. 400 ImageId field missing.
ImageUsingByInstance The specified image has been used to create instances. 403 The specified image is still being used by an instance and cannot be deleted.
InvalidRegionId.NotFound The specified region does not exist. 404 Invalid RegionId value (or you may not have been authorized to use the region). See Regions and zones for region IDs.

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. }
Thank you! We've received your feedback.