# 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. ```{admonition} LAA manager v0.8.3 :class: warning The documentation refers to `laam v0.8.3`. [Version notes at the bottom](#version-notes) ``` ## Installation laam is available from [PyPI](https://pypi.org/project/laam): ```console 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: ```console laam identities add --uri --token # Example: laam identities add --uri 192.168.1.234 --token abcdefghijklmnopqrstuvwxyz0123456789 laa101 ``` Where: * ``: URL of the LAA, you can use the ip address indicated on the OLED screen * ``: api token created on the LAA as indicated in [here](/software/api.md#authentication) * ``: 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: ```yaml 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: ```console $ laam -i identity-1 ``` ```{admonition} Identity selection :class: tip You can have multiple identities, each with a unique name. When running `laam` you can select the identity to use with `laam -i ...`. ``` ```{admonition} Default Identity :class: tip 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. ``` ```{admonition} Local Commands :class: note "Local" commands won't need an identity. Examples are: `help`, `version`, `dut new`, `dut check`. ``` ## Usage These are all the commands available on `laam`: ```console $ 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`. ```console $ 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. ```console $ 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. ``` ```{admonition} Local Commands :class: note The following commands don't need identity: `dut new`, `dut check`. ``` ### files Manage files in `/var/lib/lava/dispatcher/tmp` on the LAA. ```console $ 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](/software/laacli.md) commands on the LAA. ```console $ 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 ```console $ 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](/guides/device_type_enablement.md#ser2net-configuration) provided by the LAA. ```console $ 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. ```console $ 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. ```console $ 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. ```console $ 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. ```console $ 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](https://gitlab.com/LinaroLtd/lava/appliance/laam/-/issues) ## Version notes ```{admonition} LED sub-command :class: note The LED sub-command is working from LAA OS > v1.6.1. ``` ```{admonition} LAA OS v1.4 :class: warning The REST API used by `laam` is only available in LAA OS v1.4 and after. ``` ```{admonition} LAA manager =< v0.8.1 :class: warning `laam` =< v0.8.1 serials connect command cannot connect with LAA OS =< v1.5.5. This has been fixed in `laam` v0.8.2 ``` ```{admonition} LAA manager v0.8.2 :class: warning The "laam network settings" command fails. This has been fixed in `laam` v0.8.3 ```