Index
armis_sdk.clients.assets_client.AssetsClient
Bases: BaseEntityClient
A client for interacting with assets.
The primary entities for this client inherit from Asset:
Methods:
| Name | Description |
|---|---|
list_by_asset_id |
List assets by asset ID or other identifiers. |
list_by_boundary_id |
List assets by boundary ID. |
list_by_last_seen |
List assets by last seen timestamp. |
list_by_multiple |
List assets matching multiple filter criteria simultaneously (AND logic). |
list_by_site_id |
List assets by site ID. |
list_fields |
List all available fields for a given asset class. |
update |
Bulk update assets. |
list_by_asset_id(asset_class, asset_ids, asset_id_source='ASSET_ID', fields=None)
async
List assets by asset ID or other identifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_class
|
type[AssetT]
|
The asset class to list. Must inherit from Asset. |
required |
asset_ids
|
list[int] | list[str]
|
A list of asset identifiers (int or str depending on asset_id_source). |
required |
asset_id_source
|
AssetIdSource
|
The type of identifier provided in asset_ids. |
'ASSET_ID'
|
fields
|
list[str] | None
|
Optional list of fields to retrieve. If None, all non-custom fields are retrieved. |
None
|
Yields:
| Type | Description |
|---|---|
AsyncIterator[AssetT]
|
Assets of the specified class matching the provided identifiers. |
Example
list_by_boundary_id(asset_class, boundary_ids, fields=None)
async
List assets by boundary ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_class
|
type[AssetT]
|
The asset class to list. Must inherit from Asset. |
required |
boundary_ids
|
list[int]
|
A list of boundary IDs to filter by. |
required |
fields
|
list[str] | None
|
Optional list of fields to retrieve. If None, all non-custom fields are retrieved. |
None
|
Yields:
| Type | Description |
|---|---|
AsyncIterator[AssetT]
|
Assets of the specified class belonging to any of the provided boundaries. |
Example
list_by_last_seen(asset_class, last_seen, fields=None)
async
List assets by last seen timestamp.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_class
|
type[AssetT]
|
The asset class to list. Must inherit from Asset. |
required |
last_seen
|
datetime | timedelta
|
Either a datetime (assets seen on or after this time) or timedelta (assets seen within this duration). |
required |
fields
|
list[str] | None
|
Optional list of fields to retrieve. If None, all non-custom fields are retrieved. |
None
|
Yields:
| Type | Description |
|---|---|
AsyncIterator[AssetT]
|
Assets of the specified class matching the last seen criteria. |
Raises:
| Type | Description |
|---|---|
ArmisError
|
If last_seen is neither datetime nor timedelta. |
Example
list_by_multiple(asset_class, last_seen=None, site_ids=None, boundary_ids=None, fields=None)
async
List assets matching multiple filter criteria simultaneously (AND logic).
At least one of last_seen, site_ids, or boundary_ids must be provided.
Each criterion that is provided is applied as an AND condition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_class
|
type[AssetT]
|
The asset class to list. Must inherit from Asset. |
required |
last_seen
|
datetime | timedelta | None
|
Either a datetime (assets seen on or after this time) or timedelta (assets seen within this duration). |
None
|
site_ids
|
list[int] | None
|
A list of site IDs to filter by. |
None
|
boundary_ids
|
list[int] | None
|
A list of boundary IDs to filter by. |
None
|
fields
|
list[str] | None
|
Optional list of fields to retrieve. If None, all non-custom fields are retrieved. |
None
|
Yields:
| Type | Description |
|---|---|
AsyncIterator[AssetT]
|
Assets of the specified class matching all provided criteria. |
Raises:
| Type | Description |
|---|---|
ArmisError
|
If no filter criteria are provided, or if last_seen is an invalid type. |
Example
list_by_site_id(asset_class, site_ids, fields=None)
async
List assets by site ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_class
|
type[AssetT]
|
The asset class to list. Must inherit from Asset. |
required |
site_ids
|
list[int]
|
A list of site IDs to filter by. |
required |
fields
|
list[str] | None
|
Optional list of fields to retrieve. If None, all non-custom fields are retrieved. |
None
|
Yields:
| Type | Description |
|---|---|
AsyncIterator[AssetT]
|
Assets of the specified class belonging to any of the provided sites. |
Example
list_fields(asset_class)
async
List all available fields for a given asset class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_class
|
type[AssetT]
|
The asset class to list fields for. Must inherit from Asset. |
required |
Yields:
| Type | Description |
|---|---|
AsyncIterator[AssetFieldDescription]
|
Field descriptions including field name, type, and other metadata. |
Example
update(assets, fields, asset_id_source='ASSET_ID')
async
Bulk update assets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
assets
|
list[AssetT]
|
A list of assets. Items must inherit from Asset. |
required |
fields
|
list[str]
|
A list of fields to update. Currently only custom properties are supported (i.e. |
required |
asset_id_source
|
AssetIdSource
|
From where on the asset to take the unique identifier. |
'ASSET_ID'
|
Raises:
| Type | Description |
|---|---|
BulkUpdateError
|
If an error occurs while trying to update any of the assets. |