From 881ddc4111d0025123ce3898044d373a2eb329cf Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Tue, 21 Apr 2020 19:24:29 -0700 Subject: 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 Change-Id: Ied2e70d5e26eb820d41d6b63acdded237f7646a4 --- src/store/modules/GlobalStore.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/store') 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)); } -- cgit v1.2.3