mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
API CHANGE: 5 simple "actions" for sysadm/firewall
Add five new "actions" for managing the firewall:
"start" - turn on the firewall
"stop" - turn off the firewall
"restart" - reload the firewall (catches any settings changes - not generally needed)
"enable" - automatically start the firewall on bootup
"disable" - do not start the firewall on bootup
They all use the same input/output syntax, just the "action" input field is different
REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
"action" : "restart"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"args" : {
"action" : "restart"
},
"namespace" : "sysadm",
"name" : "firewall"
}
Response:
-------------------------------
{
"args": {
"result": "success"
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
This commit is contained in:
@@ -1170,6 +1170,26 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmFirewallRequest(const QJsonV
|
||||
FMGR.ClosePort(P);
|
||||
}
|
||||
|
||||
}else if(action=="start"){
|
||||
ok = true;
|
||||
FMGR.Start();
|
||||
|
||||
}else if(action=="stop"){
|
||||
ok = true;
|
||||
FMGR.Stop();
|
||||
|
||||
}else if(action=="restart"){
|
||||
ok = true;
|
||||
FMGR.Restart();
|
||||
|
||||
}else if(action=="enable"){
|
||||
ok = true;
|
||||
FMGR.Enable();
|
||||
|
||||
}else if(action=="disable"){
|
||||
ok = true;
|
||||
FMGR.Disable();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user