Skip to content

get_inventory async

get_inventory(
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[InventoryFilterList] = None,
    aggregators: Optional[InventoryAggregatorList] = None,
    result_attributes: Optional[ResultAttributeList] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> GetInventoryResult

Query inventory information. This includes managed node status, such as Stopped or Terminated.

Parameters:

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

    One or more filters. Use a filter to return a more specific list of results.

  • aggregators (Optional[InventoryAggregatorList], default: None ) –

    Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the AWS:InstanceInformation.PlatformType type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.

  • result_attributes (Optional[ResultAttributeList], default: None ) –

    The list of inventory item types to return.

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

    The token for the next set of items to return. (You received this token from a previous call.)

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

    The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Raises:

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def get_inventory(
    self,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[
        "capo_ssm.types.inventory_filter_list.InventoryFilterList"
    ] = None,
    aggregators: Optional[
        "capo_ssm.types.inventory_aggregator_list.InventoryAggregatorList"
    ] = None,
    result_attributes: Optional[
        "capo_ssm.types.result_attribute_list.ResultAttributeList"
    ] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
    max_results: Optional["capo_ssm.types.max_results.MaxResults"] = None,
) -> "capo_ssm.types.get_inventory_result.GetInventoryResult":
    """<p>Query inventory information. This includes managed node status, such as <code>Stopped</code> or <code>Terminated</code>.</p>

    Args:
        filters: <p>One or more filters. Use a filter to return a more specific list of results.</p>
        aggregators: <p>Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the <code>AWS:InstanceInformation.PlatformType</code> type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.</p>
        result_attributes: <p>The list of inventory item types to return.</p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
        max_results: <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_aggregator_exception.InvalidAggregatorException: <p>The specified aggregator isn't valid for the group type. Verify that the aggregator you provided is supported.</p>
        capo_ssm.errors.invalid_filter.InvalidFilter: <p>The filter name isn't valid. Verify that you entered the correct name and try again.</p>
        capo_ssm.errors.invalid_inventory_group_exception.InvalidInventoryGroupException: <p>The specified inventory group isn't valid.</p>
        capo_ssm.errors.invalid_next_token.InvalidNextToken: <p>The specified token isn't valid.</p>
        capo_ssm.errors.invalid_result_attribute_exception.InvalidResultAttributeException: <p>The specified inventory item result attribute isn't valid.</p>
        capo_ssm.errors.invalid_type_name_exception.InvalidTypeNameException: <p>The parameter type name isn't valid.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.get_inventory_request.GetInventoryRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.get_inventory_result.GetInventoryResult"
    ]:
        import capo_ssm._operations.amazon_ssm.get_inventory

        (
            output,
            http_response,
        ) = await capo_ssm._operations.amazon_ssm.get_inventory.async_get_inventory(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetInventory")
    )
    input_: capo_ssm.types.get_inventory_request.GetInventoryRequest = {}
    if filters is not None:
        input_["filters"] = filters
    if aggregators is not None:
        input_["aggregators"] = aggregators
    if result_attributes is not None:
        input_["result_attributes"] = result_attributes
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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