From 62465ad03e185fdac3137eb16fa8919441311f17 Mon Sep 17 00:00:00 2001 From: Kris Moore Date: Mon, 1 Feb 2016 13:21:17 -0500 Subject: [PATCH] Add the 'startupdate' API call which allows you to queue a system update Valid args: target : "chbranch/pkgupdate/fbsdupdate/fbsdupdatepkgs/standalone" branch: "newbranch" - (Only used with chbranch target) tag: "pkgng-1.6.9" - (Only used with standalone target) REST Request: ------------------------------- PUT /sysadm/update { "action" : "startupdate", "target" : "pkgupdate" } REST Response: ------------------------------- { "args": { "startupdate": { "queueid": "611c89ae-c43c-11e5-9602-54ee75595566", "command": "pc-updatemanager pkgupdate", "comment": "Task Queued" } } } WebSocket Request: ------------------------------- { "args" : { "action" : "startupdate", "target" : "pkgupdate" }, "name" : "update", "id" : "fooid", "namespace" : "sysadm" } WebSocket Response: ------------------------------- { "args": { "startupdate": { "queueid": "611c89ae-c43c-11e5-9602-54ee75595566", "command": "pc-updatemanager pkgupdate", "comment": "Task Queued" } }, "id": "fooid", "name": "response", "namespace": "sysadm" } --- src/server/library/sysadm-update.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/library/sysadm-update.cpp b/src/server/library/sysadm-update.cpp index 27694f3..37cfe19 100644 --- a/src/server/library/sysadm-update.cpp +++ b/src/server/library/sysadm-update.cpp @@ -142,6 +142,7 @@ QJsonObject Update::startUpdate(QJsonObject jsin) { // Create a unique ID for this queued action QString ID = QUuid::createUuid().toString(); + // Queue the update action DISPATCHER->queueProcess(ID, "pc-updatemanager " + flags); // Return some details to user that the action was queued