summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/includes/restfunctions.php
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2020-03-28 14:38:06 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-06-02 12:32:36 +0200
commit5a9ed93cd193065c4476c2af566d21f146f9397d (patch)
tree694a025f19e44f27aa606693573b65243a95f213 /admin/WebConsole/includes/restfunctions.php
parentbb385571e14182588fe1c5361e986ca533cc6d0e (diff)
#942 Add /run/task to API REST (web)
Diffstat (limited to 'admin/WebConsole/includes/restfunctions.php')
-rw-r--r--admin/WebConsole/includes/restfunctions.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php
index 653fcbf3..4813c010 100644
--- a/admin/WebConsole/includes/restfunctions.php
+++ b/admin/WebConsole/includes/restfunctions.php
@@ -26,6 +26,7 @@ define('OG_REST_CMD_CREATE_INCREMENTAL_IMAGE', 'image/create/incremental');
define('OG_REST_CMD_RESTORE_BASIC_IMAGE', 'image/restore/basic');
define('OG_REST_CMD_RESTORE_INCREMENTAL_IMAGE', 'image/restore/incremental');
define('OG_REST_CMD_RUN_SCHEDULE', 'run/schedule');
+define('OG_REST_CMD_RUN_TASK', 'task/run');
define('OG_REST_PARAM_CLIENTS', 'clients');
define('OG_REST_PARAM_ADDR', 'addr');
@@ -59,6 +60,7 @@ define('OG_REST_PARAM_DIFF_ID', 'diff_id');
define('OG_REST_PARAM_DIFF_NAME', 'diff_name');
define('OG_REST_PARAM_METHOD', 'method');
define('OG_REST_PARAM_ECHO', 'echo');
+define('OG_REST_PARAM_TASK', 'task');
$conf_file = parse_ini_file(__DIR__ . '/../../etc/ogAdmServer.cfg');
define('OG_REST_API_TOKEN', 'Authorization: ' . $conf_file['APITOKEN']);
@@ -544,6 +546,11 @@ function run_schedule($string_ips) {
common_request(OG_REST_CMD_RUN_SCHEDULE, POST, $data);
}
+function run_task($task_id) {
+ $data = array(OG_REST_PARAM_TASK => $task_id);
+ return common_request(OG_REST_CMD_RUN_TASK, POST, $data);
+}
+
/*
* @function multiRequest.
* @param URLs array (may include header and POST data), cURL options array.