DeleteSnapshot

Last Updated: Mar 14, 2018

Description

Deletes a specified snapshot. If you want to cancel a snapshot creating task, you can call this interface. When you call this interface, consider the following:

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

  • You cannot delete the snapshot if it has been used to create a custom image (CreateImage). However, you can delete the appropriate custom image (DeleteImage) before you try the DeleteSnapshot action again.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: DeleteSnapshot.
SnapshotId String Yes Snapshot ID.

Response parameters

All are common error codes. For more information, see Common error codes.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=DeleteSnapshot
  2. &SnapshotId=s-923FE2BF0
  3. &<Common Request Parameters>

Response example

XML format

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

JSON format

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

Error codes

Error code Error message HTTP status code Meaning
MissingParameter The input parameter SnapshotId that is mandatory for processing this request is not supplied. 400 You must specify the required parameter SnapshotId.
SnapshotCreatedDisk The snapshot has been used to create disk(s). 403 The specified snapshot has already been used to create a disk.
SnapshotCreatedImage The snapshot has been used to create user defined image(s). 403 The specified snapshot has been used to create a custom image.
Thank you! We've received your feedback.