mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 18:20:23 +00:00
Add a new iocage API call to deactivate pools.
REST Request:
-------------------------------
PUT /sysadm/iocage
{
"action" : "deactivatepool",
"pool" : "tank"
}
REST Response:
-------------------------------
{
"args": {
"deactivatepool": {
"success": "pool tank deactivated."
}
}
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"name" : "iocage",
"args" : {
"pool" : "tank",
"action" : "deactivatepool"
},
"namespace" : "sysadm"
}
WebSocket Response:
-------------------------------
{
"args": {
"deactivatepool": {
"success": "pool tank deactivated."
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
Also added some error control to the activate API call.
This commit is contained in:
@@ -389,6 +389,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIocageRequest(const QJsonVal
|
||||
bool ok = false;
|
||||
if(keys.contains("action")){
|
||||
QString act = JsonValueToString(in_args.toObject().value("action"));
|
||||
if(act=="deactivatepool"){
|
||||
ok = true;
|
||||
out->insert("deactivatepool", sysadm::Iocage::deactivatePool(in_args.toObject()));
|
||||
}
|
||||
if(act=="activatepool"){
|
||||
ok = true;
|
||||
out->insert("activatepool", sysadm::Iocage::activatePool(in_args.toObject()));
|
||||
|
||||
Reference in New Issue
Block a user