Add new API call "sysctllist"

Returns the list of all setable sysctl values

REST Request:
-------------------------------
PUT /sysadm/systemmanager
{
   "action" : "sysctllist"
}

REST Response:
-------------------------------
{
    "args": {
        "sysctllist": {
            "compat.ia32.maxdsiz": "536870912",
            "compat.ia32.maxssiz": "67108864",
            "compat.ia32.maxvmem": "0",
            "compat.linux.osname": "Linux",
            "compat.linux.osrelease": "2.6.18",
            "compat.linux.oss_version": "198144",
            "compat.linux32.maxdsiz": "536870912",
            "compat.linux32.maxssiz": "67108864",
            "compat.linux32.maxvmem": "0",
            ....
        }
    }
}

WebSocket Request:
-------------------------------
{
   "name" : "systemmanager",
   "namespace" : "sysadm",
   "id" : "fooid",
   "args" : {
      "action" : "sysctllist"
   }
}

WebSocket Response:
-------------------------------
{
  "args": {
    "sysctllist": {
      "compat.ia32.maxdsiz": "536870912",
      "compat.ia32.maxssiz": "67108864",
      "compat.ia32.maxvmem": "0",
      "compat.linux.osname": "Linux",
      "compat.linux.osrelease": "2.6.18",
      "compat.linux.oss_version": "198144",
      "compat.linux32.maxdsiz": "536870912",
      "compat.linux32.maxssiz": "67108864",
      "compat.linux32.maxvmem": "0",
      ....
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
Kris Moore
2016-02-03 13:09:31 -05:00
parent 36d2f77d5c
commit fccac94ab6
3 changed files with 25 additions and 0 deletions

View File

@@ -329,6 +329,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmSystemMgmtRequest(const QJso
ok = true;
out->insert("procinfo", sysadm::SysMgmt::procInfo());
}
if(act=="sysctllist"){
ok = true;
out->insert("sysctllist", sysadm::SysMgmt::sysctlList());
}
if(act=="systeminfo"){
ok = true;
out->insert("systeminfo", sysadm::SysMgmt::systemInfo());