mirror of https://git.48k.eu/ogcli/
Enables consuming /client/setup API from ogServer in order to fetch partition and disk setup information from a given client. Example, if pc11 is a client with 1 disk, 4 part (1:linux,2-3:empty,4:cache): ogcli list disk --client-ip 192.168.56.11 { "partitions": [ { "disk": 1, "partition": 0, "code": 1, "size": 52428800, "used_size": 0, "filesystem": 0, "os": 0, "image": 0, "software": 0 }, { "disk": 1, "partition": 1, "code": 131, "size": 40000000, "used_size": 4, "filesystem": 6, "os": 8, "image": 0, "software": 0 }, { "disk": 1, "partition": 2, "code": 0, "size": 0, "used_size": 0, "filesystem": 1, "os": 0, "image": 0, "software": 0 }, { "disk": 1, "partition": 3, "code": 0, "size": 0, "used_size": 0, "filesystem": 1, "os": 0, "image": 0, "software": 0 }, { "disk": 1, "partition": 4, "code": 202, "size": 10000000, "used_size": 1, "filesystem": 2, "os": 0, "image": 0, "software": 0 } ] } |
||
---|---|---|
cfg | ||
cli | ||
.gitignore | ||
COPYING | ||
README.md | ||
ogcli |
README.md
ogCLI
Manage your OpenGnsys environment from your command line. A CLI for the ogServer REST API.
Installation
This tool is expected to be executed from the OpenGnsys installation environment.
Before running any command copy ogcli.json
inside /opt/opengnsys/etc/
Usage
ogcli {command} {object} [{command object options}]
Commands
list
You can list currently connected clients, managed scopes, boot modes, hardware profiles and specific client information.
usage: ogcli list [-h] {clients,scopes,modes,hardware,client}
positional arguments:
{clients,scopes,modes,hardware,client}
optional arguments:
-h, --help show this help message and exit
set
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
Objects
They are subject to the specified command.
clients
: Currently connected clients to the ogServerclient
: Any specific clientmodes
: Network boot modeshardware
: Hardware profilesscopes
: Managed computers, rooms and centers.
Examples
Changing the boot mode of computers in a particular classroom
Fetching a classroom id
ogcli list scopes
{'scope': [{'name': 'Unidad Organizativa (Default)', 'type': 'center', 'id': 1, 'scope': [{'name': 'Aula virtual', 'type': 'room', 'id': 1, ...
Fetching net boot modes
ogcli list modes
{'modes': ['11', 'pxe', '00unknown', '19pxeADMIN', '13', '10', '12']}
Changing boot mode of the classroom
ogcli set modes --room-id 1 --mode pxe
License
ogCLI is released under the GNU Affero Public License v3