Exporting data out of LAVA

LAVA supports two methods of extracting data and results are available whilst the job is running, XML-RPC and the REST API.

REST API

LAVA V2 makes the test results available directly from the instance, without needing to go through lava-tool. Currently, the results for any test job can be downloaded as CSV and YAML format.

For example, the results for test job number 123 are available as CSV using:

https://validation.linaro.org/results/123/csv

The same results for job number 123 are available as YAML using:

https://validation.linaro.org/results/123/yaml

If you know the test definition name, you can download the results for that specific test definition only in the same way:

https://validation.linaro.org/results/123/singlenode-advanced/csv
https://validation.linaro.org/results/123/singlenode-advanced/yaml

Some test jobs can be restricted to particular users or groups of users. The results of these test jobs are restricted in the same way. To download these results, you will need to specify your username and one of your Authentication Tokens - remember to quote the URL if using it on the command line or the & will likely be interpreted by your shell:

'https://validation.linaro.org/results/123/csv?user=user.name&token=yourtokentextgoeshereononeverylongline'

$ curl 'https://validation.linaro.org/results/123/singlenode-advanced/yaml?user=user.name&token=yourtokentextgoeshereononeverylongline'

Use the Username as specified in your Profile - this may differ from the username you use when logging in with LDAP.

Caution

Take care of your tokens - avoid using personal tokens in scripts and test definitions or other files that end up in public git repositories. Wherever supported, use https:// when using a token.

XML-RPC

LAVA uses XML-RPC to communicate between dispatchers and the server and methods are available to query various information in LAVA.

Warning

When using XML-RPC to communicate with a remote server, check whether https:// can be used to protect the token. http:// connections to a remote XML-RPC server will transmit the token in plaintext. Not all servers have https:// configured. If a token becomes compromised, log in to that LAVA instance and delete the token before creating a new one.

The general structure of an XML-RPC call can be shown in this python snippet:

import xmlrpclib
import json

config = json.dumps({ ... })
server=xmlrpclib.ServerProxy("http://username:API-Key@localhost:8001/RPC2/")
jobid=server.scheduler.submit_job(config)

XML-RPC can also be used to query data anonymously:

import xmlrpclib
server = xmlrpclib.ServerProxy("http://sylvester.codehelp/RPC2")
print server.system.listMethods()

Individual XML-RPC commands are documented on the API Help page.