Skip to content

describe_mac_hosts async

describe_mac_hosts(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    filters: Optional[FilterList] = None,
    host_ids: Optional[RequestHostIdList] = None,
    max_results: Optional[DescribeMacHostsRequestMaxResults] = None,
    next_token: Optional[String] = None,
) -> DescribeMacHostsResult

Describes the specified EC2 Mac Dedicated Host or all of your EC2 Mac Dedicated Hosts.

Parameters:

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

    The filters.

    • availability-zone - The Availability Zone of the EC2 Mac Dedicated Host.

    • instance-type - The instance type size that the EC2 Mac Dedicated Host is configured to support.

  • host_ids (Optional[RequestHostIdList], default: None ) –

    The IDs of the EC2 Mac Dedicated Hosts.

  • max_results (Optional[DescribeMacHostsRequestMaxResults], 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_mac_hosts(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    host_ids: Optional[
        "capo_ec2.types.request_host_id_list.RequestHostIdList"
    ] = None,
    max_results: Optional[
        "capo_ec2.types.describe_mac_hosts_request_max_results.DescribeMacHostsRequestMaxResults"
    ] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.describe_mac_hosts_result.DescribeMacHostsResult":
    """<p>Describes the specified EC2 Mac Dedicated Host or all of your EC2 Mac Dedicated Hosts.</p>

    Args:
        filters: <p>The filters.</p> <ul> <li> <p> <code>availability-zone</code> - The Availability Zone of the EC2 Mac Dedicated Host.</p> </li> <li> <p> <code>instance-type</code> - The instance type size that the EC2 Mac Dedicated Host is configured to support.</p> </li> </ul>
        host_ids: <p> The IDs of the EC2 Mac Dedicated Hosts. </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_mac_hosts_request.DescribeMacHostsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_mac_hosts_result.DescribeMacHostsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_mac_hosts

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeMacHosts")
    )
    input_: capo_ec2.types.describe_mac_hosts_request.DescribeMacHostsRequest = {}
    if filters is not None:
        input_["filters"] = filters
    if host_ids is not None:
        input_["host_ids"] = host_ids
    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