LAA manager (aka. laam) - Console

The LAA Manager is a python application that allows to interact with the LAA REST API.

This is the documentation to use laam via commands on a console.

LAA manager v0.8.3

The documentation refers to laam v0.8.3. Version notes at the bottom

Installation

laam is available from PyPI:

python3 -m venv venv
source venv/bin/activate
python3 -m pip install laam
python3 -m pip install --upgrade  laam 
laam --help
laam --version

Configuration

In order to use laam with your LAA, you must create an identity with:

laam identities add --uri <uri> --token <token> <id_name>

# Example:
laam identities add --uri 192.168.1.234 --token abcdefghijklmnopqrstuvwxyz0123456789 laa101

Where:

  • <uri>: URL of the LAA, you can use the ip address indicated on the OLED screen

  • <token>: api token created on the LAA as indicated in here

  • <id_name>: name of the identity

laam identities are stored in ~/.config/laam.yaml.

The format of the file is pretty simple as it’s a list of dictionaries where the key if the identity name. The file would look like:

default:
  token: xxxyyyzzz
  uri: http://192.168.1.234
identity-1:
  token: abcdef
  uri: http://laa-00001.local
identity-2:
  token: 123456
  uri: http://laa-00002.local

The identities can then be used:

$ laam -i identity-1

Identity selection

You can have multiple identities, each with a unique name. When running laam you can select the identity to use with laam -i <identity> ....

Default Identity

When no -i identity is provided, laam will use the identity called default. It is suggested to manually create a default identity, or laam will fail.

Local Commands

β€œLocal” commands won’t need an identity. Examples are: help, version, dut new, dut check.

Usage

These are all the commands available on laam:

$ laam --help
usage: laam [-h] [--version] [--uri URI] [--token TOKEN] [--identity ID]
            {identities,dut,files,laacli,network,serials,services,system,usbs,workers} ...

Linaro Automation Appliance Manager

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

identity:
  --uri URI             URI of the LAA API
  --token TOKEN         Token for the LAA API
  --identity ID, -i ID  Identity stored in the configuration

Command:
  {identities,dut,files,laacli,network,serials,services,system,usbs,workers}
                        Command
    identities          Manage laam configuration
    dut                 Enable attached DUT
    files               Manage files in /var/lib/lava/dispatcher/tmp
    laacli              Run laacli commands on the LAA
    network             Manage network
    serials             Manage DUT serials
    services            Manage services
    system              Get LAA Info
    usbs                List USB devices
    workers             Manage workers

Commands

identities

Manage laam identities stored in ~/.config/laam.yaml.

$ laam identities --help
usage: laam identities [-h] {add,update,delete,list,show} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {add,update,delete,list,show}
                        Sub command
    add                 add an identity
    update              update an identity
    delete              delete an identity
    list                list available identities
    show                show identity details

dut

It is a command that helps the creating new device configuration files and tests them.

$ laam dut --help
usage: laam dut [-h] {check,new,render,test,interact} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {check,new,render,test,interact}
                        Sub command
    check               Check the configuration
    new                 Create a device configuration file
    render              Render device-type template and device dict
    test                Boot test the DUT
    interact            Powers on the DUT and starts serial. Ctrl+C to stop and power off.

Local Commands

The following commands don’t need identity: dut new, dut check.

files

Manage files in /var/lib/lava/dispatcher/tmp on the LAA.

$ laam files --help
usage: laam files [-h] {list,pull,push,rm} ...

options:
  -h, --help           show this help message and exit

Sub command:
  {list,pull,push,rm}  Sub command
    list               List files
    pull               Pull a file
    push               Push a file
    rm                 Remove a file

laacli

Execute laacli commands on the LAA.

$ laam laacli --help
usage: laam laacli [-h] {button,led,power,rev,screenshot,temp,usb,usbg-ms,watt} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {button,led,power,rev,screenshot,temp,usb,usbg-ms,watt}
                        Sub command
    button              Virtual buttons
    led                 User LED
    power               Power rails
    rev                 LAA revision
    screenshot          OLED screenshot
    temp                Query temperature (Β°C)
    usb                 USB hub
    usbg-ms             USB Gadget Mass storage
    watt                Power consumption

network

Manage LAA network configuration

$ laam network --help
usage: laam network [-h] {addresses,hostname,interfaces,routes,settings} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {addresses,hostname,interfaces,routes,settings}
                        Sub command
    addresses           List addresses
    hostname            Hostname
    interfaces          List interfaces
    routes              List routes
    settings            Settings

serials

List and interact with the different serial consoles provided by the LAA.

$ laam serials --help
usage: laam serials [-h] {list,connect,show} ...

options:
  -h, --help           show this help message and exit

Sub command:
  {list,connect,show}  Sub command
    list               List serials
    connect            Connect to serial
    show               Serial details

services

Monitor systemd services running on the LAA.

$ laam services --help
usage: laam services [-h] {list,logs} ...

options:
  -h, --help   show this help message and exit

Sub command:
  {list,logs}  Sub command
    list       List services
    logs       Services logs

system

Display LAA system information.

$ laam system --help
usage: laam system [-h] {logs,fleet,version} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {logs,fleet,version}  Sub command
    logs                Appliance logs
    fleet               Bakfleet Information
    version             Appliance Version

usbs

Display usb devices.

$ laam usbs --help
usage: laam usbs [-h] {list,show} ...

options:
  -h, --help   show this help message and exit

Sub command:
  {list,show}  Sub command
    list       List USB devices
    show       USB details

workers

Manage LAVA workers running on the LAA.

$ laam workers --help
usage: laam workers [-h] {dockerfile,list,logs,show,test} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {dockerfile,list,logs,show,test}
                        Sub command
    dockerfile          LAVA worker Dockerfile
    list                List workers
    logs                Worker logs
    show                Worker details
    test                Test connection to server

Issues

In case you of problems open an issue

Version notes

LED sub-command

The LED sub-command is working from LAA OS > v1.6.1.

LAA OS v1.4

The REST API used by laam is only available in LAA OS v1.4 and after.

LAA manager =< v0.8.1

laam =< v0.8.1 serials connect command cannot connect with LAA OS =< v1.5.5. This has been fixed in laam v0.8.2

LAA manager v0.8.2

The β€œlaam network settings” command fails. This has been fixed in laam v0.8.3