Deletes a backup file.

Description

If you delete the most recent backup file for a data source, you must set the Force parameter to true. Otherwise, an error occurs.

Request parameters

Parameter Type Required Example Description
Action String Yes DeleteSnapshot

The operation that you want to perform. Set the value to DeleteSnapshot.

SnapshotId String Yes s-*********************

The ID of the backup file.

VaultId String No v-*********************

The ID of the backup vault.

ClientId String No c-*********************

The ID of the backup client. If you delete a backup file for Elastic Compute Service (ECS) instances, you must set one of the InstanceId and ClientId parameters.

SourceType String No ECS_FILE

The type of the backup source. Valid values:

  • ECS_FILE: indicates backup files for ECS instances.
  • OSS: indicates backup files for Object Storage Service (OSS) buckets.
  • NAS: indicates the backup files for Apsara File Storage NAS file systems.
InstanceId String No i-*********************

The ID of the ECS instance. If you delete a backup file for Elastic Compute Service (ECS) instances, you must set one of the ClientId and InstanceId parameters.

Force Boolean No false

Specifies whether to forcibly delete the most recent backup file. Valid values:

  • true: The system forcibly deletes the last backup file.
  • false: The system does not forcibly delete the last backup file. Default value: false.

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code. The status code 200 indicates that the request is successful.

Message String successful

The message that is returned. If the request is successful, a value of successful is returned. If the request fails, an error message is returned.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true: indicates that the request is successful.
  • false: indicates that the request fails.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DeleteSnapshot
&SnapshotId=s-*********************
&<Common request parameters>

Sample success responses

XML format

<DeleteSnapshotResponse>
  <Message>successful</Message>
  <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
  <Code>200</Code>
  <Success>true</Success>
</DeleteSnapshotResponse>

JSON format

{
    "Message": "successful",
    "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
    "Code": 200,
    "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.