Deletes an Amazon FSx for OpenZFS snapshot. After deletion, the snapshot no longer exists, and its data is gone. Deleting a snapshot doesn't affect snapshots stored in a file system backup.
The DeleteSnapshot operation returns instantly. The snapshot appears with the lifecycle status of DELETING until the deletion is complete.
Parameters:
-
snapshot_id
(Optional[SnapshotId], default:
None
)
–
The ID of the snapshot that you want to delete.
Raises:
Source code in docs_src/capo_fsx/_services/f_sx.py
| def delete_snapshot(
self,
*,
config_overrides: Optional[FSxClientConfig] = None,
client_request_token: Optional[
"capo_fsx.types.client_request_token.ClientRequestToken"
] = None,
snapshot_id: Optional["capo_fsx.types.snapshot_id.SnapshotId"] = None,
) -> "capo_fsx.types.delete_snapshot_response.DeleteSnapshotResponse":
"""<p>Deletes an Amazon FSx for OpenZFS snapshot. After deletion, the snapshot no longer exists, and its data is gone. Deleting a snapshot doesn't affect snapshots stored in a file system backup. </p> <p>The <code>DeleteSnapshot</code> operation returns instantly. The snapshot appears with the lifecycle status of <code>DELETING</code> until the deletion is complete.</p>
Args:
snapshot_id: <p>The ID of the snapshot that you want to delete.</p>
Raises:
capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
capo_fsx.errors.snapshot_not_found.SnapshotNotFound: <p>No Amazon FSx snapshots were found based on the supplied parameters.</p>
capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_fsx.types.delete_snapshot_request.DeleteSnapshotRequest]",
) -> OperationResponse[
"capo_fsx.types.delete_snapshot_response.DeleteSnapshotResponse"
]:
import capo_fsx._operations.aws_simba_api_service_v20180301.delete_snapshot
output, http_response = (
capo_fsx._operations.aws_simba_api_service_v20180301.delete_snapshot.delete_snapshot(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteSnapshot")
)
input_: capo_fsx.types.delete_snapshot_request.DeleteSnapshotRequest = {}
if client_request_token is None:
client_request_token = str(uuid.uuid4())
input_["client_request_token"] = client_request_token
if snapshot_id is not None:
input_["snapshot_id"] = snapshot_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|