# LAA manager (aka. laam) The LAA Manager is a python application that allows to interact with the LAA REST API. ```{admonition} LAA v1.4 :class: warning The REST API used by `laam` is only available in LAA v1.4 and after. ``` ## Installation laam is available from [PyPI](https://pypi.org/project/laam): ```shell python3 -m venv venv source venv/bin/activate python3 -m pip install laam laam --help ``` ## Configuration In order to use laam with your LAA, you must create an identity with: ```shell laam identities add --uri http://laa.local --token abcdefghijklmnopqrstuvwxyz0123456789 default ``` Where: * `--uri`: URL of the LAA * `--token`: api token previously created * `default`: name of the identity ```{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 ...`. By default, `laam` will use the identity called `default`. ``` ## Usage ```shell Linaro Automation Appliance Manager options: -h, --help show this help message and exit --version show program 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 ``` ```{admonition} identities :class: tip Every commands, except `identities` requires the user to provide an identity. If none are provided, `laam` will automatically use the `default` one and fails if it does not exists. ``` ## Commands ### identities Manage `laam` identities stored in `~/.config/laam.yaml`. ```shell $ laam identities --help usage: laam identities [-h] {add,delete,list,show} ... options: -h, --help show this help message and exit Sub command: {add,delete,list,show} Sub command add add an identity delete delete an alias list list available identities show show identity details ``` 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 identity-1: token: abcdef uri: http://laa-00001.local identity-2: token: 123456 uri: http://laa-00002.local ``` The different identities are then usable with: ```shell $ laam -i identity-1 ``` ### dut ```shell $ laam dut --help usage: laam dut [-h] {check,new,render,test} ... options: -h, --help show this help message and exit Sub command: {check,new,render,test} 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 ``` ### files Manage files in `/var/lib/lava/dispatcher/tmp` on the LAA. ```shell $ 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. ```shell $ 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 ```shell $ 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. ```shell $ 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 Manage systemd services running on the LAA. ```shell $ laam services --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 [:~] % 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. ```shell $ 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. ```shell $ 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. ```shell $ 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 ```