Inventory

Methods described in this section relate to the inventory API and can be accessed at TenableASM.inventory.

class InventoryAPI(api: APISession)[source]
list(*search: Tuple[str, str, str], columns: List[str] | None = None, size: int = 1000, sort_field: str | None = None, sort_asc: bool = True, inventory: bool = False) InventoryIterator[source]

Lists the assets in the inventory

Parameters:
  • *search (tuple[str, str, str], optional) – A 3-part search tuple detailing what to search for from the ASM dataset. For example: ('bd.original_hostname', 'ends with', '.com')

  • columns (list[str], optional) – The list of columns to return in the response.

  • size (int, optional) – The number of records to return with each page from the API. Must be an integer between 1 and 10000.

  • sort_field (str, optional) – What field should the results be worted by?

  • sort_asc (bool) – How should the results be sorted? True specifies ascending sort, whereas False refers to descending.

Example

>>> for item in asm.inventory.list():
...     print(item)
class InventoryIterator(api, **kw)[source]

Asset inventory iterator