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.
The data in a deleted backup is also deleted and can't be recovered by any means.
Parameters:
-
backup_id
(Optional[BackupId], default:
None
)
–
The ID of the backup that you want to delete.
-
client_request_token
(Optional[ClientRequestToken], default:
None
)
–
A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent deletion. This parameter is automatically filled on your behalf when using the CLI or SDK.
Raises:
-
BackupBeingCopied
–
You can't delete a backup while it's being copied.
-
BackupInProgress
–
Another backup is already under way. Wait for completion before initiating additional backups of this file system.
-
BackupNotFound
–
No Amazon FSx backups were found based upon the supplied parameters.
-
BackupRestoring
–
You can't delete a backup while it's being used to restore a file system.
-
BadRequest
–
A generic error indicating a failure with a client request.
-
IncompatibleParameterError
–
The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.
-
InternalServerError
–
A generic error indicating a server-side failure.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To delete a backup
This operation deletes an Amazon FSx file system backup.
>>> await client.delete_backup(backup_id='backup-03e3c82e0183b7b6b')
Source code in docs_src/capo_fsx/_services/async_f_sx.py
| async def delete_backup(
self,
*,
config_overrides: Optional[AsyncFSxClientConfig] = None,
backup_id: Optional["capo_fsx.types.backup_id.BackupId"] = None,
client_request_token: Optional[
"capo_fsx.types.client_request_token.ClientRequestToken"
] = None,
) -> "capo_fsx.types.delete_backup_response.DeleteBackupResponse":
"""<p>Deletes an Amazon FSx backup. After deletion, the backup no longer exists, and its data is gone.</p> <p>The <code>DeleteBackup</code> call returns instantly. The backup won't show up in later <code>DescribeBackups</code> calls.</p> <important> <p>The data in a deleted backup is also deleted and can't be recovered by any means.</p> </important>
Args:
backup_id: <p>The ID of the backup that you want to delete.</p>
client_request_token: <p>A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent deletion. This parameter is automatically filled on your behalf when using the CLI or SDK.</p>
Raises:
capo_fsx.errors.backup_being_copied.BackupBeingCopied: <p>You can't delete a backup while it's being copied.</p>
capo_fsx.errors.backup_in_progress.BackupInProgress: <p>Another backup is already under way. Wait for completion before initiating additional backups of this file system.</p>
capo_fsx.errors.backup_not_found.BackupNotFound: <p>No Amazon FSx backups were found based upon the supplied parameters.</p>
capo_fsx.errors.backup_restoring.BackupRestoring: <p>You can't delete a backup while it's being used to restore a file system.</p>
capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
capo_fsx.errors.incompatible_parameter_error.IncompatibleParameterError: <p>The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.</p>
capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To delete a backup
This operation deletes an Amazon FSx file system backup.
>>> await client.delete_backup(backup_id='backup-03e3c82e0183b7b6b')
"""
async def _handler(
req: "AsyncOperationRequest[capo_fsx.types.delete_backup_request.DeleteBackupRequest]",
) -> AsyncOperationResponse[
"capo_fsx.types.delete_backup_response.DeleteBackupResponse"
]:
import capo_fsx._operations.aws_simba_api_service_v20180301.delete_backup
(
output,
http_response,
) = await capo_fsx._operations.aws_simba_api_service_v20180301.delete_backup.async_delete_backup(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteBackup")
)
input_: capo_fsx.types.delete_backup_request.DeleteBackupRequest = {}
if backup_id is not None:
input_["backup_id"] = backup_id
if client_request_token is None:
client_request_token = str(uuid.uuid4())
input_["client_request_token"] = client_request_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|