mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Add new API call to iohyve, which returns true/false
if iohyve has been setup on the box
REST Request:
-------------------------------
PUT /sysadm/iohyve
{
"action" : "issetup"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"args" : {
"action" : "issetup"
},
"name" : "iohyve"
}
Response:
-------------------------------
{
"args": {
"issetup": {
"setup": "true"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
This commit is contained in:
@@ -506,6 +506,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIohyveRequest(const QJsonVal
|
||||
ok = true;
|
||||
out->insert("fetchiso", sysadm::Iohyve::fetchISO(in_args.toObject()));
|
||||
}
|
||||
if(act=="issetup"){
|
||||
ok = true;
|
||||
out->insert("issetup", sysadm::Iohyve::isSetup());
|
||||
}
|
||||
if(act=="renameiso"){
|
||||
ok = true;
|
||||
out->insert("renameiso", sysadm::Iohyve::renameISO(in_args.toObject()));
|
||||
|
||||
@@ -39,6 +39,20 @@ QJsonObject Iohyve::fetchISO(QJsonObject jsin) {
|
||||
return retObject;
|
||||
}
|
||||
|
||||
// Return if iohyve is setup on the box
|
||||
QJsonObject Iohyve::isSetup() {
|
||||
QJsonObject retObject;
|
||||
|
||||
// Check if iohyve is setup on this box
|
||||
// We check the flags variable, enabling / disabling is done via service mgmt
|
||||
QString ioflags = General::getConfFileValue("/etc/rc.conf", "iohyve_flags=", 1);
|
||||
if ( ioflags.isEmpty() )
|
||||
retObject.insert("setup", "false");
|
||||
else
|
||||
retObject.insert("setup", "true");
|
||||
|
||||
return retObject;
|
||||
}
|
||||
|
||||
// List the VMs on the box
|
||||
QJsonObject Iohyve::listVMs() {
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace sysadm{
|
||||
class Iohyve{
|
||||
public:
|
||||
static QJsonObject fetchISO(QJsonObject);
|
||||
static QJsonObject isSetup();
|
||||
static QJsonObject listVMs();
|
||||
static QJsonObject renameISO(QJsonObject);
|
||||
static QJsonObject rmISO(QJsonObject);
|
||||
|
||||
Reference in New Issue
Block a user