Teevity API and CLI
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.
Teevity exposes all the features available on its web portal trough an API. The endpoints documentation is available here:
https://api.teevity.com/light/index.html - lightweight version
https://api.teevity.com/withSamples/index.html - complete version with samples (very large HTML page to load)
The API is based on REST services which support JSON as document formats. To authenticate you either pass the access key:
in the query string: ?accessKey=<TEEVITY_API_KEY>
or in a header called x-teevity-accessKey
Command Line tool
The lastest version is available here [link pointing to our public GCS bucket].
The package contains 3 files:
The CLI tool as a JAR file
a shell script to invoke commands on macOS/Linux/Unix systems
a DOS script to invoke commands on Microsoft Windows
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>
./teevity.sh rua get-resourceUsageAnalysis-configuration --key <TEEVITY_API_KEY>
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"