From 95e6520c4f3ab53ab1491eafe38c932c66b7a4b8 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Sat, 18 May 2019 14:24:58 +0200 Subject: #915 add initial REST API for ogAdmServer Add REST API for ogAdmServer, this API is exposed through port 8888 on the system that runs the ogAdmServer. The body of the HTTP message is expressed in JSON format. This patch implements the command "clients" that maps to the existing legacy "Sondeo" command, that is used by the web interface to poll refresh the client state. This patch also includes an initial test infrastructure using 'curl' to send commands to the new REST API. Request: POST /clients {"clients" : [ "192.168.2.1", "192.168.2.2" ]} Reply: 200 OK This allows to refresh the status of the list of clients. --- tests/post_clients.json | 1 + tests/run-tests.sh | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/post_clients.json create mode 100755 tests/run-tests.sh (limited to 'tests') diff --git a/tests/post_clients.json b/tests/post_clients.json new file mode 100644 index 0000000..4667303 --- /dev/null +++ b/tests/post_clients.json @@ -0,0 +1 @@ +{ "clients" : [ "192.168.2.1", "192.168.2.2" ] } diff --git a/tests/run-tests.sh b/tests/run-tests.sh new file mode 100755 index 0000000..e187abb --- /dev/null +++ b/tests/run-tests.sh @@ -0,0 +1 @@ +curl -X POST http://127.0.0.1:8888/clients -d @post_clients.json -- cgit v1.2.3-18-g5258