API Mode

Thola can be executed as a REST API. You can start the API using the api command:

$ thola api
 ______   __  __     ______     __         ______   
/\__  _\ /\ \_\ \   /\  __ \   /\ \       /\  __ \  
\/_/\ \/ \ \  __ \  \ \ \/\ \  \ \ \____  \ \  __ \
   \ \_\  \ \_\ \_\  \ \_____\  \ \_____\  \ \_\ \_\
    \/_/   \/_/\/_/   \/_____/   \/_____/   \/_/\/_/

⇨ http server started on [::]:8237

For sending requests to the Thola API you can use the Thola client. When executing the Thola client you can specify the address of the API with the --target-api flag.

$ thola-client identify 10.204.2.90 --target-api http://192.168.10.20:8237

Device:
  Class: ceraos/ip10
    Properties:
      Vendor: Ceragon
      Model: IP-10
      SerialNumber: 00:0A:25:25:77:67
      OSVersion: 2.9.25-1

You can find the full API documentation on our SwaggerHub.

Running as systemd

The Thola API can easily be executed as a systemd service. A basic service file can be found at scripts/thola.service. Copy this file to /etc/systemd/system. Adjust the following line to point to your Thola binary:

ExecStart=/usr/local/bin/thola api

After that, just run systemctl daemon-reload to reload all deamon plugins including you newly added Thola API. Then you can enable it with systemctl enable thola.service and finally start it with systemctl start thola.service.