Commit Graph

2 Commits (37c4065f06f7cdaa35a49c7a6168f50394b37565)

Author SHA1 Message Date
Jose M. Guisado 37c4065f06 cli: objects: use --desc and --folder
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.
2023-10-19 13:36:00 +02:00
Javier Hernandez 1c2e5c4c96 cli: add room
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
2023-10-19 12:26:31 +02:00