Add a new API call: sysadm/pkg, "action"="pkg_check_upgrade".

This will have pkg check to see if there are any package updates available.
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_check_upgrade"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "pkg_check_upgrade"
   },
   "namespace" : "sysadm",
   "name" : "pkg",
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "pkg_check_upgrade": {
      "proc_cmd": "pkg upgrade -n",
      "proc_id": "sysadm_pkg_check_upgrade-{c5e9d9a1-7c49-4a70-9d7c-4a84277c83b0}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
Ken Moore
2016-03-28 11:00:59 -04:00
parent df3196a54e
commit 8680d309a5
2 changed files with 2 additions and 2 deletions

View File

@@ -754,7 +754,7 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmPkgRequest(const QJsonValue
}else if(act=="pkg_update"){
}else if(act=="pkg_check_upgrade"){
out->insert("pkg_check_upgrade", sysadm::PKG::pkg_check_upgrade());
}else if(act=="pkg_upgrade"){
out->insert("pkg_upgrade", sysadm::PKG::pkg_upgrade());
}else if(act=="pkg_audit"){