diff options
author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-04-22 05:24:29 +0300 |
---|---|---|
committer | Gunnar Mills <gmills@us.ibm.com> | 2020-04-28 17:05:12 +0300 |
commit | 881ddc4111d0025123ce3898044d373a2eb329cf (patch) | |
tree | d1fc59488f6099e50a9ad8145d58706154ee2430 /src/store | |
parent | c4e38abf5c31d77474d5287620d1ddc8089b6dae (diff) | |
download | webui-vue-881ddc4111d0025123ce3898044d373a2eb329cf.tar.xz |
Change host status request to Redfish
Use /redfish/v1/Systems/system Redfish endpoint to get
host status from PowerState property.
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: Ied2e70d5e26eb820d41d6b63acdded237f7646a4
Diffstat (limited to 'src/store')
-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)); } |