source: ogCli-Git/README.md

Last change on this file was 41170ec, checked in by Jose M. Guisado <jguisado@…>, 2 years ago

README: add setup example and update commands

  • Property mode set to 100644
File size: 3.1 KB
Line 
1
2# ogCLI
3
4Manage your OpenGnsys environment from your command line. A CLI for the ogServer
5REST API.
6
7## Installation
8
9This tool is expected to be executed from the OpenGnsys installation environment.
10
11**Before running any command copy `ogcli.json` inside `/opt/opengnsys/etc/`**
12
13## Usage
14
15`ogcli {command} {object} [{command object options}]`
16
17### Commands
18
19```
20usage: ogcli [-h] [{create,list,restore,send,set,setup}]
21
22positional arguments:
23  {create,list,restore,send,set,setup}
24                        Subcommand to run
25
26options:
27  -h, --help            show this help message and exit
28```
29
30#### `create`
31
32Create images.
33
34```
35usage: ogcli create [-h] {image}
36
37positional arguments:
38  {image}
39
40options:
41  -h, --help  show this help message and exit
42```
43
44#### `list`
45
46You can list currently connected clients, disk, scope tree,
47boot modes, hardware/software profiles, images, and specific client information.
48
49```
50usage: ogcli list [-h] {clients,scopes,modes,hardware,client,images,disks}
51
52positional arguments:
53  {clients,scopes,modes,hardware,client,images,disks}
54
55options:
56  -h, --help            show this help message and exit
57```
58
59#### `restore`
60
61Restore an image partition
62
63```
64usage: ogcli restore [-h] {image}
65
66positional arguments:
67  {image}
68
69options:
70  -h, --help  show this help message and exit
71```
72
73#### `send`
74
75Send WoL, poweroff or refresh to a given scope.
76
77```
78usage: ogcli send [-h] {wol,poweroff,refresh}
79
80positional arguments:
81  {wol,poweroff,refresh}
82
83options:
84  -h, --help            show this help message and exit
85```
86
87#### `set`
88
89Set properties of the managed computers.
90
91You can modify boot mode using `set`.
92
93```
94usage: ogcli set [-h] {modes}
95
96positional arguments:
97  {modes}
98
99positional arguments:
100  {modes}
101
102optional arguments:
103  -h, --help  show this help message and exit
104```
105
106#### `setup`
107
108Setup disks of a given scope
109
110```
111usage: ogcli setup [-h] {disk}
112
113positional arguments:
114  {disk}
115
116options:
117  -h, --help  show this help message and exit
118```
119
120### Objects
121
122They are subject to the specified command.
123
124* `clients`: Currently connected clients to the ogServer
125* `client`: Any specific client
126* `disk`: Client's disks
127* `images`: Partition images
128* `modes`: Network boot modes
129* `hardware`: Hardware profiles
130* `scopes`: Scope tree of managed computers, rooms and centers.
131
132### Examples
133
134#### Client setup
135
136##### DOS/MBR, first partition: 40G Linux/ext4, also add a 10G OpenGnsys cache partition. Format each partition.
137```
138ogcli setup disk --type dos --part 1,LINUX,EXT4,40G --part 4,CACHE,CACHE,10G --format 1,4 --client-ip 192.168.56.11
139```
140
141#### Changing the boot mode of computers in a particular classroom
142
143##### Fetching a classroom id
144
145```
146ogcli list scopes
147
148{'scope': [{'name': 'Unidad Organizativa (Default)', 'type': 'center', 'id': 1, 'scope': [{'name': 'Aula virtual', 'type': 'room', 'id': 1, ...
149```
150
151##### Fetching net boot modes
152
153```
154ogcli list modes
155
156{'modes': ['11', 'pxe', '00unknown', '19pxeADMIN', '13', '10', '12']}
157```
158
159##### Changing boot mode of the classroom
160
161```
162ogcli set modes --room-id 1 --mode pxe
163```
164
165## License
166
167ogCLI is released under the GNU Affero Public License v3
168
169## Authors
170
171[Soleta Networks](https://opengnsys.soleta.eu)
Note: See TracBrowser for help on using the repository browser.