Promotes a secondary domain to primary without coordinating with the current primary. Use this operation when the primary is unreachable and you cannot wait for it to recover.
Writes that had not yet replicated when the primary became unreachable are lost. You must set AllowDataLoss to acknowledge this. To promote a domain without losing writes, use the SwitchoverReplication operation instead.
Call this operation in the Region of the domain you want to promote.
Parameters:
-
peer_domain_arn
(DomainArn)
–
The Amazon Resource Name (ARN) of the relationship's current primary. The request is rejected if this domain is no longer the peer of the domain you are calling.
-
allow_data_loss
(Boolean)
–
Acknowledges that writes which had not yet replicated are lost. You must set this to true; the request is rejected otherwise.
Raises:
Source code in docs_src/capo_opensearch/_services/open_search.py
| def failover_replication(
self,
domain_name: "capo_opensearch.types.domain_name.DomainName",
peer_domain_arn: "capo_opensearch.types.domain_arn.DomainArn",
allow_data_loss: "capo_opensearch.types.boolean.Boolean",
*,
config_overrides: Optional[OpenSearchClientConfig] = None,
) -> "capo_opensearch.types.failover_replication_response.FailoverReplicationResponse":
"""<p>Promotes a secondary domain to primary without coordinating with the current primary. Use this operation when the primary is unreachable and you cannot wait for it to recover.</p> <p>Writes that had not yet replicated when the primary became unreachable are lost. You must set <code>AllowDataLoss</code> to acknowledge this. To promote a domain without losing writes, use the <code>SwitchoverReplication</code> operation instead.</p> <p>Call this operation in the Region of the domain you want to promote.</p>
Args:
peer_domain_arn: <p>The Amazon Resource Name (ARN) of the relationship's current primary. The request is rejected if this domain is no longer the peer of the domain you are calling.</p>
allow_data_loss: <p>Acknowledges that writes which had not yet replicated are lost. You must set this to <code>true</code>; the request is rejected otherwise.</p>
Raises:
capo_opensearch.errors.disabled_operation_exception.DisabledOperationException: <p>An error occured because the client wanted to access an unsupported operation.</p>
capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
capo_opensearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
capo_opensearch.errors.validation_exception.ValidationException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_opensearch.types.failover_replication_request.FailoverReplicationRequest]",
) -> OperationResponse[
"capo_opensearch.types.failover_replication_response.FailoverReplicationResponse"
]:
import capo_opensearch._operations.amazon_open_search_service.failover_replication
output, http_response = (
capo_opensearch._operations.amazon_open_search_service.failover_replication.failover_replication(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("FailoverReplication")
)
input_: capo_opensearch.types.failover_replication_request.FailoverReplicationRequest = {
"domain_name": domain_name,
"peer_domain_arn": peer_domain_arn,
"allow_data_loss": allow_data_loss,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|