Add API call to show iohyve version

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "action" : "version"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "args" : {
      "action" : "version"
   },
   "id" : "fooid",
   "name" : "iohyve"
}

Response:
-------------------------------
{
  "args": {
    "version": {
      "version": "iohyve v0.7.3 2016/01/08 Bear in a Datacenter Edition"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
Kris Moore
2016-03-03 14:22:53 -05:00
parent 213e8191c9
commit 91a2c700cb
3 changed files with 14 additions and 1 deletions

View File

@@ -648,6 +648,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIohyveRequest(const QJsonVal
ok = true;
out->insert("stop", sysadm::Iohyve::stopGuest(in_args.toObject()));
}
else if(act=="version"){
ok = true;
out->insert("version", sysadm::Iohyve::version());
}
//qDebug() << " - iohyve action finished:" << act << ok;
} //end of "action" key usage