Assets

Methods described in this section relate to the the assets API. These methods can be accessed at TenableOT.assets.

class AssetsAPI(api: restfly.session.APISession)[source]
connections(id)[source]

Retrieve the connections of a given asset

Parameters:id (str) – The unique identifier for the asset.
Returns:The list of connections present on the given asset.
Return type:list

Example

>>> connections = ot.assets.connections(id)
details(id)[source]

Retrieve the details of a given asset

Parameters:id (str) – The unique identifier for the asset.
Returns:The resource record for the asset
Return type:dict

Example

>>> asset = ot.assets.details(id)
list(**kwargs)[source]

Retrieves a list of assets.

Parameters:
  • filters (list[tuple], optional) – A list of filter tuples.
  • orderBy (list[dict], optional) – A list of order documents, each of which must contain both the field and direction keys.
  • search (str, optional) – A search string to further limit the response.
Returns:

An iterator object that will handle pagination of the data.

Return type:

OTIterator

Example

>>> for asset in ot.assets.list():
...     print(asset)