Skip to content

switchover_read_replica

switchover_read_replica(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_instance_identifier: Optional[String] = None,
) -> SwitchoverReadReplicaResult

Switches over an Oracle standby database in an Oracle Data Guard environment, making it the new primary database. Issue this command in the Region that hosts the current standby database.

Parameters:

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

    The DB instance identifier of the current standby database. This value is stored as a lowercase string.

    Constraints:

    • Must match the identifier of an existing Oracle read replica DB instance.

Raises:

Source code in docs_src/capo_rds/_services/rds.py
def switchover_read_replica(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_instance_identifier: Optional["capo_rds.types.string.String"] = None,
) -> "capo_rds.types.switchover_read_replica_result.SwitchoverReadReplicaResult":
    """<p>Switches over an Oracle standby database in an Oracle Data Guard environment, making it the new primary database. Issue this command in the Region that hosts the current standby database.</p>

    Args:
        db_instance_identifier: <p>The DB instance identifier of the current standby database. This value is stored as a lowercase string.</p> <p>Constraints:</p> <ul> <li> <p>Must match the identifier of an existing Oracle read replica DB instance.</p> </li> </ul>

    Raises:
        capo_rds.errors.db_instance_not_found_fault.DBInstanceNotFoundFault: <p> <code>DBInstanceIdentifier</code> doesn't refer to an existing DB instance.</p>
        capo_rds.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p>The DB instance isn't in a valid state.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.switchover_read_replica_message.SwitchoverReadReplicaMessage]",
    ) -> OperationResponse[
        "capo_rds.types.switchover_read_replica_result.SwitchoverReadReplicaResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.switchover_read_replica

        output, http_response = (
            capo_rds._operations.amazon_rd_sv19.switchover_read_replica.switchover_read_replica(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_rds.types.switchover_read_replica_result.SwitchoverReadReplicaResult",
    ) -> dict[str, Any]:
        import capo_rds.types.switchover_read_replica_result

        return capo_rds.types.switchover_read_replica_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("SwitchoverReadReplica", redact_output=_redact_output),
    )
    input_: capo_rds.types.switchover_read_replica_message.SwitchoverReadReplicaMessage = {}
    if db_instance_identifier is not None:
        input_["db_instance_identifier"] = db_instance_identifier

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output