Assets¶
Methods described in this section relate to the assets API.
These methods can be accessed at TenableOT.assets
.
- class AssetsAPI(api: APISession)[source]¶
- asset(asset_id: int, **kwargs) → OTGraphIterator[source]¶
Retrieve a specific asset by ID.
- Parameters:
asset_id (int)
- Returns:
An iterator object handling data pagination.
- Return type:
OTGraphIterator
Example
>>> tot.plugins.plugin(1)
- list(query_filter: dict | None = None, search: str | None = None, sort: List[dict] | None = None, start_at: str | None = None, limit: int | None = 200, **kwargs) → OTGraphIterator[source]¶
Retrieves a list of assets via the GraphQL API.
- Parameters:
query_filter (dict, optional) – A document as defined by Tenable OT Security online documentation.
search (str, optional) – A search string to further limit the response.
sort (List[dict], optional) – A list of order documents, each of which must contain both the
field
anddirection
keys and may also contain the optionalfunction
key. Default sort is by descending id order. Please refer to Tenable OT Security online documentation for more information.start_at (str, optional) – The cursor to start the scan from (the default is an empty cursor).
limit (int, optional) – Max number of objects that get retrieved per page (the default is 200).
- Returns:
An iterator object that will handle pagination of the data.
- Return type:
OTGraphIterator
Example
>>> for asset in tot.assets.list(limit=500): print(asset)
- schema_class¶
alias of
AssetsSchema