Skip to content

describe_host_reservation_offerings async

describe_host_reservation_offerings(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    filter: Optional[FilterList] = None,
    max_duration: Optional[Integer] = None,
    max_results: Optional[DescribeHostReservationsMaxResults] = None,
    min_duration: Optional[Integer] = None,
    next_token: Optional[String] = None,
    offering_id: Optional[OfferingId] = None,
) -> DescribeHostReservationOfferingsResult

Describes the Dedicated Host reservations that are available to purchase.

The results describe all of the Dedicated Host reservation offerings, including offerings that might not match the instance family and Region of your Dedicated Hosts. When purchasing an offering, ensure that the instance family and Region of the offering matches that of the Dedicated Hosts with which it is to be associated. For more information about supported instance types, see Dedicated Hosts in the Amazon EC2 User Guide.

Parameters:

  • filter (Optional[FilterList], default: None ) –

    The filters.

    • instance-family - The instance family of the offering (for example, m4).

    • payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront).

  • max_duration (Optional[Integer], default: None ) –

    This is the maximum duration of the reservation to purchase, specified in seconds. Reservations are available in one-year and three-year terms. The number of seconds specified must be the number of seconds in a year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 94608000 for three years.

  • max_results (Optional[DescribeHostReservationsMaxResults], default: None ) –

    The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned nextToken value. This value can be between 5 and 500. If maxResults is given a larger value than 500, you receive an error.

  • min_duration (Optional[Integer], default: None ) –

    This is the minimum duration of the reservation you'd like to purchase, specified in seconds. Reservations are available in one-year and three-year terms. The number of seconds specified must be the number of seconds in a year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 31536000 for one year.

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

    The token to use to retrieve the next page of results.

  • offering_id (Optional[OfferingId], default: None ) –

    The ID of the reservation offering.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_host_reservation_offerings(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    filter: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    max_duration: Optional["capo_ec2.types.integer.Integer"] = None,
    max_results: Optional[
        "capo_ec2.types.describe_host_reservations_max_results.DescribeHostReservationsMaxResults"
    ] = None,
    min_duration: Optional["capo_ec2.types.integer.Integer"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    offering_id: Optional["capo_ec2.types.offering_id.OfferingId"] = None,
) -> "capo_ec2.types.describe_host_reservation_offerings_result.DescribeHostReservationOfferingsResult":
    """<p>Describes the Dedicated Host reservations that are available to purchase.</p> <p>The results describe all of the Dedicated Host reservation offerings, including offerings that might not match the instance family and Region of your Dedicated Hosts. When purchasing an offering, ensure that the instance family and Region of the offering matches that of the Dedicated Hosts with which it is to be associated. For more information about supported instance types, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html">Dedicated Hosts</a> in the <i>Amazon EC2 User Guide</i>. </p>

    Args:
        filter: <p>The filters.</p> <ul> <li> <p> <code>instance-family</code> - The instance family of the offering (for example, <code>m4</code>).</p> </li> <li> <p> <code>payment-option</code> - The payment option (<code>NoUpfront</code> | <code>PartialUpfront</code> | <code>AllUpfront</code>).</p> </li> </ul>
        max_duration: <p>This is the maximum duration of the reservation to purchase, specified in seconds. Reservations are available in one-year and three-year terms. The number of seconds specified must be the number of seconds in a year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 94608000 for three years.</p>
        max_results: <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
        min_duration: <p>This is the minimum duration of the reservation you'd like to purchase, specified in seconds. Reservations are available in one-year and three-year terms. The number of seconds specified must be the number of seconds in a year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 31536000 for one year.</p>
        next_token: <p>The token to use to retrieve the next page of results.</p>
        offering_id: <p>The ID of the reservation offering.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.describe_host_reservation_offerings_request.DescribeHostReservationOfferingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_host_reservation_offerings_result.DescribeHostReservationOfferingsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_host_reservation_offerings

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.describe_host_reservation_offerings.async_describe_host_reservation_offerings(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeHostReservationOfferings")
    )
    input_: capo_ec2.types.describe_host_reservation_offerings_request.DescribeHostReservationOfferingsRequest = {}
    if filter is not None:
        input_["filter"] = filter
    if max_duration is not None:
        input_["max_duration"] = max_duration
    if max_results is not None:
        input_["max_results"] = max_results
    if min_duration is not None:
        input_["min_duration"] = min_duration
    if next_token is not None:
        input_["next_token"] = next_token
    if offering_id is not None:
        input_["offering_id"] = offering_id

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