Teevity API and CLI

Access Key

To use the API or the command line tool you will need your access key. You will find your key in the preferences pages under the API section.

API

Teevity exposes all the features available on its web portal trough an API. The endpoints documentation is available here:

The API is based on REST services which support JSON as document formats. To authenticate you either pass the access key:

Command Line tool

The lastest version is available here [link pointing to our public GCS bucket]. 

The package contains 3 files:

To run the CLI you must have a Java Runtime installed (version 8 and following; tested with Java 11). 

You can pass your access key as an argument or set the TEEVITY_APIKEY environment variable

The syntax is 

./teevity.sh <service> <command> --key <TEEVITY_API_KEY> --argument <VALUE>

Example:

./teevity.sh rua get-resourceUsageAnalysis-configuration --key <TEEVITY_API_KEY>

      --resourceUsageAnalysis "<resourceUsageAnalysisUUID>"

to fetch the resources usage analysis configuration with the ID <resourceUsageAnalysisUUID>

./teevity to get the help manual including the list of services. 

./teevity <service> --help to get the commands for a service.

The CLI will output an OPERATION_ID that you can use in a subsequent command to get the result of your orignal command.  

./teevity <service> checkOperationStatus --key <TEEVITY_API_KEY> --id <OPERATION_ID>

For example, to check the declaration of a new cloud service in your Teeevity account:

./teevity cloudservices checkOperationStatus --key <TEEVITY_API_KEY> --id "b300dcb9-d3cf-4cb2-8659-d234ba1a59a0"