mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 18:20:23 +00:00
Add two new API calls, to shutdown/halt the system, and to
reboot the system.
Shutdown API call
REST Request:
-------------------------------
PUT /sysadm/systemmanager
{
"action" : "halt"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"args" : {
"action" : "halt"
},
"name" : "systemmanager",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"halt": {
"response": "true"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
Reboot API call
REST Request:
-------------------------------
PUT /sysadm/systemmanager
{
"action" : "reboot"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"args" : {
"action" : "reboot"
},
"name" : "systemmanager",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"reboot": {
"response": "true"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
This commit is contained in:
@@ -405,6 +405,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmSystemMgmtRequest(const QJso
|
||||
ok = true;
|
||||
out->insert("externalmounts", sysadm::SysMgmt::externalDevicePaths());
|
||||
}
|
||||
if(act=="halt"){
|
||||
ok = true;
|
||||
out->insert("halt", sysadm::SysMgmt::systemHalt());
|
||||
}
|
||||
if(act=="killproc"){
|
||||
ok = true;
|
||||
out->insert("killproc", sysadm::SysMgmt::killProc(in_args.toObject()));
|
||||
@@ -417,6 +421,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmSystemMgmtRequest(const QJso
|
||||
ok = true;
|
||||
out->insert("procinfo", sysadm::SysMgmt::procInfo());
|
||||
}
|
||||
if(act=="reboot"){
|
||||
ok = true;
|
||||
out->insert("reboot", sysadm::SysMgmt::systemReboot());
|
||||
}
|
||||
if(act=="setsysctl"){
|
||||
ok = true;
|
||||
out->insert("setsysctl", sysadm::SysMgmt::setSysctl(in_args.toObject()));
|
||||
|
||||
Reference in New Issue
Block a user