Go to file
Jose M. Guisado 44745a3f22 rest: add POST client/server method
Enable modification of the associated ogserver of a given client.

This API is exposed via the POST /client/server endpoint and expects a
JSON payload with an array of clients ("client":[]) and the "id" of the
ogserver ("identorno" column value inside the "entornos" table)

For example:

>>>
POST /client/server
{
  "client": [
    "10.141.10.100",
    "10.141.10.101",
    "10.141.10.104",
    "10.141.10.102"
  ],
  "id": "6"
}
<<<
HTTP/1.1 200 OK

If the ogserver id does not exist the foreign key constraint (ON UPDATE
RESTRICT) inside the "ordenadores" table will cancel the operation and
the server will reply with 400 Bad Request.

>>>
POST /client/server
{
  "client": [
    "10.141.10.100",
    "10.141.10.101",
    "10.141.10.104",
    "10.141.10.102"
  ],
  "id": "666"
}
<<<
HTTP/1.1 400 Bad Request

The OpenGnsys database stores different ip addresses for the ogServer
inside the "entornos" table. This table is related to the "ordenadores"
table using a foreign key on the "identorno" column.

i.e: Clients in the "ordenadores" table associate to an specific server
in the database using the "identorno" column (from "entornos" table).
2023-08-23 13:17:03 +02:00
cfg #981 Use 'Wants' for mysql systemd unit dependency 2021-07-27 17:12:40 +02:00
src rest: add POST client/server method 2023-08-23 13:17:03 +02:00
tests #915 Add commands and procedures to procedure creation 2021-06-10 17:00:01 +02:00
.gitignore #985 add .gitignore file 2020-06-17 18:20:32 +02:00
COPYING #985 add COPYING file 2020-06-18 16:48:20 +02:00
Makefile.am #915 Add schedule/command 2021-06-09 13:41:28 +02:00
configure.ac #986 rename to ogserver 2020-06-19 11:19:55 +02:00