From df3196a54ebfff9d10554da4178734128f581fd7 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 28 Mar 2016 10:55:40 -0400 Subject: [PATCH] Add a new API call: sysadm/pkg, "action"="pkg_upgrade". This will have pkg upgrade all currently-installed packages. NOTE: The actual information will be returned as a Dispatcher event - this API call just queues up the pkg operation (limitation of pkg - only one process call at a time) REST Request: ------------------------------- PUT /sysadm/pkg { "action" : "pkg_upgrade" } WebSocket Request: ------------------------------- { "args" : { "action" : "pkg_upgrade" }, "name" : "pkg", "namespace" : "sysadm", "id" : "fooid" } Response: ------------------------------- { "args": { "pkg_upgrade": { "proc_cmd": "pkg upgrade -y", "proc_id": "sysadm_pkg_upgrade-{19ace7c9-0d83-4a0d-9249-0b56cb105762}", "status": "pending" } }, "id": "fooid", "name": "response", "namespace": "sysadm" } --- src/server/WebBackend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/WebBackend.cpp b/src/server/WebBackend.cpp index 31d2e65..50f9bb0 100644 --- a/src/server/WebBackend.cpp +++ b/src/server/WebBackend.cpp @@ -756,7 +756,7 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmPkgRequest(const QJsonValue }else if(act=="pkg_check_upgrade"){ }else if(act=="pkg_upgrade"){ - + out->insert("pkg_upgrade", sysadm::PKG::pkg_upgrade()); }else if(act=="pkg_audit"){ out->insert("pkg_audit", sysadm::PKG::pkg_audit()); }else{