Skip to content

list_inventory_entries async

list_inventory_entries(
    instance_id: InstanceId,
    type_name: InventoryItemTypeName,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[InventoryFilterList] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListInventoryEntriesResult

A list of inventory items returned by the request.

Parameters:

  • instance_id (InstanceId) –

    The managed node ID for which you want inventory information.

  • type_name (InventoryItemTypeName) –

    The type of inventory item for which you want information.

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

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

  • 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:

  • InternalServerError –

    An error occurred on the server side.

  • InvalidFilter –

    The filter name isn't valid. Verify that you entered the correct name and try again.

  • InvalidInstanceId –

    The following problems can cause this exception:

    • You don't have permission to access the managed node.

    • Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.

    • SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.

    • The managed node isn't in a valid state. Valid states are: Running, Pending, Stopped, and Stopping. Invalid states are: Shutting-down and Terminated.

  • InvalidNextToken –

    The specified token isn't valid.

  • InvalidTypeNameException –

    The parameter type name isn't valid.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def list_inventory_entries(
    self,
    instance_id: "capo_ssm.types.instance_id.InstanceId",
    type_name: "capo_ssm.types.inventory_item_type_name.InventoryItemTypeName",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    filters: Optional[
        "capo_ssm.types.inventory_filter_list.InventoryFilterList"
    ] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
    max_results: Optional["capo_ssm.types.max_results.MaxResults"] = None,
) -> "capo_ssm.types.list_inventory_entries_result.ListInventoryEntriesResult":
    """<p>A list of inventory items returned by the request.</p>

    Args:
        instance_id: <p>The managed node ID for which you want inventory information.</p>
        type_name: <p>The type of inventory item for which you want information.</p>
        filters: <p>One or more filters. Use a filter to return a more specific list of results.</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_filter.InvalidFilter: <p>The filter name isn't valid. Verify that you entered the correct name and try again.</p>
        capo_ssm.errors.invalid_instance_id.InvalidInstanceId: <p>The following problems can cause this exception:</p> <ul> <li> <p>You don't have permission to access the managed node.</p> </li> <li> <p>Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.</p> </li> <li> <p>SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.</p> </li> <li> <p>The managed node isn't in a valid state. Valid states are: <code>Running</code>, <code>Pending</code>, <code>Stopped</code>, and <code>Stopping</code>. Invalid states are: <code>Shutting-down</code> and <code>Terminated</code>.</p> </li> </ul>
        capo_ssm.errors.invalid_next_token.InvalidNextToken: <p>The specified token 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.list_inventory_entries_request.ListInventoryEntriesRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.list_inventory_entries_result.ListInventoryEntriesResult"
    ]:
        import capo_ssm._operations.amazon_ssm.list_inventory_entries

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListInventoryEntries")
    )
    input_: capo_ssm.types.list_inventory_entries_request.ListInventoryEntriesRequest = {
        "instance_id": instance_id,
        "type_name": type_name,
    }
    if filters is not None:
        input_["filters"] = filters
    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