diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2023-08-21 17:54:57 +0200 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2023-08-23 11:39:10 +0200 |
commit | 351069b5916da8770d48d22c7f80d1a52ff770ad (patch) | |
tree | 219fb4a6f4a0e5d20057bbee52d0a8b05b592399 /tests/units/test_0006_post_session.py | |
parent | 74b6e3ec7275164e2ecbf6f98b24357b2a9bb174 (diff) |
rest: add /server GET and POST methods
DB stores different ogserver addresses in the "entornos" table.
Expose addition and deletion operations for the "entornos" table using
the /server endpoint.
GET /server returns a list of rows from the "entornos" table including
the "identorno" and "ipserveradm" columns. For example:
>>>
GET /server
<<<
200 OK
...
{
"servers": [
{
"id": 1,
"address": "10.141.10.1"
}
]
}
POST /server inserts into the "entornos" table and returns the
id ("identorno") of the new row.
>>>
POST /server
{
"address": "192.168.2.240"
}
<<<
200 OK
...
{
"id": 2
}
If the server address already exists the response is 400 Bad Request
with no payload.
>>>
POST /server
{
"address": "192.168.2.240"
}
<<<
400 Bad Request
Diffstat (limited to 'tests/units/test_0006_post_session.py')
0 files changed, 0 insertions, 0 deletions