Delete a snapshot

Last Updated: Jul 25, 2017

Description

This API deletes the specified snapshot. If the snapshot being created (or not 100% completed) needs to be canceled, this API can be called to delete the snapshot (or canceling the creation of the snapshot).

  • If the snapshot with a specified ID does not exist, the request will be ignored.

  • If a snapshot has been used to create a custom image, the snapshot cannot be deleted. The snapshot can only be deleted after the appropriate custom image is deleted.

Request parameters

Name Type Required Description
Action String Yes Required parameter, value: DeleteSnapshot.
SnapshotId String Yes Snapshot ID.

Return parameters

The return parameters are all public return parameters. For details, refer to Public return parameters.

Error codes

Error code Description HTTP status code Meaning
SnapshotCreatedImage The snapshot has been used to create user defined image(s). 403 The specified snapshot has already been used to create a custom image.
SnapshotCreatedDisk The snapshot has been used to create disk(s). 403 The specified snapshot has already been used to create a disk.
MissingParameter The input parameter SnapshotId that is mandatory for processing this request is not supplied. 400 The required parameter SnapshotId is missing.

Example

Request example

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

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