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