Skip to content

purchase_reserved_elasticsearch_instance_offering

purchase_reserved_elasticsearch_instance_offering(
    reserved_elasticsearch_instance_offering_id: GUID,
    reservation_name: ReservationToken,
    *,
    config_overrides: Optional[ElasticsearchServiceClientConfig] = None,
    instance_count: Optional[InstanceCount] = None,
) -> PurchaseReservedElasticsearchInstanceOfferingResponse

Allows you to purchase reserved Elasticsearch instances.

Parameters:

  • reserved_elasticsearch_instance_offering_id (GUID) –

    The ID of the reserved Elasticsearch instance offering to purchase.

  • reservation_name (ReservationToken) –

    A customer-specified identifier to track this reservation.

  • instance_count (Optional[InstanceCount], default: None ) –

    The number of Elasticsearch instances to reserve.

Raises:

  • DisabledOperationException –

    An error occured because the client wanted to access a not supported operation. Gives http status code of 409.

  • InternalException –

    The request processing has failed because of an unknown error, exception or failure (the failure is internal to the service) . Gives http status code of 500.

  • LimitExceededException –

    An exception for trying to create more than allowed resources or sub-resources. Gives http status code of 409.

  • ResourceAlreadyExistsException –

    An exception for creating a resource that already exists. Gives http status code of 400.

  • ResourceNotFoundException –

    An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.

  • ValidationException –

    An exception for missing / invalid input fields. Gives http status code of 400.

  • UnknownServiceError –

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

Source code in docs_src/capo_elasticsearch_service/_services/elasticsearch_service.py
def purchase_reserved_elasticsearch_instance_offering(
    self,
    reserved_elasticsearch_instance_offering_id: "capo_elasticsearch_service.types.guid.GUID",
    reservation_name: "capo_elasticsearch_service.types.reservation_token.ReservationToken",
    *,
    config_overrides: Optional[ElasticsearchServiceClientConfig] = None,
    instance_count: Optional[
        "capo_elasticsearch_service.types.instance_count.InstanceCount"
    ] = None,
) -> "capo_elasticsearch_service.types.purchase_reserved_elasticsearch_instance_offering_response.PurchaseReservedElasticsearchInstanceOfferingResponse":
    """<p>Allows you to purchase reserved Elasticsearch instances.</p>

    Args:
        reserved_elasticsearch_instance_offering_id: <p>The ID of the reserved Elasticsearch instance offering to purchase.</p>
        reservation_name: <p>A customer-specified identifier to track this reservation.</p>
        instance_count: <p>The number of Elasticsearch instances to reserve.</p>

    Raises:
        capo_elasticsearch_service.errors.disabled_operation_exception.DisabledOperationException: <p>An error occured because the client wanted to access a not supported operation. Gives http status code of 409.</p>
        capo_elasticsearch_service.errors.internal_exception.InternalException: <p>The request processing has failed because of an unknown error, exception or failure (the failure is internal to the service) . Gives http status code of 500.</p>
        capo_elasticsearch_service.errors.limit_exceeded_exception.LimitExceededException: <p>An exception for trying to create more than allowed resources or sub-resources. Gives http status code of 409.</p>
        capo_elasticsearch_service.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>An exception for creating a resource that already exists. Gives http status code of 400.</p>
        capo_elasticsearch_service.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.</p>
        capo_elasticsearch_service.errors.validation_exception.ValidationException: <p>An exception for missing / invalid input fields. Gives http status code of 400.</p>
        capo_elasticsearch_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_elasticsearch_service.types.purchase_reserved_elasticsearch_instance_offering_request.PurchaseReservedElasticsearchInstanceOfferingRequest]",
    ) -> OperationResponse[
        "capo_elasticsearch_service.types.purchase_reserved_elasticsearch_instance_offering_response.PurchaseReservedElasticsearchInstanceOfferingResponse"
    ]:
        import capo_elasticsearch_service._operations.amazon_elasticsearch_service2015.purchase_reserved_elasticsearch_instance_offering

        output, http_response = (
            capo_elasticsearch_service._operations.amazon_elasticsearch_service2015.purchase_reserved_elasticsearch_instance_offering.purchase_reserved_elasticsearch_instance_offering(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("PurchaseReservedElasticsearchInstanceOffering"),
    )
    input_: capo_elasticsearch_service.types.purchase_reserved_elasticsearch_instance_offering_request.PurchaseReservedElasticsearchInstanceOfferingRequest = {
        "reserved_elasticsearch_instance_offering_id": reserved_elasticsearch_instance_offering_id,
        "reservation_name": reservation_name,
    }
    if instance_count is not None:
        input_["instance_count"] = instance_count

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