Joustie's blog

Apr 17, 2024 - 2 minute read

Introducing the Leostream Admin CLI as well!

I have also been working on a command-line interface (CLI) tool that can be used to manage Leostream resources. It makes use of the Leostream Golang client library that I have created.

It was created to help with issues like:

  • looping through pools to update the pool settings
  • seeing the status of the pools
  • checking which desktops are in a pool
  • taking a backup of Leostream
  • restore a backup of Leostream
  • checking the status of an individual desktop

You can find the code on my company GitLab instance.

Quick start:

% go install gitlab.hocmodo.nl/community/leostream-admin-cli@latest
% export GOPATH=$HOME/go
% export PATH=$PATH:$GOPATH/bin
% leostream-admin-cli --help

More info on the usage of the CLI can be found in the README.

For instance, you can get a list of pools:

% leostream-admin-cli pool list
    +---------+----------------------+----------------+
    | POOL ID | POOL NAME            | POOL PARENT ID |
    +---------+----------------------+----------------+
    |       1 | All Desktops         |              0 |
    |       4 | All Linux Desktops   |              1 |
    |       3 | All Windows Desktops |              1 |
    |       5 | AWS desktop pool     |              1 |
    +---------+----------------------+----------------+

You can specify the output to be in json format:

% leostream-admin-cli pool list --json
[
	{
		"id": 1,
		"name": "All Desktops",
		"available_vm": 1,
		"total_vm": 1,
		"total_vm_stopped": 1
	},
	{
		"id": 4,
		"name": "All Linux Desktops",
		"parent_pool_id": 1
	},
	{
		"id": 3,
		"name": "All Windows Desktops",
		"parent_pool_id": 1
	},
	{
		"id": 5,
		"name": "AWS desktop pool",
		"available_vm": 1,
		"total_vm": 1,
		"parent_pool_id": 1,
		"total_vm_stopped": 1
	}
]