Skip to content

get_reservation

get_reservation(
    reservation_id: ReservationId,
    *,
    config_overrides: Optional[RedshiftServerlessClientConfig] = None,
) -> GetReservationResponse

Gets an Amazon Redshift Serverless reservation. A reservation gives you the option to commit to a specified number of Redshift Processing Units (RPUs) for a year at a discount from Serverless on-demand (OD) rates.

Parameters:

  • reservation_id (ReservationId) –

    The ID of the reservation to retrieve.

Raises:

Source code in docs_src/capo_redshift_serverless/_services/redshift_serverless.py
def get_reservation(
    self,
    reservation_id: "capo_redshift_serverless.types.reservation_id.ReservationId",
    *,
    config_overrides: Optional[RedshiftServerlessClientConfig] = None,
) -> (
    "capo_redshift_serverless.types.get_reservation_response.GetReservationResponse"
):
    """<p>Gets an Amazon Redshift Serverless reservation. A reservation gives you the option to commit to a specified number of Redshift Processing Units (RPUs) for a year at a discount from Serverless on-demand (OD) rates.</p>

    Args:
        reservation_id: <p>The ID of the reservation to retrieve.</p>

    Raises:
        capo_redshift_serverless.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_redshift_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_redshift_serverless.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_redshift_serverless.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_redshift_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift_serverless.types.get_reservation_request.GetReservationRequest]",
    ) -> OperationResponse[
        "capo_redshift_serverless.types.get_reservation_response.GetReservationResponse"
    ]:
        import capo_redshift_serverless._operations.redshift_serverless.get_reservation

        output, http_response = (
            capo_redshift_serverless._operations.redshift_serverless.get_reservation.get_reservation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetReservation")
    )
    input_: capo_redshift_serverless.types.get_reservation_request.GetReservationRequest = {
        "reservation_id": reservation_id
    }

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