diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-03-28 14:38:06 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-05-19 18:15:30 +0200 |
commit | a339db7e2c4953b724cc2d9a48cd775685503e0f (patch) | |
tree | 3c59e7c1644c39741ad6505e269f72cfa596e752 /admin/WebConsole/includes/restfunctions.php | |
parent | 8c54adaf50963a4fbd9febe52dd423799a07b69d (diff) |
#942 Add /run/task to API REST (web)
Diffstat (limited to 'admin/WebConsole/includes/restfunctions.php')
-rw-r--r-- | admin/WebConsole/includes/restfunctions.php | 7 |
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. |