| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add command to install the files of a live system. Example:
ogcli install live --name ogrelive-6.1.0-26
Perform an update if live files are already present.
Add command to delete the files of a live system. Example:
ogcli delete live --name ogrelive-6.1.0-26
Update ogcli list live to show the lives in the server when
invoked with the --remote flag. Example:
ogcli live live --remote
|
|
|
|
|
| |
Move the configuration into its own file so it is easier to access
from multiple files.
|
|
|
|
|
|
|
|
|
|
| |
propagate a returncode in each operation and make it the
returncode of the program.
Prevent sys.exit calls in post(), get() and delete() request
handlers to enable cleanup code and error handling. Keep a basic
error log inside the request functions if the connection can't
be established or if the response contains an error code.
|
|
|
|
|
|
|
| |
Implement the --name flag in scope list to filter by client name.
Example usage:
ogcli list scope --name test
|
|
|
|
|
| |
Use the word "scope" to keep the format coherent with the other
commands.
|
|
|
|
| |
Make flag format uniform for all the commands.
|
|
|
|
| |
Add IP validation after input parsing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Overload the add repo and delete repo commands to have
different functionality based on the flags.
Add a repo:
ogcli add repo --name test2 --address 192.168.9.140
Add addresses to repo with id 27:
ogcli add repo --address 192.168.9.141 192.168.9.142 --id 27
Delete address from repo with id 27:
ogcli delete repo --address 192.168.9.141 --id 27
Delete repo:
ogcli delete repo --id 27
|
|
|
|
| |
Use the correct command prefix in the command function.
|
| |
|
|
|
|
| |
legacy option, never used, remove it
|
|
|
|
|
| |
get repository id through GET /client/info, check that all the clients belong
to the same repository.
|
|
|
|
|
|
| |
server IP is now inferred from what it is reachable, remove this command.
this revisits a721957cc469 ('cli: add server commands')
|
|
|
|
|
|
|
|
| |
Add repo update.
Example command:
update repo --id 20 --address 192.168.1.189 192.168.1.191 --name test --center 1
Use addr instead of ip to pass a list of addresses.
|
|
|
|
| |
Remove accents in the --name argument of the create image command.
|
|
|
|
|
| |
disable ascii_ensure in json dumps so listing of non-ascii characters is human
readable.
|
|
|
|
| |
ogclient supports NTFS partition code.
|
|
|
|
|
|
|
|
|
|
| |
Place dictionaries and lists at the end of the payload to improve
readability when it has a lot of nested components.
Remove and add again every element of type list or dict within a
dict or list in the payload.
Python dictionaries preserve insertion order from 3.7 onwardsi so
it is safe to reorder them by removing and readding an element.
|
|
|
|
|
| |
Obtain the image's repository from the API REST.
Don't send 127.0.0.1 as image server when --repo is not defined.
|
|
|
|
| |
ogserver expects a string as an id, otherwise it fails to parse it.
|
|
|
|
|
|
| |
Older versions of Python can't handle interleaved quote types.
Use single quotes as external string delimiter and double quotes
in every part of the strings when quotation is needed.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Checks:
--type is gpt or dos.
--num must have numeric argument.
--part defines 4 coma-separated values.
--part number must be an integer.
--part number is not repeated between partitions.
--part partition type is a known type.
--part filesystem type is a known type.
--part size has a valid format.
|
|
|
|
|
| |
Use base 2 size units for the partition configuration units.
Using base 10 units causes incoherency with the web.
|
|
|
|
|
|
|
|
|
|
| |
Implement a --client-ip filter to ease the task of finding the
hierarchy associated to a client or list of clients.
Usage:
/ogcli list scopes --client-ip 10.141.10.23
/ogcli list scopes --client-ip 10.141.10.23 --client-ip 10.141.10.22
|
|
|
|
|
|
| |
The POST handling logic didn't check for empty responses before
printing its contents resulting in a line of whitespace being
written in the output of the program.
|
|
|
|
|
| |
All the commands that need target clients now have a more descriptive
error message when the clients of the command are missing.
|
|
|
|
|
| |
The argument was called 'send_obj' probably due to copypaste.
The rename aims to provide a better name for the command.
|
|
|
|
|
|
| |
By using the word 'request' the command becomes more semantic and
represents the 'best effort' nature of the communication with
ogserver.
|
|
|
|
|
|
| |
example to boot OS from 10.141.10.22 disk 1 partition 2
send session --client-ip 10.141.10.22 --disk 1 --part 2
|
|
|
|
|
| |
Remove the line 'parsed_args = parser.parse_args(args)' parsing the
command line arguments a second time when it is not needed.
|
|
|
|
|
| |
Expand of the update command to be able to modify the values of
previous folder, room and center configurations.
|
|
|
|
| |
the __pycache__ folder will now be ignored by git in every folder.
|
|
|
|
| |
missing validation of --id, user needs to supply an integer
|
|
|
|
|
|
|
|
|
|
|
|
| |
add command to add folders
add folder --name test --room-id 123
to delete
delete folder --id 456
you can fetch the id with 'list scopes'
|
|
|
|
| |
instead of group, which is not used by the ogserver anymore.
|
|
|
|
| |
SIG_DFL needs to be used to disable SIGPIPE in python, SIG_IGN does not work.
|
|
|
|
| |
use opengnsys@soleta.eu email instead of info@soleta.eu
|
|
|
|
|
|
| |
Add new command to display the available live images:
# ogcli list live
|
|
|
|
| |
list servers already provides the same.
|
|
|
|
|
|
|
|
|
|
|
| |
Remove option to specify a repository when creating an image.
Remove option to specify a repository when updating an image.
These features is are not yet supported in ogserver.
With this commit, the image that is created/updated is assigned to the
same repo the client is assigned
|
|
|
|
| |
use POST image/update when updating an image.
|
|
|
|
|
|
|
|
| |
# ogcli delete repo -h
[...]
--id [ID] room id in scopes
this is not the room id, it should be the repo id.
|
|
|
|
|
|
| |
Allow to delete a repository with:
$ ogcli delete repo --id 10
|
|
|
|
| |
This set from the room --netmask, this is obsolete, remove it.
|
|
|
|
| |
if user presses ctrl-c, interrupt ongoing operation to avoid python backtrace.
|
|
|
|
|
|
| |
Delete a client with command:
$ ogcli delete client --ip 1.2.3.4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
# ogcli list scope | less
... leave it open for one minute, then press 'q' to exit less
it shows:
Traceback (most recent call last):
File "/usr/bin/ogcli", line 60, in <module>
CLI()
File "/usr/bin/ogcli", line 56, in __init__
getattr(self.ogcli, args.command)(sys.argv[2:])
File "/opt/opengnsys/bin/cli/cli.py", line 93, in list
OgScope.list_scopes(self.rest)
File "/opt/opengnsys/bin/cli/objects/scopes.py", line 18, in list_scopes
print_json(r.text)
File "/opt/opengnsys/bin/cli/utils.py", line 34, in print_json
print(json.dumps(payload, sort_keys=True, indent=2))
BrokenPipeError: [Errno 32] Broken pipe
It seems that the request library in python leaves the socket open
while it still displays the listing.
Ignore SIGPIPE which reports that socket is not there anymore, it is
a common practise to ignore this signal in socket.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new client with command:
$ ogcli add client --repo-id <repo id>
--netmask <netmask>
--room-id <room id>
--hostname <hostname>
--mac <mac address>
--ip <ip address>
--boot-mode <boot mode>
For example: To add a new client with hostname "javipc", netmask
255.255.255.0, mac address a2:54:00:2e:05:7a, ip address 192.168.56.101,
assign it to repo id 1, room id 1 and set its boot mode to oglive
use:
$ ogcli add client --hostname javipc --netmask 255.255.255.0 --mac
a2:54:00:2e:05:7a --ip 192.168.56.101 --repo-id 1 --room-id 1
--boot-mode oglive
Notes:
- ogserver API REST json payload does not allow to specify a server
(table 'entorno') for the client. It will automatically assign
client to server with id 1
- ogserver API REST json payload specifies mac address without ':'.
- payload must contain 'netiface', ogcli specifies 'eth0' is specified
which is the default value in netiface column in db (table 'ordenadores')
- netdriver column uses "generic" as default, this field is not used
anymore, but it is set to "generic" by now.
- ogserver should validate that boot mode set is correct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Try to reduce the usage of different parameter names due to the
OpenGnsys database using different column names for similar purposes.
Any database field regarding a description of some sort will use the
parameter --desc, even if the DB uses another column name (for example,
comment column in center table).
Use --folder parameter when requiring a folder id. The database uses
"grupo" as table name but present this to the user as folder, so use
--folder instead of --group.
Also, add 'location' field in the payload of "add room" command, it was
missing the addition of 'location' field in the JSON payload.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
add functionality to add and remove a room
to add a new room use the command: ogcli add room --name <name>
--netmask <netmask> --center <center> --gateway <gateway> [--location
<location>] [--ntp <ntp>] [--dns <dns>] [--group <group>]
for instance, to create a room with name 'dummyroom', netmask
'255.255.255.0' and gateway 10.141.10.1 that is inside the center with
id 1, use:
$ ogcli add room --name dummyroom --netmask 255.255.255.0 --gateway
10.141.10.1 --center 1
Optionally, it is possible to provide additional information such as
location (--location <location>), ntp server (--ntp <ntp>), dns server
(--dns <dns>), and a group to contain the room (--group <group>).
to delete a room use: ogcli delete room --id <id>
for instance, to delete room with id 4 use:
$ ogcli delete room --id 4
|