Skip to content

Index

armis_sdk.clients.assets_client.AssetsClient

Bases: BaseEntityClient

A client for interacting with assets.

The primary entities for this client inherit from Asset:

  1. Device

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
import asyncio

from armis_sdk.clients.assets_client import AssetsClient
from armis_sdk.entities.device import Device


async def main():
    assets_client = AssetsClient()

    device_ids = [1, 2, 3]
    ipv4_addresses = ["1.1.1.1", "2.2.2.2", "3.3.3.3"]

    # List by the default source "ASSET_ID"
    async for device in assets_client.list_by_asset_id(Device, device_ids):
        print(device)

    # List by explicit source "IPV4_ADDRESS"
    async for device in assets_client.list_by_asset_id(Device, ipv4_addresses, asset_id_source="IPV4_ADDRESS"):
        print(device)


asyncio.run(main())

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
import asyncio

from armis_sdk.clients.assets_client import AssetsClient
from armis_sdk.entities.device import Device


async def main():
    assets_client = AssetsClient()

    async for device in assets_client.list_by_boundary_id(Device, [1, 2, 3]):
        print(device)


asyncio.run(main())

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
import asyncio
import datetime

from armis_sdk.clients.assets_client import AssetsClient
from armis_sdk.entities.device import Device


async def main():
    assets_client = AssetsClient()

    # List devices seen in the last 24 hours
    async for device in assets_client.list_by_last_seen(Device, datetime.timedelta(days=1)):
        print(device)

    # List devices seen on or after December 8, 2025
    async for device in assets_client.list_by_last_seen(Device, datetime.datetime(2025, 12, 8)):
        print(device)


asyncio.run(main())

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
import asyncio
import datetime

from armis_sdk.clients.assets_client import AssetsClient
from armis_sdk.entities.device import Device


async def main():
    assets_client = AssetsClient()

    async for device in assets_client.list_by_multiple(
        Device,
        site_ids=[1, 2],
        last_seen=datetime.timedelta(hours=1),
    ):
        print(device)


asyncio.run(main())

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
import asyncio

from armis_sdk.clients.assets_client import AssetsClient
from armis_sdk.entities.device import Device


async def main():
    assets_client = AssetsClient()

    async for device in assets_client.list_by_site_id(Device, [1, 2, 3]):
        print(device)


asyncio.run(main())

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
import asyncio

from armis_sdk.clients.assets_client import AssetsClient
from armis_sdk.entities.device import Device


async def main():
    assets_client = AssetsClient()

    async for field in assets_client.list_fields(Device):
        print(f"{field.name}: {field.type}")


asyncio.run(main())

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. custom.MyField).

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.

Example
import asyncio

from armis_sdk.clients.assets_client import AssetsClient
from armis_sdk.entities.device import Device


async def main():
    assets_client = AssetsClient()

    device = Device(device_id=1, ipv4_addresses=["1.2.3.4"], custom={"MyField": "Hello, World"})

    # Update based on the default source "ASSET_ID"
    await assets_client.update([device], ["custom.MyField"])

    # Update based on the explicit source "IPV4_ADDRESS"
    await assets_client.update([device], ["custom.MyField"], asset_id_source="IPV4_ADDRESS")


asyncio.run(main())