Skip to content

DeviceCustomPropertiesClient

armis_sdk.clients.device_custom_properties_client.DeviceCustomPropertiesClient

Bases: BaseEntityClient

A client for interacting with device custom properties.

The primary entity for this client is DeviceCustomProperty.

Methods:

Name Description
create

Create a DeviceCustomProperty.

delete

Delete a DeviceCustomProperty.

get

Get a DeviceCustomProperty by its ID.

list

List all the tenant's DeviceCustomPropertys.

update

Update a DeviceCustomProperty.

create(property_) async

Create a DeviceCustomProperty.

Parameters:

Name Type Description Default
property_ DeviceCustomProperty

The DeviceCustomProperty to create.

required

Returns:

Type Description
DeviceCustomProperty

The same property as the input with the addition of id.

Example

Example:

import asyncio

from armis_sdk.clients.device_custom_properties_client import DeviceCustomPropertiesClient
from armis_sdk.entities.device_custom_property import DeviceCustomProperty


async def main():
    client = DeviceCustomPropertiesClient()
    property_ = DeviceCustomProperty(name="MyConfig", type="string")
    print(await client.create(property_))


asyncio.run(main())
Will output:
DeviceCustomPropertiesClient(id=1, name="MyConfig", type="string")

delete(property_) async

Delete a DeviceCustomProperty.

Parameters:

Name Type Description Default
property_ DeviceCustomProperty

The DeviceCustomProperty to delete.

required
Example

Example:

import asyncio

from armis_sdk.clients.device_custom_properties_client import DeviceCustomPropertiesClient
from armis_sdk.entities.device_custom_property import DeviceCustomProperty


async def main():
    client = DeviceCustomPropertiesClient()
    property_ = DeviceCustomProperty(id=1, name="MyConfig", type="string")
    await client.delete(property_)


asyncio.run(main())

get(property_id) async

Get a DeviceCustomProperty by its ID.

Parameters:

Name Type Description Default
property_id int

The ID of the DeviceCustomProperty to get.

required

Returns:

Type Description
DeviceCustomProperty

A DeviceCustomProperty object.

Example

Example:

import asyncio

from armis_sdk.clients.device_custom_properties_client import DeviceCustomPropertiesClient


async def main():
    client = DeviceCustomPropertiesClient()
    print(await client.get(1))


asyncio.run(main())
Will output:
DeviceCustomPropertiesClient(id=1, name="MyConfig", type="string")

list() async

List all the tenant's DeviceCustomPropertys. This method takes care of pagination, so you don't have to deal with it.

Returns:

Type Description
AsyncIterator[DeviceCustomProperty]

An (async) iterator of DeviceCustomProperty object.

Example

import asyncio

from armis_sdk.clients.device_custom_properties_client import DeviceCustomPropertiesClient


async def main():
    client = DeviceCustomPropertiesClient()
    async for property_ in client.list()
        print(property_)

asyncio.run(main())
Will output:
DeviceCustomPropertiesClient(id=1, name="MyConfig", type="string")
DeviceCustomPropertiesClient(id=1, name="MyOtherConfig", type="integer")

update(property_) async

Update a DeviceCustomProperty. Only description and allowed_values are updatable.

Parameters:

Name Type Description Default
property_ DeviceCustomProperty

The DeviceCustomProperty to update.

required

Raises:

Type Description
ResponseError

If an error occurs while communicating with the API.

Example
import asyncio

from armis_sdk.clients.device_custom_properties_client import DeviceCustomPropertiesClient
from armis_sdk.entities.device_custom_property import DeviceCustomProperty


async def main():
    client = DeviceCustomPropertiesClient()
    property_ = DeviceCustomProperty(
        id=1,
        name="MyConfig",
        type="string",
        description="New description",
    )
    await client.update(property_)


asyncio.run(main())