Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ For full documentation, please visit our [dedicated](https://armis-python-sdk.re

## Usage

All interaction with the SDK happens through the `ArmisSdk` class. You'll need three things:
All interaction with the SDK happens through the `ArmisSdk` class. You'll need five 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.
1. **Audience**: The url of the tenant you want to interact with, including trailing slash (e.g. `https://acme.armis.com/`).
2. **Client ID**: The email address of the user account within the tenant that was used to generate the Client Secret.
3. **Client Secret**: The confidential credential generated by your customer within Armis, paired with the Client ID.
4. **Vendor ID**: An identifier unique to your developer account or integration, obtained when you register on our developer portal.
5. **Scopes**: The specific permissions required by your access token to interact with the desired API endpoints.

You can either provide these values using the environment variables `ARMIS_TENANT`, `ARMIS_SECRET_KEY`, and `ARMIS_CLIENT_ID`:
You can either provide these values using the environment variables `ARMIS_AUDIENCE`, `ARMIS_CLIENT_ID`, `ARMIS_CLIENT_SECRET`, `ARMIS_VENDOR_ID`, and `ARMIS_CLIENT_ID`:
```python
from armis_sdk import ArmisSdk

Expand All @@ -32,16 +34,30 @@ armis_sdk = ArmisSdk()
or by passing them explicitly:
```python
from armis_sdk import ArmisSdk

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

credentials = ClientCredentials(
audience="<audience>",
client_id="<client_id>",
client_secret="<client_secret>",
vendor_id="<vendor_id>",
scopes=["scope1", "scope2"],
)
armis_sdk = ArmisSdk(credentials=credentials)
```

> [!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:
> If you're building an application that interacts with multiple tenants, you can populate only the `ARMIS_VENDOR_ID` and `ARMIS_SCOPES` environment variable and pass the `audience`, `client_id` and `client_secret` explicitly:
> ```python
> from armis_sdk import ArmisSdk
> from armis_sdk import ClientCredentials
>
> armis_sdk = ArmisSdk(tenant="<tenant>", secret_key="<secret_key>")
> credentials = ClientCredentials(
> audience="<audience>",
> client_id="<client_id>",
> client_secret="<client_secret>",
> )
> armis_sdk = ArmisSdk(credentials=credentials)
> ```

## Entity clients
Expand All @@ -63,7 +79,7 @@ from armis_sdk.entities.site import Site
armis_sdk = ArmisSdk()

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

asyncio.run(main())
Expand Down
1 change: 1 addition & 0 deletions armis_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from armis_sdk.core.armis_sdk import ArmisSdk
from armis_sdk.core.client_credentials import ClientCredentials
129 changes: 0 additions & 129 deletions armis_sdk/clients/network_equipment_client.py

This file was deleted.

111 changes: 0 additions & 111 deletions armis_sdk/clients/site_integrations_client.py

This file was deleted.

Loading