| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A user can list repos using "ogcli list repos":
$ ogcli list repos
{
"repositories": [
{
"id": 1,
"ip": "10.141.10.1",
"name": "Repositorio (Default)"
},
{
"id": 3,
"ip": "127.0.0.1",
"name": "dummy"
},
{
"id": 4,
"ip": "192.168.21.21",
"name": "helloworld"
}
]
}
The repository of a client or group of clients in a room is configured
using "ogcli set repo --id <id> [--client-ip <ip address>, --room-id
<room id>]:
$ ogcli set repo --id 4 --room-id 1
|
|
|
|
|
|
|
| |
Some subcommands need following arguments (e.g.: ogcli list ...), check
if following arguments are present. If no required following argument is
detected then print an error message, show help and exit with status
code 1.
|
|
|
|
|
|
| |
For the delete subcommand: s/remove/delete
For the add subcommand: s/remove/add
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add OgServer class inside cli/objects/server.py
This OgServer class implements add, list, set and delete commands
related to the server API (/server and /client/server) exposed by the
ogServer. These server endpoints correspond with the "entornos" table and
"identorno" foreign key in the "ordenadores" tables.
To list all rows from the "entornos" table. i.e: Listing all stored
addresses for the ogServer:
ogcli list servers
{
"servers": [
{
"address": "192.168.2.240",
"id": 1
},
{
"address": "1.1.1.1",
"id": 2
}
]
}
To store a new ip address for the ogServer, ogCLI will reply with the
new id:
ogcli add server --address "10.141.10.1"
{"id", "2"}
To set a client's associated ogServer address using the server id:
ogcli set server --id 2 --client-ip 10.141.10.100
To set the associated server of a whole room use --room-id parameter:
ogcli set server --id 2 --room-id 1
To remove any existing address (which is not currently set as the
ogServer addres for any client) using the server id:
ogcli delete server --id 2
To determine a client's associated server just list the client's
information (this requires an updated ogServer):
ogcli list client --client-ip 10.141.10.100
{
"boot": "oglive",
"center": 1,
...
"server_id": 1
}
|
|
|
|
|
|
|
| |
Add delete function to OgRest class. Enable ogCLI to send HTTP
requests using DELETE as request verb.
Encapsulates requests python module .delete() method.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Image creation example:
ogcli create image
--disk
--part 1
--name 18oct2
--desc 18oct2
--repo-id 1
--client-ip 192.168.56.11
Image update example:
ogcli update image
--disk 1
--part 1
--id 20
--client-ip 192.168.56.11
|
|
|
|
|
|
|
|
|
| |
Takes usual client options
(--client-ip, --room-id, --center-id)
Example:
> ogcli send reboot --client-ip 192.168.56.11
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use autopep8 for coding format, and only for whitespace changes. This
change drops use of tabs in favor of spaces.
Doesn't use autopep8 --aggresive option.
Format command:
$ autopep8 --inline --recursive .
When using git-blame, use --ignore-rev in order to ignore this
reformatting commit.
|
|
|
|
|
|
| |
Send refresh to a given client.
$ ogcli send refresh --client-ip 192.168.56.11
|
|
|
|
| |
Update license header in files.
|
|
|
|
|
|
|
|
| |
"ogcli set modes ..." should be "ogcli set mode ..." because clients
only have one mode assigned at a time.
To not break the backwards compatibility, this commits adds "set mode"
but maintains "set modes".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enables sending format and partition commands to the ogServer.
Syntax: ogcli setup disk {options}
Options are:
--type [{dos,gpt}] Disk partition scheme
--num [NUM] Disk number (defaults to 1)
--format [FORMAT] Indicates which partitions to reformat if they
are already present. Use --part alone to mean all
partitions.
--part PART [PART ...]
Partition definition (syntax:
"num,part_scheme,fs,size")
size is specified as a positive digit followed by a size unit
like [MGT]
512M, 50G, 1T, etc.
ogcli accepts {LINUX,WINDOWS,EFI,CACHE} as part types and {EXT4,
NTFS, FAT32, CACHE} as filesystem types inside the partition
definition string
1,LINUX,EXT4,50G => partition 1, of type linux with ext4 fs of
50 GB size
If you wanted to add a partition cache (OpenGnsys usually
mandates this partition to be number 4) you can omit partitions
up to that number and ogcli will fill with EMPTY partitions.
So if you define the following parts:
--part 1,...
--part 4,...
ogcli will fill parts 2 and 3 with EMPTY part type and fs.
Client selection argument follow previous used options
--center-id CENTER_ID
--room-id ROOM_ID
--client-ip CLIENT_IP
|
|
|
|
|
|
|
|
|
|
| |
Enables sending poweroff commands to clients.
Only arguments required are the usual client selection like:
--client-ip
--room-id
--center-id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enables creation of images using /image/create from ogServer API.
Summary of the options:
--disk
Disk number
--part
Partition number
--name
Image name which will be used for the .img file.
--desc
Description of the image. This option enables ogServer to store
an entry in the database regarding this image.
--repo
Optional. Holds the ip address of the repo which will store the
created image. Defaults to ogserver address specified inside
ogcli.json
--client-ip
Client ip for which we want to create a partition image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
}
]
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds cli capability to send image restore commands to the ogServer.
It has the following options:
--id
To specify image id
--disk
Target disk
--part
Target partition
--type
To specify type of restore to send. UNICAST-DIRECT or
UNICAST-CACHE are supported as of this patch.
--repo
Optional argument to specify image repo to fetch the image. This
applies for UNICAST-DIRECT cases. (not restoring from a cache
partition). If not specified it will default to rest.URL ip
(ie. ogServer ip)
--client-ip, --room-id and --center-id
Target client args
|
|
|
|
|
| |
ogServer exposes a list of known partition images at /images, use it to
implement 'list images' command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
program name of subsequent parsers after the first one need their
"prog=" parameter specified so they do not show sys.argv[0] only.
With this patch, for example:
ogcli list --help
Shows:
usage: ogcli list [-h] {clients,scopes,modes,hardware,client}
...
Instead of:
usage: ogcli [-h] {clients,scopes,modes,hardware,client}
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Builds a json payload to consume the ogServer API to send
WoL packets.
Adds 'send' as a command:
ogcli send
Adds a wol object for to the 'send' command, so that sending a wol can
be specified as:
ogcli send wol
* WoL packet type is specified with --type option.
* Specifying targets follows same parameters as 'set modes' with:
--client-ip
--room-id
--center-id
|
|
|
|
|
|
|
|
| |
This requests GET /client/properties by calling something like:
ogcli list client --id=6
It is important to notice that 'id' must be a "computer" type
scope id.
|
|
|
|
|
|
|
| |
This requests GET /hardware by calling something like:
ogcli list hardware --scope-id=6
It is important to notice that 'scope-id' must be a "computer" type scope id.
|
|
|
|
|
|
|
| |
Instead of using query strings we use a json body for GET HTTP requests. This is
allowed under RFCs 7230-7237.
https://stackoverflow.com/questions/978061/http-get-with-request-body
|
|
|
|
|
| |
This requests POST /modes and changes a scope mode by calling something like:
ogcli set modes --scope-id=1 --scope-type=computer --mode=pxe
|
|
|
|
| |
This is a wrapper that provides HTTP POST requests.
|
| |
|
|
This prefix is redundant on almost every file, so the prefix is removed from
filenames and imports.
|