Used to failover the primary region to a secondary region. The secondary region will become primary, and all other clusters will become secondary.
Parameters:
-
global_replication_group_id
(Optional[String], default:
None
)
–
The name of the Global datastore
-
primary_region
(Optional[String], default:
None
)
–
The Amazon region of the primary cluster of the Global datastore
-
primary_replication_group_id
(Optional[String], default:
None
)
–
The name of the primary replication group
Raises:
Source code in docs_src/capo_elasticache/_services/async_elasti_cache.py
| async def failover_global_replication_group(
self,
*,
config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
global_replication_group_id: Optional[
"capo_elasticache.types.string.String"
] = None,
primary_region: Optional["capo_elasticache.types.string.String"] = None,
primary_replication_group_id: Optional[
"capo_elasticache.types.string.String"
] = None,
) -> "capo_elasticache.types.failover_global_replication_group_result.FailoverGlobalReplicationGroupResult":
"""<p>Used to failover the primary region to a secondary region. The secondary region will become primary, and all other clusters will become secondary.</p>
Args:
global_replication_group_id: <p>The name of the Global datastore</p>
primary_region: <p>The Amazon region of the primary cluster of the Global datastore</p>
primary_replication_group_id: <p>The name of the primary replication group</p>
Raises:
capo_elasticache.errors.global_replication_group_not_found_fault.GlobalReplicationGroupNotFoundFault: <p>The Global datastore does not exist</p>
capo_elasticache.errors.invalid_global_replication_group_state_fault.InvalidGlobalReplicationGroupStateFault: <p>The Global datastore is not available or in primary-only state.</p>
capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_elasticache.types.failover_global_replication_group_message.FailoverGlobalReplicationGroupMessage]",
) -> AsyncOperationResponse[
"capo_elasticache.types.failover_global_replication_group_result.FailoverGlobalReplicationGroupResult"
]:
import capo_elasticache._operations.amazon_elasti_cache_v9.failover_global_replication_group
(
output,
http_response,
) = await capo_elasticache._operations.amazon_elasti_cache_v9.failover_global_replication_group.async_failover_global_replication_group(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("FailoverGlobalReplicationGroup")
)
input_: capo_elasticache.types.failover_global_replication_group_message.FailoverGlobalReplicationGroupMessage = {}
if global_replication_group_id is not None:
input_["global_replication_group_id"] = global_replication_group_id
if primary_region is not None:
input_["primary_region"] = primary_region
if primary_replication_group_id is not None:
input_["primary_replication_group_id"] = primary_replication_group_id
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|