From 1a8ada191f779aec01e00ff429f437992bf8919c Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Tue, 24 Sep 2019 11:51:38 +0200 Subject: #915: Add POST /image/create command to REST API in ogAdmServer This patch implements the command "image/create" that creates an image in a client. Request: POST /image/create { "clients" : [ "192.168.2.1" ], "disk" : "1", "partition" : "1", "code" : "1", "id" : "1", "name" : "test", "repository" : "192.168.2.2" } Reply: 200 OK --- tests/create_image.json | 1 + tests/run-tests.sh | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/create_image.json (limited to 'tests') diff --git a/tests/create_image.json b/tests/create_image.json new file mode 100644 index 0000000..bd4ab21 --- /dev/null +++ b/tests/create_image.json @@ -0,0 +1 @@ +{ "clients" : [ "192.168.2.1" ], "disk" : "1", "partition" : "1", "code" : "1", "id" : "1", "name" : "test", "repository" : "192.168.2.4" } diff --git a/tests/run-tests.sh b/tests/run-tests.sh index f22df02..f454bcd 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -12,3 +12,4 @@ curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/stop -d @stop.js curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/refresh -d @refresh.json curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/hardware -d @post_clients.json curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/software -d @post_clients.json +curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/image/create -d @create_image.json -- cgit v1.2.3-18-g5258