Commit 38efa570 authored by Franco Fichtner's avatar Franco Fichtner

firmware: API glue for reboot / powerdown; closes #948

parent a96b0da4
......@@ -114,6 +114,44 @@ class FirmwareController extends ApiControllerBase
return $response;
}
/**
* perform reboot
* @return array status
* @throws \Exception
*/
public function rebootAction()
{
$backend = new Backend();
$response = array();
if ($this->request->isPost()) {
$response['status'] = 'ok';
$response['msg_uuid'] = trim($backend->configdRun('firmware reboot', true));
} else {
$response['status'] = 'failure';
}
return $response;
}
/**
* perform powerdown
* @return array status
* @throws \Exception
*/
public function powerdownAction()
{
$backend = new Backend();
$response = array();
if ($this->request->isPost()) {
$response['status'] = 'ok';
$response['msg_uuid'] = trim($backend->configdRun('firmware powerdown', true));
} else {
$response['status'] = 'failure';
}
return $response;
}
/**
* perform actual upgrade
* @return array status
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment