Manage your OpenGnsys environment from your command line. A CLI for the ogServer REST API.
This tool is expected to be executed from the OpenGnsys installation environment.
Before running any command copy ogcli.json
inside /opt/opengnsys/etc/
ogcli {command} {object} [{command object options}]
usage: ogcli [-h] [{create,list,restore,send,set,setup}]
positional arguments:
{create,list,restore,send,set,setup}
Subcommand to run
options:
-h, --help show this help message and exit
Create images.
usage: ogcli create [-h] {image}
positional arguments:
{image}
options:
-h, --help show this help message and exit
You can list currently connected clients, disk, scope tree, boot modes, hardware/software profiles, images, and specific client information.
usage: ogcli list [-h] {clients,scopes,modes,hardware,client,images,disks}
positional arguments:
{clients,scopes,modes,hardware,client,images,disks}
options:
-h, --help show this help message and exit
Restore an image partition
usage: ogcli restore [-h] {image}
positional arguments:
{image}
options:
-h, --help show this help message and exit
Send WoL, poweroff or refresh to a given scope.
usage: ogcli send [-h] {wol,poweroff,refresh}
positional arguments:
{wol,poweroff,refresh}
options:
-h, --help show this help message and exit
Set properties of the managed computers.
You can modify boot mode using set
.
usage: ogcli set [-h] {modes}
positional arguments:
{modes}
positional arguments:
{modes}
optional arguments:
-h, --help show this help message and exit
Setup disks of a given scope
usage: ogcli setup [-h] {disk}
positional arguments:
{disk}
options:
-h, --help show this help message and exit
They are subject to the specified command.
clients
: Currently connected clients to the ogServerclient
: Any specific clientdisk
: Client's disksimages
: Partition imagesmodes
: Network boot modeshardware
: Hardware profilesscopes
: Scope tree of managed computers, rooms and centers.
DOS/MBR, first partition: 40G Linux/ext4, also add a 10G OpenGnsys cache partition. Format each partition.
ogcli setup disk --type dos --part 1,LINUX,EXT4,40G --part 4,CACHE,CACHE,10G --format 1,4 --client-ip 192.168.56.11
ogcli list scopes
{'scope': [{'name': 'Unidad Organizativa (Default)', 'type': 'center', 'id': 1, 'scope': [{'name': 'Aula virtual', 'type': 'room', 'id': 1, ...
ogcli list modes
{'modes': ['11', 'pxe', '00unknown', '19pxeADMIN', '13', '10', '12']}
ogcli set modes --room-id 1 --mode pxe
ogCLI is released under the GNU Affero Public License v3