Skip to content

purchase_reserved_node_offering

purchase_reserved_node_offering(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    reserved_node_offering_id: Optional[String] = None,
    node_count: Optional[IntegerOptional] = None,
) -> PurchaseReservedNodeOfferingResult

Allows you to purchase reserved nodes. Amazon Redshift offers a predefined set of reserved node offerings. You can purchase one or more of the offerings. You can call the DescribeReservedNodeOfferings API to obtain the available reserved node offerings. You can call this API by providing a specific reserved node offering and the number of nodes you want to reserve.

For more information about reserved node offerings, go to Purchasing Reserved Nodes in the Amazon Redshift Cluster Management Guide.

Parameters:

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

    The unique identifier of the reserved node offering you want to purchase.

  • node_count (Optional[IntegerOptional], default: None ) –

    The number of reserved nodes that you want to purchase.

    Default: 1

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def purchase_reserved_node_offering(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    reserved_node_offering_id: Optional["capo_redshift.types.string.String"] = None,
    node_count: Optional[
        "capo_redshift.types.integer_optional.IntegerOptional"
    ] = None,
) -> "capo_redshift.types.purchase_reserved_node_offering_result.PurchaseReservedNodeOfferingResult":
    """<p>Allows you to purchase reserved nodes. Amazon Redshift offers a predefined set of reserved node offerings. You can purchase one or more of the offerings. You can call the <a>DescribeReservedNodeOfferings</a> API to obtain the available reserved node offerings. You can call this API by providing a specific reserved node offering and the number of nodes you want to reserve. </p> <p> For more information about reserved node offerings, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/purchase-reserved-node-instance.html">Purchasing Reserved Nodes</a> in the <i>Amazon Redshift Cluster Management Guide</i>.</p>

    Args:
        reserved_node_offering_id: <p>The unique identifier of the reserved node offering you want to purchase.</p>
        node_count: <p>The number of reserved nodes that you want to purchase.</p> <p>Default: <code>1</code> </p>

    Raises:
        capo_redshift.errors.reserved_node_already_exists_fault.ReservedNodeAlreadyExistsFault: <p>User already has a reservation with the given identifier.</p>
        capo_redshift.errors.reserved_node_offering_not_found_fault.ReservedNodeOfferingNotFoundFault: <p>Specified offering does not exist.</p>
        capo_redshift.errors.reserved_node_quota_exceeded_fault.ReservedNodeQuotaExceededFault: <p>Request would exceed the user's compute node quota. For information about increasing your quota, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html">Limits in Amazon Redshift</a> in the <i>Amazon Redshift Cluster Management Guide</i>. </p>
        capo_redshift.errors.unsupported_operation_fault.UnsupportedOperationFault: <p>The requested operation isn't supported.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.purchase_reserved_node_offering_message.PurchaseReservedNodeOfferingMessage]",
    ) -> OperationResponse[
        "capo_redshift.types.purchase_reserved_node_offering_result.PurchaseReservedNodeOfferingResult"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.purchase_reserved_node_offering

        output, http_response = (
            capo_redshift._operations.redshift_service_version20121201.purchase_reserved_node_offering.purchase_reserved_node_offering(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PurchaseReservedNodeOffering")
    )
    input_: capo_redshift.types.purchase_reserved_node_offering_message.PurchaseReservedNodeOfferingMessage = {}
    if reserved_node_offering_id is not None:
        input_["reserved_node_offering_id"] = reserved_node_offering_id
    if node_count is not None:
        input_["node_count"] = node_count

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