Skip to content

ArmisSecurity/armis-sdk-python

Repository files navigation

Armis SDK for Python 3.9+

Run tests Run formatter Run linter

The Armis SDK is a package that encapsulates common use-cases for interacting with the Armis platform.

Installation

Use your favourite package manager to install the SDK, for example:

pip install armis_sdk

Documentation

For full documentation, please visit our dedicated site.

Usage

All interaction with the SDK happens through the ArmisSdk class. You'll need three things:

  1. Tenant name: The name of the tenant you want to interact with.
  2. Secret key: The secret key associated with the tenant, obtained from the tenant itself.
  3. Client id: A unique identifier for your application. Currently, this can be any string.

You can either provide these values using the environment variables ARMIS_TENANT, ARMIS_SECRET_KEY, and ARMIS_CLIENT_ID:

from armis_sdk import ArmisSdk

armis_sdk = ArmisSdk()

or by passing them explicitly:

from armis_sdk import ArmisSdk

armis_sdk = ArmisSdk(tenant="<tenant>", secret_key="<secret_key>", client_id="<client_id>")

Tip

If you're building an application that interacts with multiple tenants, you can populate only the ARMIS_CLIENT_ID environment variable and pass the tenant and secret_key explicitly:

from armis_sdk import ArmisSdk

armis_sdk = ArmisSdk(tenant="<tenant>", secret_key="<secret_key>")

Entity clients

Once you have an instance of ArmisSdk, you can start interacting with the various clients. Each handles use-cases of a specific entity.

Note

Note that all functions in this SDK that eventually make HTTP requests are asynchronous.

However, for convenience, all public asynchronous functions can also be executed in a synchronous way.

For example, if you want to update a site's location:

import asyncio

from armis_sdk import ArmisSdk
from armis_sdk.entities.site import Site

armis_sdk = ArmisSdk()

async def main():
    site = Site(id="1", location="new location")
    await armis_sdk.sites.update(site)

asyncio.run(main())

About

The Armis SDK is a package that encapsulates common use-cases for interacting with the Armis platform.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages