lavacli is the preferred command-line tool for interacting with the
various services offered by LAVA via XML-RPC APIs as well as using ZMQ.
The full list of XML-RPC API calls is visible on the Available
methods link from the API menu:

http://localhost/api/help

The API help page includes an example python script to connect to the local
instance. To add token support, use the syntax username:token for the
server concerned:

lavacli supports multiple identities to interact with multiple
instances of LAVA and as multiple users.

lavacli can be used by users directly or in scripts. Scripts used
by build servers and continuous integration tools should ideally use a
dedicated user account. lavacli does not use prompts or other
interactive operations and secrets like tokens can be provided using a
configuration file (~/.config/lavacli.yaml) if the command line
option is not suitable.

lavacli can be installed alongside LAVA if the top level lava
package is installed on a Debian-based distribution. lavacli can also be installed on any remote
machine running a Debian-based distribution, without needing the rest
of LAVA. This allows a remote user to interact with any LAVA instance
on which the user has an account.:

$ sudo apt update
$ sudo apt install lavacli

(If you are installing on Debian Stretch, you will need to first enable
backports to install lavacli) and tell apt to use
stretch-backports:

Once the token is created, add it to the configuration of lavacli.
Click on the “Display the token” link on the “Authentication Tokens”
page and copy the token. e.g. if your token was created on
validation.linaro.org then you may want to use the identity
production. The uri is typically provided on the Available
methods page, e.g. http://localhost/api/help.

Run lavacli as your normal username. Avoid using sudo.

The syntax is:

--token<TOKEN>--uri<URI>--username<USERNAME><IDENTITY>

(<TOKEN> is the displayed Authentication Token string)

Note

You should configure and use https:// for all
public instances. Only use http:// for localhost or
developer instances.