Skip to content

purchase_reserved_db_instances_offering async

purchase_reserved_db_instances_offering(
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    reserved_db_instances_offering_id: Optional[String] = None,
    reserved_db_instance_id: Optional[String] = None,
    db_instance_count: Optional[IntegerOptional] = None,
    tags: Optional[TagList] = None,
) -> PurchaseReservedDBInstancesOfferingResult

Purchases a reserved DB instance offering.

Parameters:

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

    The ID of the Reserved DB instance offering to purchase.

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

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

    Customer-specified identifier to track this reservation.

    Example: myreservationID

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

    The number of instances to reserve.

    Default: 1

Raises:

Examples:

To purchase a reserved DB instance The following example shows how to buy the reserved DB instance offering from the previous example.

>>> await client.purchase_reserved_db_instances_offering(reserved_db_instances_offering_id='', reserved_db_instance_id='8ba30be1-b9ec-447f-8f23-6114e3f4c7b4')
Source code in docs_src/capo_rds/_services/async_rds.py
async def purchase_reserved_db_instances_offering(
    self,
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    reserved_db_instances_offering_id: Optional[
        "capo_rds.types.string.String"
    ] = None,
    reserved_db_instance_id: Optional["capo_rds.types.string.String"] = None,
    db_instance_count: Optional[
        "capo_rds.types.integer_optional.IntegerOptional"
    ] = None,
    tags: Optional["capo_rds.types.tag_list.TagList"] = None,
) -> "capo_rds.types.purchase_reserved_db_instances_offering_result.PurchaseReservedDBInstancesOfferingResult":
    """<p>Purchases a reserved DB instance offering.</p>

    Args:
        reserved_db_instances_offering_id: <p>The ID of the Reserved DB instance offering to purchase.</p> <p>Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706</p>
        reserved_db_instance_id: <p>Customer-specified identifier to track this reservation.</p> <p>Example: myreservationID</p>
        db_instance_count: <p>The number of instances to reserve.</p> <p>Default: <code>1</code> </p>

    Raises:
        capo_rds.errors.reserved_db_instance_already_exists_fault.ReservedDBInstanceAlreadyExistsFault: <p>User already has a reservation with the given identifier.</p>
        capo_rds.errors.reserved_db_instance_quota_exceeded_fault.ReservedDBInstanceQuotaExceededFault: <p>Request would exceed the user's DB Instance quota.</p>
        capo_rds.errors.reserved_db_instances_offering_not_found_fault.ReservedDBInstancesOfferingNotFoundFault: <p>Specified offering does not exist.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To purchase a reserved DB instance
        The following example shows how to buy the reserved DB instance offering from the previous example.

        >>> await client.purchase_reserved_db_instances_offering(reserved_db_instances_offering_id='', reserved_db_instance_id='8ba30be1-b9ec-447f-8f23-6114e3f4c7b4')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds.types.purchase_reserved_db_instances_offering_message.PurchaseReservedDBInstancesOfferingMessage]",
    ) -> AsyncOperationResponse[
        "capo_rds.types.purchase_reserved_db_instances_offering_result.PurchaseReservedDBInstancesOfferingResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.purchase_reserved_db_instances_offering

        (
            output,
            http_response,
        ) = await capo_rds._operations.amazon_rd_sv19.purchase_reserved_db_instances_offering.async_purchase_reserved_db_instances_offering(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PurchaseReservedDBInstancesOffering")
    )
    input_: capo_rds.types.purchase_reserved_db_instances_offering_message.PurchaseReservedDBInstancesOfferingMessage = {}
    if reserved_db_instances_offering_id is not None:
        input_["reserved_db_instances_offering_id"] = (
            reserved_db_instances_offering_id
        )
    if reserved_db_instance_id is not None:
        input_["reserved_db_instance_id"] = reserved_db_instance_id
    if db_instance_count is not None:
        input_["db_instance_count"] = db_instance_count
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output