LAA manager (also known as 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.

Installation

laam is available from PyPI:

python3 -m venv venv
source venv/bin/activate
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 http://192.168.1.234 --token abcdefghijklmnopqrstuvwxyz0123456789 laa101

Where:

  • <uri>: URL of the LAA, you can use the ip address (prefixed with http://) indicated on the OLED screen

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

  • <id_name>: name of the identity

laam identities are stored in ~/.config/laam.yaml, or in $XDG_CONFIG_HOME/laam.yaml when XDG_CONFIG_HOME is set.

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 <command>

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.

Identity-less usage

Instead of an identity, you can pass --uri and --token directly. Both must be given together, and they cannot be combined with -i.

Local Commands

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

Usage

These are all the commands and options available on laam:

$ laam --help
usage: laam [-h] [--version] [--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--uri URI] [--token TOKEN] [--identity ID]
            {identities,dut,files,laacli,mcp,network,serials,services,ssh,system,usbs,workers} ...

Linaro Automation Appliance Manager

options:
  -h, --help            show this help message and exit
  --version             show program version number and exit
  --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set the logging level

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,mcp,network,serials,services,ssh,system,usbs,workers}
                        Command
    identities          Manage laam configuration
    dut                 Enable attached DUT
    files               Manage files and directories in /var/lib/lava/dispatcher/tmp
    laacli              Run laacli commands on the LAA
    mcp                 Start the MCP server
    network             Manage network
    serials             Manage DUT serials
    services            Manage services
    ssh                 LAA SSH key management options
    system              Get LAA Info
    usbs                List USB devices
    workers             Manage workers

Options

help

Print the help text on the console, as already shown.

laam --help

version

Print the version of the tool.

$ laam --version
laam, vX.Y.Z

loglevel

Set the logging level.

$ laam --loglevel DEBUG -i idexample files push local/file.img file.img
DEBUG:laam.LAA:Creating LAA with identity idexample
DEBUG:laam.LAA:LAA uri: <URI>
DEBUG:laam.LAA:LAA base_uri: <URI>/api/v1
DEBUG:laam.LAA:Creating Files property in LAA object
DEBUG:laam.LAA.Files:push: `file` is pure data
DEBUG:laam.LAA.Files:Request: POST <URI>/api/v1/files/file.img kwargs: {'data': <MultipartEncoder: {'file': ('file.img', <_io.BufferedReader name='local/file.img'>)}>, 'headers': {'Content-Type': 'multipart/form-data; boundary=xyz'}}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): <URI>
DEBUG:urllib3.connectionpool:<URI> "POST /api/v1/files/file.img HTTP/1.1" 200 0
DEBUG:laam.LAA.Files:Request returned
DEBUG:laam.LAA.Files:Request succeeded

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’s 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,mkdir,rmdir,decompress} ...

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

Sub command:
  {list,pull,push,rm,mkdir,rmdir,decompress}
                        Sub command
    list                List files on the LAA
    pull                Pull a file from the LAA
    push                Push a file in the LAA
    rm                  Remove a file on the LAA
    mkdir               Create directory
    rmdir               Remove a directory
    decompress          Decompress a file

laacli

Execute laacli commands on the LAA.

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

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

Sub command:
  {button,history,led,power,rev,screenshot,temp,usb,usbg-ms,watt}
                        Sub command
    button              Virtual buttons
    history             Sensor history
    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

mcp

Start an MCP (Model Context Protocol) server exposing the LAA to AI agents.

$ laam mcp --help
usage: laam mcp [-h] [--transport {stdio,streamable-http}] [--host HOST] [--port PORT] --workdir WORKDIR

options:
  -h, --help            show this help message and exit
  --transport {stdio,streamable-http}
                        MCP transport (default: stdio)
  --host HOST           Host for streamable-http
  --port PORT           Port for streamable-http
  --workdir WORKDIR     Directory file_push and file_pull are limited to

The default host is 127.0.0.1 and the default port 8000. Both are only used by the streamable-http transport.

The server exposes the following tools to the MCP client:

Tool

Description

documentation_list

List the pages of the official LAA documentation

documentation_fetch

Download one documentation page, as markdown

button_control

Control a virtual button (1, 2, power, reset)

power_control

Control a power rail (1v8, 3v3, 5v, 12v)

usb_control

Control a USB port (0 is the hub, 1 to 4 the ports)

power_watt

Measure the consumption of a power rail

sensor_history

Recorded power and temperature telemetry

file_list

List files in the LAA working directory

file_push

Upload a file from the workdir to the LAA

file_pull

Download a file from the LAA into the workdir

serial_list

List the serial consoles configured on the LAA

serial_detect

Detect which serial console the DUT is talking on

serial_open

Open a serial console session

serial_write

Send text to an open session

serial_read_until

Wait for a pattern and return the output up to it

serial_close

Close an open session

system_version

LAA OS version

It also exposes an enable_device_type prompt that walks an agent through enabling a new board: reading the board documentation, picking a MIB, proposing the wiring and booting the DUT to its bootloader.

File transfers

The file_push and file_pull tools can only read and write files inside the directory given with --workdir.

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,detect,scan,show} ...

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

Sub command:
  {list,connect,detect,scan,show}
                        Sub command
    list                List serials
    connect             Connect to serial
    detect              Detect the device serial, returns when 10 ASCII printable characters are received
    scan                Listen to all serials in parallel
    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

ssh

Manage ssh keys used to ssh to the appliance.

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

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

Sub command:
  {list,show,add,delete}
                        Sub command
    list                Appliance ssh key list
    show                Appliance ssh key details
    add                 Appliance ssh key upload
    delete              Appliance ssh key delete

ssh user

To ssh to the appliance, add your ssh key using laam ssh or the web interface then run: ssh torizon@laa-<serial>.local

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

Contributing

Contributions, bug reports and feature requests are welcome. See the work items or open a merge request.

Backward Compatibility Policy

laam interfaces directly with LAA OS API endpoints. To ensure stability for automation and CI/CD pipelines, we follow these rules:

  • Version Baseline: Full backward compatibility is guaranteed starting with laam 0.9.0 and LAA OS 1.7.0.

  • Backward-Compatible API: LAA OS API endpoints are never removed. Existing endpoints can be changed in backward-compatible ways only. This means any laam version works with any LAA OS version >= 1.7.0.

  • Automation-First: laam must remain a reliable component for any third-party automation tools using an LAA.