Deletes the specified snapshot copy grant.
Parameters:
-
snapshot_copy_grant_name
(Optional[String], default:
None
)
–
The name of the snapshot copy grant to delete.
Raises:
Source code in docs_src/capo_redshift/_services/redshift.py
| def delete_snapshot_copy_grant(
self,
*,
config_overrides: Optional[RedshiftClientConfig] = None,
snapshot_copy_grant_name: Optional["capo_redshift.types.string.String"] = None,
) -> None:
"""<p>Deletes the specified snapshot copy grant.</p>
Args:
snapshot_copy_grant_name: <p>The name of the snapshot copy grant to delete.</p>
Raises:
capo_redshift.errors.invalid_snapshot_copy_grant_state_fault.InvalidSnapshotCopyGrantStateFault: <p>The snapshot copy grant can't be deleted because it is used by one or more clusters.</p>
capo_redshift.errors.snapshot_copy_grant_not_found_fault.SnapshotCopyGrantNotFoundFault: <p>The specified snapshot copy grant can't be found. Make sure that the name is typed correctly and that the grant exists in the destination region.</p>
capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_redshift.types.delete_snapshot_copy_grant_message.DeleteSnapshotCopyGrantMessage]",
) -> OperationResponse[None]:
import capo_redshift._operations.redshift_service_version20121201.delete_snapshot_copy_grant
output, http_response = (
capo_redshift._operations.redshift_service_version20121201.delete_snapshot_copy_grant.delete_snapshot_copy_grant(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteSnapshotCopyGrant")
)
input_: capo_redshift.types.delete_snapshot_copy_grant_message.DeleteSnapshotCopyGrantMessage = {}
if snapshot_copy_grant_name is not None:
input_["snapshot_copy_grant_name"] = snapshot_copy_grant_name
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|