Deletes a cluster snapshot. If the snapshot is being copied, the copy operation is terminated.
The cluster snapshot must be in the available state to be deleted.
Parameters:
-
db_cluster_snapshot_identifier
(Optional[String], default:
None
)
–
The identifier of the cluster snapshot to delete.
Constraints: Must be the name of an existing cluster snapshot in the available state.
Raises:
Source code in docs_src/capo_docdb/_services/doc_db.py
| def delete_db_cluster_snapshot(
self,
*,
config_overrides: Optional[DocDBClientConfig] = None,
db_cluster_snapshot_identifier: Optional[
"capo_docdb.types.string.String"
] = None,
) -> "capo_docdb.types.delete_db_cluster_snapshot_result.DeleteDBClusterSnapshotResult":
"""<p>Deletes a cluster snapshot. If the snapshot is being copied, the copy operation is terminated.</p> <note> <p>The cluster snapshot must be in the <code>available</code> state to be deleted.</p> </note>
Args:
db_cluster_snapshot_identifier: <p>The identifier of the cluster snapshot to delete.</p> <p>Constraints: Must be the name of an existing cluster snapshot in the <code>available</code> state.</p>
Raises:
capo_docdb.errors.db_cluster_snapshot_not_found_fault.DBClusterSnapshotNotFoundFault: <p> <code>DBClusterSnapshotIdentifier</code> doesn't refer to an existing cluster snapshot. </p>
capo_docdb.errors.invalid_db_cluster_snapshot_state_fault.InvalidDBClusterSnapshotStateFault: <p>The provided value isn't a valid cluster snapshot state.</p>
capo_docdb.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_docdb.types.delete_db_cluster_snapshot_message.DeleteDBClusterSnapshotMessage]",
) -> OperationResponse[
"capo_docdb.types.delete_db_cluster_snapshot_result.DeleteDBClusterSnapshotResult"
]:
import capo_docdb._operations.amazon_rd_sv19.delete_db_cluster_snapshot
output, http_response = (
capo_docdb._operations.amazon_rd_sv19.delete_db_cluster_snapshot.delete_db_cluster_snapshot(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteDBClusterSnapshot")
)
input_: capo_docdb.types.delete_db_cluster_snapshot_message.DeleteDBClusterSnapshotMessage = {}
if db_cluster_snapshot_identifier is not None:
input_["db_cluster_snapshot_identifier"] = db_cluster_snapshot_identifier
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|