mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 18:20:23 +00:00
Add new iocage API call to list resource usage for jails.
REST Request:
-------------------------------
PUT /sysadm/iocage
{
"action" : "df"
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"name" : "iocage",
"id" : "fooid",
"args" : {
"action" : "df"
}
}
Response:
-------------------------------
{
"args": {
"df": {
"f250ab25-d062-11e5-8209-d05099728dbf": {
"ava": "83.4G",
"crt": "2.30x",
"qta": "none",
"res": "none",
"tag": "test",
"use": "1.69M"
},
"f39318ae-d064-11e5-8209-d05099728dbf": {
"ava": "83.4G",
"crt": "2.30x",
"qta": "none",
"res": "none",
"tag": "test2",
"use": "1.69M"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
This commit is contained in:
@@ -471,6 +471,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIocageRequest(const QJsonVal
|
||||
bool ok = false;
|
||||
if(keys.contains("action")){
|
||||
QString act = JsonValueToString(in_args.toObject().value("action"));
|
||||
if(act=="df"){
|
||||
ok = true;
|
||||
out->insert("df", sysadm::Iocage::df());
|
||||
}
|
||||
if(act=="destroyjail"){
|
||||
ok = true;
|
||||
out->insert("destroyjail", sysadm::Iocage::destroyJail(in_args.toObject()));
|
||||
|
||||
Reference in New Issue
Block a user