Skip to content

Commit 5a514d7

Browse files
Add agent example to readme (#114)
1 parent 011ebf9 commit 5a514d7

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ Insights server.
55

66
## Usage
77

8+
### Custom source interactions
9+
10+
The following snippet shows how to authenticate as a custom source and create a connector log at an Elimity Insights
11+
server. You can generate a source identifier and token by visiting the custom source's detail page in Elimity Insights
12+
and clicking the 'GENERATE CREDENTIALS' button, which can be found under the 'SETTINGS' tab.
13+
814
```python3
915
from datetime import datetime
1016

1117
from elimity_insights_client import Client, Config, ConnectorLog, Level
1218

1319
if __name__ == "__main__":
14-
config = Config(url="https://local.elimity.com:8081", token="token")
20+
config = Config(id=1, url="https://local.elimity.com:8081", token="token")
1521
client = Client(config)
1622

1723
timestamp = datetime.now()
@@ -20,6 +26,21 @@ if __name__ == "__main__":
2026
client.create_connector_logs(logs)
2127
```
2228

29+
### Agent interactions
30+
31+
This module also provides a client for agent interactions with Elimity Insights. The snippet below shows how to
32+
authenticate as an agent and list sources at an Elimity Insights server. You can generate a token identifier and
33+
secret by visiting the 'API tokens' page in Elimity Insights and clicking the 'CREATE API TOKEN' button.
34+
35+
```python3
36+
from elimity_insights_client.agent.api import Config, sources
37+
38+
if __name__ == "__main__":
39+
config = Config(token_id="1", token_secret="my-secret-value", url="https://example.elimity.com", verify_ssl=True)
40+
my_sources = sources(config)
41+
print(my_sources)
42+
```
43+
2344
## Installation
2445

2546
```sh

0 commit comments

Comments
 (0)