.\" Man page generated from reStructuredText. . .TH "LAVACLI" "1" "January 29, 2020" "1.0 " "lavacli" .SH NAME lavacli \- lavacli Documentation . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .sp lavacli is a command line tool to interact with one or many LAVA instances using XML\-RPC. .SH FEATURES .sp lavacli allows you to interact with all LAVA objects: .INDENT 0.0 .IP \(bu 2 aliases .IP \(bu 2 device\-types .IP \(bu 2 devices .IP \(bu 2 events .IP \(bu 2 jobs .IP \(bu 2 results .IP \(bu 2 tags .IP \(bu 2 workers .UNINDENT .SH TABLE OF CONTENTS .SS Installation .SS Debian .sp A \fI\%Debian package\fP is available for Debian unstable and could be installed with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C apt install lavacli .ft P .fi .UNINDENT .UNINDENT .SS PyPi .sp lavacli is also available on \fI\%Pypi\fP and can be installed with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C pip install lavacli .ft P .fi .UNINDENT .UNINDENT .SS Development versions .sp It\(aqs also possible to use lavacli directly from the sources: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C git clone https://git.lavasoftware.org/lava/lavacli.git cd lavacli virtualenv \-p python3 venv source venv/bin/activate pip install \-r requirements.txt python3 \-m lavacli .ft P .fi .UNINDENT .UNINDENT .SS Configuration .sp lavacli can be used with or without a configuration file. Having a configuration file will help when using more than one lava instance. .SS Without a configuration file .sp When using lavacli without any configuration file, the uri should be passed as a command line argument: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli \-\-uri https://validation.linaro.org/RPC2 devices list .ft P .fi .UNINDENT .UNINDENT .sp The authentication can also be passed in the uri: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli \-\-uri https://admin:my_secret_token@validation.linaro.org/RPC2 devices list .ft P .fi .UNINDENT .UNINDENT .sp Keep in mind, that any user on the same machine will then see the username and token in the process list. .SS With a configuration file .sp lavacli configuration file is stored in \fB~/.config/lavacli.yaml\fP\&. This is a YAML dictionary where each key is an \fIidentity\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C default: uri: https://validation.linaro.org/RPC2 validation: uri: https://validation.linaro.org/RPC2 admin@validation: uri: https://validation.linaro.org/RPC2 username: admin token: my_secret_token staging: uri: https://staging.validation.linaro.org/RPC2 events: uri: tcp://staging.validation.linaro.org:5500 .ft P .fi .UNINDENT .UNINDENT .sp When using lavacli, the \fIidentity\fP can be used with \fB\-i\fP or \fB\-\-identity\fP: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli \-i admin@validation devices list lavacli \-i staging events listen .ft P .fi .UNINDENT .UNINDENT .sp By default, the \fBdefault\fP identity will be used. Hence both commands are identitical: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli devices list lavacli \-i validation devices list .ft P .fi .UNINDENT .UNINDENT .SS Available options .sp For each identity, you have to set: .INDENT 0.0 .IP \(bu 2 \fBuri\fP: the uri of the RPC endpoint. .UNINDENT .sp You can also set: .INDENT 0.0 .IP \(bu 2 \fBusername\fP: the api username .IP \(bu 2 \fBtoken\fP: the api token .IP \(bu 2 \fBversion\fP: the api version to use when talking to this instance .IP \(bu 2 \fBtimeout\fP: the http timeout (defaults to 20 seconds) .IP \(bu 2 \fBproxy\fP: the uri to the proxy .IP \(bu 2 \fBverify_ssl_cert\fP: set it to true to ignore SSL certificates errors (defaults to false) .IP \(bu 2 \fBevents\fP: zmq event configuration .UNINDENT .sp The \fBevents\fP key is a dictionary where you can specify: .INDENT 0.0 .IP \(bu 2 \fBuri\fP: the uri of the events stream. If not specified, lavacli will ask the server. .IP \(bu 2 \fBsocks_proxy\fP: uri to the socks proxy, if needed .UNINDENT .SS Usage .sp Here is the list of available commands and sub\-commands. .SS Aliases .sp LAVA aliases can be managed by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli aliases add lavacli aliases delete lavacli aliases list lavacli aliases show .ft P .fi .UNINDENT .UNINDENT .SS Device types .sp LAVA device types can be managed by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli device\-types add [...] lavacli device\-types aliases add lavacli device\-types aliases delete lavacli device\-types aliases list lavacli device\-types health\-check get lavacli device\-types health\-check set lavacli device\-types list lavacli device\-types show lavacli device\-types template get lavacli device\-types template set lavacli device\-types update [...] .ft P .fi .UNINDENT .UNINDENT .SS Devices .sp LAVA devices can be managed by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli devices add [...] lavacli devices dict get lavacli devices dict set lavacli devices list lavacli devices maintenance lavacli devices show lavacli devices tags add lavacli devices tags delete lavacli devices tags list lavacli devices update [...] .ft P .fi .UNINDENT .UNINDENT .SS Events .sp LAVA events can be used by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli events listen lavacli events wait device [...] lavacli events wait job [...] lavacli events wait worker [...] .ft P .fi .UNINDENT .UNINDENT .SS Identities .sp lavacli identities can be managed by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli identities add [...] lavacli identities delete lavacli identities list lavacli identities show .ft P .fi .UNINDENT .UNINDENT .SS Jobs .sp LAVA jobs can be managed by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli jobs cancel lavacli jobs config lavacli jobs definition lavacli jobs list lavacli jobs logs lavacli jobs queue lavacli jobs resubmit lavacli jobs run lavacli jobs show lavacli jobs submit lavacli jobs validate lavacli jobs wait .ft P .fi .UNINDENT .UNINDENT .SS Results .sp LAVA results can be managed by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli results lavacli results lavacli results .ft P .fi .UNINDENT .UNINDENT .SS System .sp LAVA instance can be managed by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli system active lavacli system api lavacli system export lavacli system maintenance lavacli system methods list lavacli system methods help lavacli system methods signature lavacli system version lavacli system whoami .ft P .fi .UNINDENT .UNINDENT .sp In order to put a full instance into maintenance, an admin could call \fBsystem maintenance\fP\&. This function will: .INDENT 0.0 .IP \(bu 2 set all workers health to \fIMAINTENANCE\fP .IP \(bu 2 wait for all jobs to finish .UNINDENT .sp If the instance should be put into into maintenance immediately, addind \fB\-\-force\fP will: .INDENT 0.0 .IP \(bu 2 set all workers health to \fIMAINTENANCE\fP .IP \(bu 2 cancel all running jobs .IP \(bu 2 wait for all jobs to finish .UNINDENT .sp It also possible to exclude some workers with \fB\-\-exclude\fP\&. .sp When the maintenance is finished, calling \fBsystem active\fP will move every worker into \fIMAINTENANCE\fP to \fIACTIVE\fP\&. .SS Tags .sp LAVA tag can be managed by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli tags add [...] lavacli tags delete lavacli tags list lavacli tags show .ft P .fi .UNINDENT .UNINDENT .SS Utils .sp Some utilities are available with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli utils logs print lavacli utils templates render .ft P .fi .UNINDENT .UNINDENT .SS Printing logs .sp When working with raw logs, lavacli might help by coloring the logs by levels. .sp It\(aqs also possible to filter the logs by level. To only print the serial output and the commands sent by LAVA to the board, use: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli utils logs print \-\-filter target,input .ft P .fi .UNINDENT .UNINDENT .sp Available log levels are: exception, error, warning, info, debug, target, input, feedback, results. .SS Workers .sp LAVA workers can be managed by: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C lavacli workers add [...] lavacli workers config get lavacli workers config set lavacli workers env get lavacli workers env set lavacli workers list lavacli workers maintenance lavacli workers update [...] lavacli workers show .ft P .fi .UNINDENT .UNINDENT .SH AUTHOR Rémi Duraffort .SH COPYRIGHT 2020, Rémi Duraffort .\" Generated by docutils manpage writer. .