Deletes the specified manual snapshot. The snapshot must be in the available state, with no other users authorized to access the snapshot.
Unlike automated snapshots, manual snapshots are retained even after you delete your cluster. Amazon Redshift does not delete your manual snapshots. You must delete manual snapshot explicitly to avoid getting charged. If other accounts are authorized to access the snapshot, you must revoke all of the authorizations before you can delete the snapshot.
Parameters:
-
snapshot_identifier
(Optional[String], default:
None
)
–
The unique identifier of the manual snapshot to be deleted.
Constraints: Must be the name of an existing snapshot that is in the available, failed, or cancelled state.
-
snapshot_cluster_identifier
(Optional[String], default:
None
)
–
The unique identifier of the cluster the snapshot was created from. This parameter is required if your IAM user has a policy containing a snapshot resource element that specifies anything other than * for the cluster name.
Constraints: Must be the name of valid cluster.
Raises:
Source code in docs_src/capo_redshift/_services/async_redshift.py
| async def delete_cluster_snapshot(
self,
*,
config_overrides: Optional[AsyncRedshiftClientConfig] = None,
snapshot_identifier: Optional["capo_redshift.types.string.String"] = None,
snapshot_cluster_identifier: Optional[
"capo_redshift.types.string.String"
] = None,
) -> (
"capo_redshift.types.delete_cluster_snapshot_result.DeleteClusterSnapshotResult"
):
"""<p>Deletes the specified manual snapshot. The snapshot must be in the <code>available</code> state, with no other users authorized to access the snapshot. </p> <p>Unlike automated snapshots, manual snapshots are retained even after you delete your cluster. Amazon Redshift does not delete your manual snapshots. You must delete manual snapshot explicitly to avoid getting charged. If other accounts are authorized to access the snapshot, you must revoke all of the authorizations before you can delete the snapshot.</p>
Args:
snapshot_identifier: <p>The unique identifier of the manual snapshot to be deleted.</p> <p>Constraints: Must be the name of an existing snapshot that is in the <code>available</code>, <code>failed</code>, or <code>cancelled</code> state.</p>
snapshot_cluster_identifier: <p>The unique identifier of the cluster the snapshot was created from. This parameter is required if your IAM user has a policy containing a snapshot resource element that specifies anything other than * for the cluster name.</p> <p>Constraints: Must be the name of valid cluster.</p>
Raises:
capo_redshift.errors.cluster_snapshot_not_found_fault.ClusterSnapshotNotFoundFault: <p>The snapshot identifier does not refer to an existing cluster snapshot.</p>
capo_redshift.errors.invalid_cluster_snapshot_state_fault.InvalidClusterSnapshotStateFault: <p>The specified cluster snapshot is not in the <code>available</code> state, or other accounts are authorized to access the snapshot. </p>
capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_redshift.types.delete_cluster_snapshot_message.DeleteClusterSnapshotMessage]",
) -> AsyncOperationResponse[
"capo_redshift.types.delete_cluster_snapshot_result.DeleteClusterSnapshotResult"
]:
import capo_redshift._operations.redshift_service_version20121201.delete_cluster_snapshot
(
output,
http_response,
) = await capo_redshift._operations.redshift_service_version20121201.delete_cluster_snapshot.async_delete_cluster_snapshot(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteClusterSnapshot")
)
input_: capo_redshift.types.delete_cluster_snapshot_message.DeleteClusterSnapshotMessage = {}
if snapshot_identifier is not None:
input_["snapshot_identifier"] = snapshot_identifier
if snapshot_cluster_identifier is not None:
input_["snapshot_cluster_identifier"] = snapshot_cluster_identifier
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|