Disables the automatic copying of snapshots from one region to another region for a specified cluster.
If your cluster and its snapshots are encrypted using an encrypted symmetric key from Key Management Service, use DeleteSnapshotCopyGrant to delete the grant that grants Amazon Redshift permission to the key in the destination region.
Parameters:
-
cluster_identifier
(Optional[String], default:
None
)
–
The unique identifier of the source cluster that you want to disable copying of snapshots to a destination region.
Constraints: Must be the valid name of an existing cluster that has cross-region snapshot copy enabled.
Raises:
Source code in docs_src/capo_redshift/_services/redshift.py
| def disable_snapshot_copy(
self,
*,
config_overrides: Optional[RedshiftClientConfig] = None,
cluster_identifier: Optional["capo_redshift.types.string.String"] = None,
) -> "capo_redshift.types.disable_snapshot_copy_result.DisableSnapshotCopyResult":
"""<p>Disables the automatic copying of snapshots from one region to another region for a specified cluster.</p> <p>If your cluster and its snapshots are encrypted using an encrypted symmetric key from Key Management Service, use <a>DeleteSnapshotCopyGrant</a> to delete the grant that grants Amazon Redshift permission to the key in the destination region. </p>
Args:
cluster_identifier: <p>The unique identifier of the source cluster that you want to disable copying of snapshots to a destination region.</p> <p>Constraints: Must be the valid name of an existing cluster that has cross-region snapshot copy enabled.</p>
Raises:
capo_redshift.errors.cluster_not_found_fault.ClusterNotFoundFault: <p>The <code>ClusterIdentifier</code> parameter does not refer to an existing cluster. </p>
capo_redshift.errors.invalid_cluster_state_fault.InvalidClusterStateFault: <p>The specified cluster is not in the <code>available</code> state. </p>
capo_redshift.errors.snapshot_copy_already_disabled_fault.SnapshotCopyAlreadyDisabledFault: <p>The cluster already has cross-region snapshot copy disabled.</p>
capo_redshift.errors.unauthorized_operation.UnauthorizedOperation: <p>Your account is not authorized to perform the requested operation.</p>
capo_redshift.errors.unsupported_operation_fault.UnsupportedOperationFault: <p>The requested operation isn't supported.</p>
capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_redshift.types.disable_snapshot_copy_message.DisableSnapshotCopyMessage]",
) -> OperationResponse[
"capo_redshift.types.disable_snapshot_copy_result.DisableSnapshotCopyResult"
]:
import capo_redshift._operations.redshift_service_version20121201.disable_snapshot_copy
output, http_response = (
capo_redshift._operations.redshift_service_version20121201.disable_snapshot_copy.disable_snapshot_copy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_redshift.types.disable_snapshot_copy_result.DisableSnapshotCopyResult",
) -> dict[str, Any]:
import capo_redshift.types.disable_snapshot_copy_result
return capo_redshift.types.disable_snapshot_copy_result.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("DisableSnapshotCopy", redact_output=_redact_output),
)
input_: capo_redshift.types.disable_snapshot_copy_message.DisableSnapshotCopyMessage = {}
if cluster_identifier is not None:
input_["cluster_identifier"] = cluster_identifier
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|