delete_backup

FSx.Client.delete_backup(**kwargs)

Deletes an Amazon FSx backup. After deletion, the backup no longer exists, and its data is gone.

The DeleteBackup call returns instantly. The backup won't show up in later DescribeBackups calls.

Warning

The data in a deleted backup is also deleted and can't be recovered by any means.

See also: AWS API Documentation

Request Syntax

response = client.delete_backup(
    BackupId='string',
    ClientRequestToken='string'
)
Parameters
  • BackupId (string) --

    [REQUIRED]

    The ID of the backup that you want to delete.

  • ClientRequestToken (string) --

    A string of up to 64 ASCII characters that Amazon FSx uses to ensure idempotent deletion. This parameter is automatically filled on your behalf when using the CLI or SDK.

    This field is autopopulated if not provided.

Return type

dict

Returns

Response Syntax

{
    'BackupId': 'string',
    'Lifecycle': 'AVAILABLE'|'CREATING'|'TRANSFERRING'|'DELETED'|'FAILED'|'PENDING'|'COPYING'
}

Response Structure

  • (dict) --

    The response object for the DeleteBackup operation.

    • BackupId (string) --

      The ID of the backup that was deleted.

    • Lifecycle (string) --

      The lifecycle status of the backup. If the DeleteBackup operation is successful, the status is DELETED .

Exceptions

  • FSx.Client.exceptions.BadRequest
  • FSx.Client.exceptions.BackupInProgress
  • FSx.Client.exceptions.BackupNotFound
  • FSx.Client.exceptions.BackupRestoring
  • FSx.Client.exceptions.IncompatibleParameterError
  • FSx.Client.exceptions.InternalServerError
  • FSx.Client.exceptions.BackupBeingCopied

Examples

This operation deletes an Amazon FSx file system backup.

response = client.delete_backup(
    BackupId='backup-03e3c82e0183b7b6b',
)

print(response)

Expected Output:

{
    'BackupId': 'backup-03e3c82e0183b7b6b',
    'Lifecycle': 'DELETED',
    'ResponseMetadata': {
        '...': '...',
    },
}