diff options
-rw-r--r-- | src/store/modules/GlobalStore.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js index 057f5158..83b5432e 100644 --- a/src/store/modules/GlobalStore.js +++ b/src/store/modules/GlobalStore.js @@ -10,10 +10,13 @@ const HOST_STATE = { const hostStateMapper = hostState => { switch (hostState) { case HOST_STATE.on: + case 'On': // Redfish PowerState return 'on'; case HOST_STATE.off: + case 'Off': // Redfish PowerState return 'off'; case HOST_STATE.error: + // TODO: Map Redfish Quiesced when bmcweb supports return 'error'; // TODO: Add mapping for DiagnosticMode default: @@ -61,10 +64,9 @@ const GlobalStore = { }, getHostStatus({ commit }) { api - .get('/xyz/openbmc_project/state/host0/attr/CurrentHostState') - .then(response => { - const hostState = response.data.data; - commit('setHostStatus', hostState); + .get('/redfish/v1/Systems/system') + .then(({ data: { PowerState } } = {}) => { + commit('setHostStatus', PowerState); }) .catch(error => console.log(error)); } |