Skip to content

Index

armis_sdk.clients.collectors_client.CollectorsClient

Bases: BaseEntityClient

A client for interacting with Armis collectors.

The primary entity for this client is CollectorImage.

Methods:

Name Description
download_image

Download a collector image to a specified destination path / file.

get_image

Get collector image information including download URL and credentials.

download_image(destination, image_type='OVA') async

Download a collector image to a specified destination path / file.

Parameters:

Name Type Description Default
destination str | IO[bytes]

The file path or file-like object where the collector image will be saved.

required
image_type CollectorImageType

The type of collector image to download. Defaults to "OVA".

'OVA'

Returns:

Type Description
AsyncIterator[DownloadProgress]

An (async) iterator of DownloadProgress object.

Example

import asyncio

from armis_sdk.clients.collectors_client import CollectorsClient


async def main():
    collectors_client = CollectorsClient()

    # Download to a path
    async for progress in armis_sdk.collectors.download_image("/tmp/collector.ova"):
        print(progress.percent)

    # Download to a file
    with open("/tmp/collector.ova", "wb") as file:
        async for progress in armis_sdk.collectors.download_image(file):
            print(progress.percent)


asyncio.run(main())
Will output:
1
2
3
1%
2%
3%
etc.

get_image(image_type='OVA') async

Get collector image information including download URL and credentials.

Parameters:

Name Type Description Default
image_type CollectorImageType

The type of collector image to retrieve. Defaults to "OVA".

'OVA'

Returns:

Type Description
CollectorImage

A CollectorImage object.

Example

import asyncio

from armis_sdk.clients.collectors_client import CollectorsClient


async def main():
    collectors_client = CollectorsClient()
    print(await collectors_client.get_image(image_type="OVA"))


asyncio.run(main())
Will output:
CollectorImage(url="...", ...)