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:
Ken Moore
2016-09-13 07:39:27 -04:00
parent aca7bbc7b0
commit c089525bf7

View File

@@ -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();
}