Promotes a secondary domain to primary, coordinating with the current primary so that no writes are lost. Use this operation for planned role changes, such as testing your recovery procedure or moving write traffic to another Region.
Call this operation in the Region of the domain you want to promote. If the current primary is unreachable, use the FailoverReplication operation instead.
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.
Raises:
Source code in docs_src/capo_opensearch/_services/async_open_search.py
| async def switchover_replication(
self,
domain_name: "capo_opensearch.types.domain_name.DomainName",
peer_domain_arn: "capo_opensearch.types.domain_arn.DomainArn",
*,
config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
) -> "capo_opensearch.types.switchover_replication_response.SwitchoverReplicationResponse":
"""<p>Promotes a secondary domain to primary, coordinating with the current primary so that no writes are lost. Use this operation for planned role changes, such as testing your recovery procedure or moving write traffic to another Region.</p> <p>Call this operation in the Region of the domain you want to promote. If the current primary is unreachable, use the <code>FailoverReplication</code> operation instead.</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>
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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_opensearch.types.switchover_replication_request.SwitchoverReplicationRequest]",
) -> AsyncOperationResponse[
"capo_opensearch.types.switchover_replication_response.SwitchoverReplicationResponse"
]:
import capo_opensearch._operations.amazon_open_search_service.switchover_replication
(
output,
http_response,
) = await capo_opensearch._operations.amazon_open_search_service.switchover_replication.async_switchover_replication(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("SwitchoverReplication")
)
input_: capo_opensearch.types.switchover_replication_request.SwitchoverReplicationRequest = {
"domain_name": domain_name,
"peer_domain_arn": peer_domain_arn,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|