Fails over the primary compute unit of the specified Multi-AZ cluster to another Availability Zone.
Parameters:
-
cluster_identifier
(Optional[String], default:
None
)
–
The unique identifier of the cluster for which the primary compute unit will be failed over to another Availability Zone.
Raises:
Source code in docs_src/capo_redshift/_services/redshift.py
| def failover_primary_compute(
self,
*,
config_overrides: Optional[RedshiftClientConfig] = None,
cluster_identifier: Optional["capo_redshift.types.string.String"] = None,
) -> "capo_redshift.types.failover_primary_compute_result.FailoverPrimaryComputeResult":
"""<p>Fails over the primary compute unit of the specified Multi-AZ cluster to another Availability Zone.</p>
Args:
cluster_identifier: <p>The unique identifier of the cluster for which the primary compute unit will be failed over to another Availability Zone.</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.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.failover_primary_compute_input_message.FailoverPrimaryComputeInputMessage]",
) -> OperationResponse[
"capo_redshift.types.failover_primary_compute_result.FailoverPrimaryComputeResult"
]:
import capo_redshift._operations.redshift_service_version20121201.failover_primary_compute
output, http_response = (
capo_redshift._operations.redshift_service_version20121201.failover_primary_compute.failover_primary_compute(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_redshift.types.failover_primary_compute_result.FailoverPrimaryComputeResult",
) -> dict[str, Any]:
import capo_redshift.types.failover_primary_compute_result
return capo_redshift.types.failover_primary_compute_result.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("FailoverPrimaryCompute", redact_output=_redact_output),
)
input_: capo_redshift.types.failover_primary_compute_input_message.FailoverPrimaryComputeInputMessage = {}
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
|