Question

How to access Versa Analytics REST APIs using CURL tool?


Solution

Versa Analytics supports only token based authentication and does not support basic authentication.


Follow these steps to access Versa Analytics:

  1. Login to the Versa Analytics and run this CURL command to issue REST APIs.
    $ curl -c cookies.txt -d "username=admin&password=versa123" http://hostname:8080/versa/login   
    The cookies.txt created as part of login request will have the jsession_id that is sent in the HTTP header in subsequent requests to Versa Analytics.

  2. Run this command to get all the SDWAN tenants.

    $ curl -b cookies.txt http://hostname:8080/versa/analytics/v1.0.0/data/provider/features/SDWAN/tenants

  3. Logout when done
$ curl -b cookies.txt http://hostname:8080/versa/logout