Skip to content

switchover_global_cluster async

switchover_global_cluster(
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = None,
    global_cluster_identifier: Optional[GlobalClusterIdentifier] = None,
    target_db_cluster_identifier: Optional[String] = None,
) -> SwitchoverGlobalClusterResult

Switches over the specified secondary DB cluster to be the new primary DB cluster in the global database cluster. Switchover operations were previously called "managed planned failovers."

Promotes the specified secondary cluster to assume full read/write capabilities and demotes the current primary cluster to a secondary (read-only) cluster, maintaining the original replication topology. All secondary clusters are synchronized with the primary at the beginning of the process so the new primary continues operations for the global database without losing any data. Your database is unavailable for a short time while the primary and selected secondary clusters are assuming their new roles.

This operation is intended for controlled environments, for operations such as "regional rotation" or to fall back to the original primary after a global database failover.

Parameters:

  • global_cluster_identifier (Optional[GlobalClusterIdentifier], default: None ) –

    The identifier of the global database cluster to switch over. This parameter isn't case-sensitive.

    Constraints: Must match the identifier of an existing global database cluster.

  • target_db_cluster_identifier (Optional[String], default: None ) –

    The Amazon Resource Name (ARN) of the secondary Neptune DB cluster that you want to promote to primary for the global database.

Raises:

Source code in docs_src/capo_neptune/_services/async_neptune.py
async def switchover_global_cluster(
    self,
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = None,
    global_cluster_identifier: Optional[
        "capo_neptune.types.global_cluster_identifier.GlobalClusterIdentifier"
    ] = None,
    target_db_cluster_identifier: Optional[
        "capo_neptune.types.string.String"
    ] = None,
) -> "capo_neptune.types.switchover_global_cluster_result.SwitchoverGlobalClusterResult":
    """<p>Switches over the specified secondary DB cluster to be the new primary DB cluster in the global database cluster. Switchover operations were previously called "managed planned failovers."</p> <p>Promotes the specified secondary cluster to assume full read/write capabilities and demotes the current primary cluster to a secondary (read-only) cluster, maintaining the original replication topology. All secondary clusters are synchronized with the primary at the beginning of the process so the new primary continues operations for the global database without losing any data. Your database is unavailable for a short time while the primary and selected secondary clusters are assuming their new roles.</p> <note> <p>This operation is intended for controlled environments, for operations such as "regional rotation" or to fall back to the original primary after a global database failover.</p> </note>

    Args:
        global_cluster_identifier: <p>The identifier of the global database cluster to switch over. This parameter isn't case-sensitive.</p> <p>Constraints: Must match the identifier of an existing global database cluster.</p>
        target_db_cluster_identifier: <p>The Amazon Resource Name (ARN) of the secondary Neptune DB cluster that you want to promote to primary for the global database.</p>

    Raises:
        capo_neptune.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <i>DBClusterIdentifier</i> does not refer to an existing DB cluster.</p>
        capo_neptune.errors.global_cluster_not_found_fault.GlobalClusterNotFoundFault: <p>The <code>GlobalClusterIdentifier</code> doesn't refer to an existing global database cluster. </p>
        capo_neptune.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The DB cluster is not in a valid state.</p>
        capo_neptune.errors.invalid_global_cluster_state_fault.InvalidGlobalClusterStateFault: <p>The global cluster is in an invalid state and can't perform the requested operation. </p>
        capo_neptune.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_neptune.types.switchover_global_cluster_message.SwitchoverGlobalClusterMessage]",
    ) -> AsyncOperationResponse[
        "capo_neptune.types.switchover_global_cluster_result.SwitchoverGlobalClusterResult"
    ]:
        import capo_neptune._operations.amazon_rd_sv19.switchover_global_cluster

        (
            output,
            http_response,
        ) = await capo_neptune._operations.amazon_rd_sv19.switchover_global_cluster.async_switchover_global_cluster(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SwitchoverGlobalCluster")
    )
    input_: capo_neptune.types.switchover_global_cluster_message.SwitchoverGlobalClusterMessage = {}
    if global_cluster_identifier is not None:
        input_["global_cluster_identifier"] = global_cluster_identifier
    if target_db_cluster_identifier is not None:
        input_["target_db_cluster_identifier"] = target_db_cluster_identifier

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output