| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Use og_server_cfg everywhere. Convert port to string to make it easy for the
dbi API since it expects a string. Remove legacy example configuration file.
|
|
|
|
| |
to avoid clash with existing variable cfg in client.c
|
|
|
|
|
|
| |
This patch is a refactor for og_computer and og_dbi_get_computer_info.
It now uses fixed lenght strings to make it more reliable and avoid
errors if the DB is not returning a null ended string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds GET /images to the ogServer REST API.
This call returns information of all the images in ogServer.
Example response:
{
"images": [
{
"filename": "ubuntu.img",
"datasize": 2150400000,
"size": 613476223,
"modified": "Wed Sep 23 10:37:36 2020",
"permissions": "744"
},
{
"filename": "test.img",
"datasize": 2150400000,
"size": 613236475,
"modified": "Tue Sep 29 08:57:47 2020",
"permissions": "744"
}
],
"disk": {
"total": 52573995008,
"free": 39624544256
}
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method adds a new client. This new client's IP cannot be duplicated
in the DB.
Request:
POST /client/add
{
"boot": "19pxeADMIN",
"center": 0,
"hardware_id": 0,
"id": 2,
"ip": "192.168.56.12",
"livedir": "ogLive",
"mac": "0800270E6512",
"maintenance": true,
"name": "pc12",
"netdriver": "generic",
"netiface": "eth1",
"netmask": "255.255.255.0",
"remote": false,
"repo_id": 1,
"room": 1,
"serial_number": ""
}
Response:
200 OK
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method provides information about a specific client. The request
must contain exactly 1 client's IP.
Request:
GET /client/info
{"client": ["192.168.56.12"]}
Response:
200 OK
{
"boot": "19pxeADMIN",
"center": 0,
"hardware_id": 0,
"id": 2,
"ip": "192.168.56.12",
"livedir": "ogLive",
"mac": "0800280E6871",
"maintenance": true,
"name": "pc12",
"netdriver": "generic",
"netiface": "eth1",
"netmask": "255.255.255.0",
"remote": false,
"repo_id": 1,
"room": 1,
"serial_number": ""
}
|
|
|
|
| |
The return array needs to store 1 extra element for the disk setup.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method provides the partitions setup for a specific client. The
request must contain exactly 1 client's IP.
Request:
GET /client/setup
{'client': ['192.168.56.12']}
Response:
200 OK
{
"partitions": [
{
"disk": 1,
"partition": 0,
"code": 0,
"size": 20971520,
"used_size": 0,
"filesystem": 0,
"os": 0,
"image": 0,
"software": 0
}
]
}
|
|
|
|
| |
og_client_status() should not report busy when probing is going on.
|
|
|
|
|
| |
The 'ip' field is added to the json for scopes that have an IP (i.e.
computers).
|
|
|
|
|
|
| |
This patch selects clients whose modes need to be changed in the current
request. This patch makes POST /mode consistent with the rest of the
REST API where clients are selected and filtered by ip.
|
|
|
|
| |
This API is not supported by ogClient yet and it uses the obsolete socket hydra API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CC src/rest.o
src/rest.c: In function ‘og_cmd_post_modes.isra.27’:
src/rest.c:966:4: warning: ‘%s’ directive output may be truncated writing up to 4096 bytes into a region of size between 3018 and 4041 -Wformat-truncation=]
"MODE_FILE='%s'\nMAC='%s'\nDATA='%s'\n"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/rest.c:1085:7:
template_name, scope_name);
~~~~~~~~~~~~~
src/rest.c:967:33: note: format string is defined here
"MODE='PERM'\nTEMPLATE_NAME='%s'",
^~
src/rest.c:965:2: note: ‘snprintf’ output 57 or more bytes (assuming 5176) into a destination of size 4096
snprintf(cmd_params, sizeof(cmd_params),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"MODE_FILE='%s'\nMAC='%s'\nDATA='%s'\n"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"MODE='PERM'\nTEMPLATE_NAME='%s'",
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mode, mac, params, template_name);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
| |
Add syslog and use exit()
|
|
|
|
| |
ogserver process owner (author Roberto Hueso Gómez).
|
|
|
|
|
| |
This patch changes the URI since it is semantically more correct to use
the singular.
|
|
|
|
|
|
|
|
|
|
|
| |
Now POST /modes does not only write to the database, it also uses the
external bash script 'setclientmode' to generate configured PXE
templates for each machine.
NOTE: This fix requires that room and computer names are unique in the
OpenGnsys DB. This behaviour is inherited from the previous
'setclientmode' script but, eventually, it should be replaced for an
actual scope selector.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements HTTP GET /hardware request which returns a list of
the hardware associated with a particular computer.
Request: GET /hardware
{
"scope": {
"id": 6,
"type": "computer"
}
}
Response: 200 OK
{
"hardware": [
{
"type": "Microprocesadores",
"description": "CPU arch:x86 target:x86_64 cores:4"
},
{
"type": "Memorias",
"description": "QEMU 4096MiB"
},
{
"type": "Tarjetas gráficas",
"description": "Red Hat, Inc Virtio GPU"
},
{
"type": "Tarjetas de Red",
"description": "Intel Corporation 82540EM Gigabit Ethernet Controller
QEMU Virtual Machine"
},
{
"type": "Controladores IDE",
"description": "Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
Qemu virtual machine"
}
]
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements HTTP POST /modes request which can change the mode of any
particular scope.
Request: POST /modes
{
"scope": {"id": 1,
"type": "computer"},
"mode": "pxe"
}
Response: 200 OK
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some universities have computers in a different subnet where the
ogServer is, but ogServer WoL functionality only supported to send
packet to its own subnets. This commit solves this.
Now ogServer sends two WoL packets per client, one with the broadcast
address of the interface indicated in the config file, the other with
the broadcast address calculated with the address and netmask of the
client.
To ensure that the second WoL works correctly you must configure
correctly the IP and netmask of the clients. Also, you have to configure
the network of your organization to route WoL packet to the correct
subnet.
|
|
|
|
|
|
| |
This improves style and fixes some memleaks.
Co-authored-by: OpenGnSys Support Team <soporte-og@soleta.eu>
|
|
|
|
| |
Missing closedir() call.
|
|
|
|
|
| |
If either root or children_root fail to be created but the other one does not,
then reserved memory for the successful one would not be freed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements HTTP GET /modes request which returns all modes available
for clients:
Request: GET /modes HTTP/1.0
Response: 200 OK
{
"modes": [
"pxe",
"10",
"13",
"00unknown",
"11",
"19pxeADMIN",
"12"
]
}
|
|
Use the same folder as in ogClient.
|