From 83b242ce587fa910861bb2e6b4cdf2cffd38df65 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Wed, 22 Jan 2020 13:32:12 +0100 Subject: #942 Add support for scheduled tasks and commands This field needs to be at least 31 bits long to store all days in a month. Other fields are also set to 32 bits because unsigned int length can change depending on the system. We also need to support the three ways that the ogAdmAgent and the WebConsole have to create an schedule. At first, we only supported the easiest method: * Hour, day, month and year -> 10:00, 28, february, 2020 This commit adds these two ways to create an schedule: * Hour, week day, month and year -> 10:00, Monday, february, 2020 * Hour, week, month and year -> 10:00, first week, february, 2020 --- tests/create_schedule.json | 1 + tests/run-tests.sh | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/create_schedule.json (limited to 'tests') diff --git a/tests/create_schedule.json b/tests/create_schedule.json new file mode 100644 index 0000000..cfdfb7f --- /dev/null +++ b/tests/create_schedule.json @@ -0,0 +1 @@ +{"task":"1","name":"test",","time_params":{"years":1024,"months":1,"days":536870912,"hours":2048,"am_pm":0,"minutes":0}} diff --git a/tests/run-tests.sh b/tests/run-tests.sh index b68dc7f..88d8c78 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -21,3 +21,4 @@ curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/image/restore/ba curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/image/restore/incremental -d @restore_incremental_image.json curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/run/schedule -d @run_schedule.json curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/task/run -d @task.json +curl -X POST -H "Authorization: $API_KEY" http://127.0.0.1:8888/schedule/create -d @create_schedule.json -- cgit v1.2.3-18-g5258