Skip to content

describe_host_reservations async

describe_host_reservations(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    filter: Optional[FilterList] = None,
    host_reservation_id_set: Optional[HostReservationIdSet] = None,
    max_results: Optional[Integer] = None,
    next_token: Optional[String] = None,
) -> DescribeHostReservationsResult

Describes reservations that are associated with Dedicated Hosts in your account.

Parameters:

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

    The filters.

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

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

    • state - The state of the reservation (payment-pending | payment-failed | active | retired).

    • tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

  • host_reservation_id_set (Optional[HostReservationIdSet], default: None ) –

    The host reservation IDs.

  • max_results (Optional[Integer], 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.

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

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

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_host_reservations(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    filter: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    host_reservation_id_set: Optional[
        "capo_ec2.types.host_reservation_id_set.HostReservationIdSet"
    ] = None,
    max_results: Optional["capo_ec2.types.integer.Integer"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.describe_host_reservations_result.DescribeHostReservationsResult":
    """<p>Describes reservations that are associated with Dedicated Hosts in your account.</p>

    Args:
        filter: <p>The filters.</p> <ul> <li> <p> <code>instance-family</code> - The instance family (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> <li> <p> <code>state</code> - The state of the reservation (<code>payment-pending</code> | <code>payment-failed</code> | <code>active</code> | <code>retired</code>).</p> </li> <li> <p> <code>tag:<key></code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p> </li> <li> <p> <code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p> </li> </ul>
        host_reservation_id_set: <p>The host reservation IDs.</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>
        next_token: <p>The token to use to retrieve the next page of results.</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_reservations_request.DescribeHostReservationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_host_reservations_result.DescribeHostReservationsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_host_reservations

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeHostReservations")
    )
    input_: capo_ec2.types.describe_host_reservations_request.DescribeHostReservationsRequest = {}
    if filter is not None:
        input_["filter"] = filter
    if host_reservation_id_set is not None:
        input_["host_reservation_id_set"] = host_reservation_id_set
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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