mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
New API Call: sysadm/iocage "action"="activatestatus"
This will list the current pool which is activated for iocage to use.
Example API return (arguments):
{
"activatestatus":{
"activated":"true",
"pool":"my_zpool"
}
}
Changelog: yes
This commit is contained in:
@@ -650,7 +650,7 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIocageRequest(const QJsonVal
|
||||
QJsonObject retObj;
|
||||
if(act=="activatepool"){ retObj = sysadm::Iocage::activatePool(in_args.toObject()); }
|
||||
else if(act=="deactivatepool"){retObj = sysadm::Iocage::deactivatePool(in_args.toObject()); }
|
||||
|
||||
else if(act=="activatestatus"){ retObj = sysadm::Iocage::activateStatus(); }
|
||||
/*if(act=="execjail"){
|
||||
ok = true;
|
||||
out->insert("execjail", sysadm::Iocage::execJail(in_args.toObject()));
|
||||
|
||||
@@ -14,15 +14,14 @@ using namespace sysadm;
|
||||
|
||||
// ============ GLOBAL OPTIONS ==============
|
||||
// Current activation status
|
||||
// ##NOT-WORKING in 5/23/17 build of iocage (0.9.8.1)##
|
||||
QJsonObject Iocage::activateStatus(){
|
||||
QJsonObject retObject;
|
||||
bool success = false;
|
||||
QString output = General::RunCommand(success, "iocage activate --status");
|
||||
QStringList info = General::RunCommand(success, "iocage get -p").split("\n");
|
||||
retObject.insert("activated", success ? "true" : "false");
|
||||
if(success){
|
||||
//Grab the currently activated pool out of the return, and list that
|
||||
QString pool = output.simplified();
|
||||
QString pool = info.last().simplified();
|
||||
retObject.insert("pool", pool);
|
||||
}
|
||||
return retObject;
|
||||
|
||||
Reference in New Issue
Block a user