DeleteImage

Last Updated: Sep 13, 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 will be 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 will be deleted without verifying whether there is any instance that are created using this image.

Return Parameters

All are public return parameters. For details, see Public Return Parameters.

Error Code

Error Code Description 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 the user might not be 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. &<Public Request Parameters>

Return 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.