Skip to content

switchover_autonomous_database

switchover_autonomous_database(
    autonomous_database_id: ResourceIdOrArn,
    *,
    config_overrides: Optional[odbClientConfig] = None,
    peer_db_arn: Optional[ResourceArn] = None,
) -> SwitchoverAutonomousDatabaseOutput

Performs a switchover of the specified Autonomous Database to a standby peer database.

Parameters:

  • autonomous_database_id (ResourceIdOrArn) –

    The unique identifier of the Autonomous Database to switch over.

  • peer_db_arn (Optional[ResourceArn], default: None ) –

    The Amazon Resource Name (ARN) of the peer Autonomous Database to switch over to.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this action. Make sure you have the required permissions and try again.

  • ConflictException –

    Occurs when a conflict with the current status of your resource. Fix any inconsistencies with your resource and try again.

  • InternalServerException –

    Occurs when there is an internal failure in the Oracle Database@Amazon Web Services service. Wait and try again.

  • ResourceNotFoundException –

    The operation tried to access a resource that doesn't exist. Make sure you provided the correct resource and try again.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The request has failed validation because it is missing required fields or has invalid inputs.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_odb/_services/odb.py
def switchover_autonomous_database(
    self,
    autonomous_database_id: "capo_odb.types.resource_id_or_arn.ResourceIdOrArn",
    *,
    config_overrides: Optional[odbClientConfig] = None,
    peer_db_arn: Optional["capo_odb.types.resource_arn.ResourceArn"] = None,
) -> "capo_odb.types.switchover_autonomous_database_output.SwitchoverAutonomousDatabaseOutput":
    """<p>Performs a switchover of the specified Autonomous Database to a standby peer database.</p>

    Args:
        autonomous_database_id: <p>The unique identifier of the Autonomous Database to switch over.</p>
        peer_db_arn: <p>The Amazon Resource Name (ARN) of the peer Autonomous Database to switch over to.</p>

    Raises:
        capo_odb.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action. Make sure you have the required permissions and try again.</p>
        capo_odb.errors.conflict_exception.ConflictException: <p>Occurs when a conflict with the current status of your resource. Fix any inconsistencies with your resource and try again.</p>
        capo_odb.errors.internal_server_exception.InternalServerException: <p>Occurs when there is an internal failure in the Oracle Database@Amazon Web Services service. Wait and try again.</p>
        capo_odb.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a resource that doesn't exist. Make sure you provided the correct resource and try again.</p>
        capo_odb.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_odb.errors.validation_exception.ValidationException: <p>The request has failed validation because it is missing required fields or has invalid inputs.</p>
        capo_odb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_odb.types.switchover_autonomous_database_input.SwitchoverAutonomousDatabaseInput]",
    ) -> OperationResponse[
        "capo_odb.types.switchover_autonomous_database_output.SwitchoverAutonomousDatabaseOutput"
    ]:
        import capo_odb._operations.odb.switchover_autonomous_database

        output, http_response = (
            capo_odb._operations.odb.switchover_autonomous_database.switchover_autonomous_database(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SwitchoverAutonomousDatabase")
    )
    input_: capo_odb.types.switchover_autonomous_database_input.SwitchoverAutonomousDatabaseInput = {
        "autonomous_database_id": autonomous_database_id
    }
    if peer_db_arn is not None:
        input_["peer_db_arn"] = peer_db_arn

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