Skip to content

purchase_reserved_cache_nodes_offering

purchase_reserved_cache_nodes_offering(
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    reserved_cache_nodes_offering_id: Optional[String] = None,
    reserved_cache_node_id: Optional[String] = None,
    cache_node_count: Optional[IntegerOptional] = None,
    tags: Optional[TagList] = None,
) -> PurchaseReservedCacheNodesOfferingResult

Allows you to purchase a reserved cache node offering. Reserved nodes are not eligible for cancellation and are non-refundable. For more information, see Managing Costs with Reserved Nodes.

Parameters:

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

    The ID of the reserved cache node offering to purchase.

    Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706

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

    A customer-specified identifier to track this reservation.

    The Reserved Cache Node ID is an unique customer-specified identifier to track this reservation. If this parameter is not specified, ElastiCache automatically generates an identifier for the reservation.

    Example: myreservationID

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

    The number of cache node instances to reserve.

    Default: 1

  • tags (Optional[TagList], default: None ) –

    A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.

Raises:

Examples:

PurchaseReservedCacheNodesOfferings Allows you to purchase a reserved cache node offering.

>>> client.purchase_reserved_cache_nodes_offering(reserved_cache_nodes_offering_id='1ef01f5b-94ff-433f-a530-61a56bfc8e7a')
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
def purchase_reserved_cache_nodes_offering(
    self,
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    reserved_cache_nodes_offering_id: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    reserved_cache_node_id: Optional["capo_elasticache.types.string.String"] = None,
    cache_node_count: Optional[
        "capo_elasticache.types.integer_optional.IntegerOptional"
    ] = None,
    tags: Optional["capo_elasticache.types.tag_list.TagList"] = None,
) -> "capo_elasticache.types.purchase_reserved_cache_nodes_offering_result.PurchaseReservedCacheNodesOfferingResult":
    """<p>Allows you to purchase a reserved cache node offering. Reserved nodes are not eligible for cancellation and are non-refundable. For more information, see <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/reserved-nodes.html">Managing Costs with Reserved Nodes</a>.</p>

    Args:
        reserved_cache_nodes_offering_id: <p>The ID of the reserved cache node offering to purchase.</p> <p>Example: <code>438012d3-4052-4cc7-b2e3-8d3372e0e706</code> </p>
        reserved_cache_node_id: <p>A customer-specified identifier to track this reservation.</p> <note> <p>The Reserved Cache Node ID is an unique customer-specified identifier to track this reservation. If this parameter is not specified, ElastiCache automatically generates an identifier for the reservation.</p> </note> <p>Example: myreservationID</p>
        cache_node_count: <p>The number of cache node instances to reserve.</p> <p>Default: <code>1</code> </p>
        tags: <p>A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.</p>

    Raises:
        capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.reserved_cache_node_already_exists_fault.ReservedCacheNodeAlreadyExistsFault: <p>You already have a reservation with the given identifier.</p>
        capo_elasticache.errors.reserved_cache_node_quota_exceeded_fault.ReservedCacheNodeQuotaExceededFault: <p>The request cannot be processed because it would exceed the user's cache node quota.</p>
        capo_elasticache.errors.reserved_cache_nodes_offering_not_found_fault.ReservedCacheNodesOfferingNotFoundFault: <p>The requested cache node offering does not exist.</p>
        capo_elasticache.errors.tag_quota_per_resource_exceeded.TagQuotaPerResourceExceeded: <p>The request cannot be processed because it would cause the resource to have more than the allowed number of tags. The maximum number of tags permitted on a resource is 50.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        PurchaseReservedCacheNodesOfferings
        Allows you to purchase a reserved cache node offering.

        >>> client.purchase_reserved_cache_nodes_offering(reserved_cache_nodes_offering_id='1ef01f5b-94ff-433f-a530-61a56bfc8e7a')
    """

    def _handler(
        req: "OperationRequest[capo_elasticache.types.purchase_reserved_cache_nodes_offering_message.PurchaseReservedCacheNodesOfferingMessage]",
    ) -> OperationResponse[
        "capo_elasticache.types.purchase_reserved_cache_nodes_offering_result.PurchaseReservedCacheNodesOfferingResult"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.purchase_reserved_cache_nodes_offering

        output, http_response = (
            capo_elasticache._operations.amazon_elasti_cache_v9.purchase_reserved_cache_nodes_offering.purchase_reserved_cache_nodes_offering(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PurchaseReservedCacheNodesOffering")
    )
    input_: capo_elasticache.types.purchase_reserved_cache_nodes_offering_message.PurchaseReservedCacheNodesOfferingMessage = {}
    if reserved_cache_nodes_offering_id is not None:
        input_["reserved_cache_nodes_offering_id"] = (
            reserved_cache_nodes_offering_id
        )
    if reserved_cache_node_id is not None:
        input_["reserved_cache_node_id"] = reserved_cache_node_id
    if cache_node_count is not None:
        input_["cache_node_count"] = cache_node_count
    if tags is not None:
        input_["tags"] = tags

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