diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2018-02-06 15:42:29 -0600 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-12 23:47:44 +0000 |
commit | 3aa8b535e870746181d6877ee8e6ae616abeb310 (patch) | |
tree | f27ca8dd7360e5290a49c7e65a3a40223c4c0fd0 /app/server-control/controllers | |
parent | de88340de4d3d14e78a854d728728f1183283c64 (diff) | |
download | phosphor-webui-3aa8b535e870746181d6877ee8e6ae616abeb310.tar.gz phosphor-webui-3aa8b535e870746181d6877ee8e6ae616abeb310.zip |
Have Immediate Shutdown call the chassis object
"Immediate Shutdown" on the GUI should be a hard power off
and differ from the "Orderly shutdown".
From https://github.com/openbmc/docs/blob/master/host-management.md:
To issue a hard power off (accomplished by powering off the chassis):
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT \
-d '{"data": "xyz.openbmc_project.State.Chassis.Transition.Off"}' \
https://${bmc}/xyz/openbmc_project/state/chassis0/attr/RequestedPowerTransition
There was already an unused "chassisPowerOff" function, reworked it to
call the chassis object.
Resolves openbmc/openbmc#2890
Tested: Pointed the local GUI to a Witherspoon system and
verfied the correct rest call was made and the system hard
powered off.
Change-Id: Ibdb712656930a62e34603daa17df0d3116c86d92
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'app/server-control/controllers')
-rw-r--r-- | app/server-control/controllers/power-operations-controller.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/server-control/controllers/power-operations-controller.js b/app/server-control/controllers/power-operations-controller.js index 4ab765d..d38076f 100644 --- a/app/server-control/controllers/power-operations-controller.js +++ b/app/server-control/controllers/power-operations-controller.js @@ -117,7 +117,14 @@ window.angular && (function (angular) { }; $scope.immediateShutdown = function(){ - $scope.orderlyShutdown(); + //@TODO:show progress + APIUtils.chassisPowerOff(function(response){ + if(response){ + dataService.setPowerOffState(); + }else{ + //@TODO:hide progress & show error message + } + }); }; $scope.immediateShutdownConfirm = function(){ if($scope.confirm) { |