summaryrefslogtreecommitdiff
path: root/modules/daemon.py
blob: e5987d29786f096e10bb2bff58d5f9adf90d6ef9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import openapi_client

class Daemon():

    def __init__(self, agent_symbol, token):
        config = openapi_client.Configuration(access_token = token)
        self.api_client = openapi_client.ApiClient(config)
        self.api_instance = openapi_client.AgentsApi(self.api_client)
        self.agent_symbol = agent_symbol

    def run(self):
        try:
            api_response = self.api_instance.get_agent(self.agent_symbol)
            print("The response of AgentsApi->get_agent:\n")
            print(api_response)
        except Exception as e:
            print("Exception when calling AgentsApi->get_agent: %s\n" % e)