deleteClusterSnapshot method
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.
May throw InvalidClusterSnapshotStateFault. May throw ClusterSnapshotNotFoundFault.
Parameter snapshotIdentifier
:
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.
Parameter snapshotClusterIdentifier
:
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.
Implementation
Future<DeleteClusterSnapshotResult> deleteClusterSnapshot({
required String snapshotIdentifier,
String? snapshotClusterIdentifier,
}) async {
ArgumentError.checkNotNull(snapshotIdentifier, 'snapshotIdentifier');
_s.validateStringLength(
'snapshotIdentifier',
snapshotIdentifier,
0,
2147483647,
isRequired: true,
);
_s.validateStringLength(
'snapshotClusterIdentifier',
snapshotClusterIdentifier,
0,
2147483647,
);
final $request = <String, dynamic>{};
$request['SnapshotIdentifier'] = snapshotIdentifier;
snapshotClusterIdentifier
?.also((arg) => $request['SnapshotClusterIdentifier'] = arg);
final $result = await _protocol.send(
$request,
action: 'DeleteClusterSnapshot',
version: '2012-12-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['DeleteClusterSnapshotMessage'],
shapes: shapes,
resultWrapper: 'DeleteClusterSnapshotResult',
);
return DeleteClusterSnapshotResult.fromXml($result);
}