summaryrefslogtreecommitdiff
path: root/src/store/modules
diff options
context:
space:
mode:
authorSukanya Pandey <sukapan1@in.ibm.com>2021-08-23 15:41:02 +0300
committerDixsie Wolmers <dixsiew@gmail.com>2022-01-28 00:14:50 +0300
commite39b95d6d06c9389c123440d1571edc5cee211bb (patch)
tree68a65efe9eb104232cc1153b4517d6ab531f7182 /src/store/modules
parent2b33ec2cd523cc48c40977b31a13c2ce925f58c5 (diff)
downloadwebui-vue-e39b95d6d06c9389c123440d1571edc5cee211bb.tar.xz
Add ability to view all the dumps
The story is integration of these two API responses for their respective dumps: 1.Resource and Hostboot dumps: redfish/v1/Systems/system/LogServices/Dump/Entries 2.BMC Dumps: /redfish/v1/Managers/bmc/LogServices/Dump/Entries Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I24ded733e682d21904e92e2e8be1951e46d33b09
Diffstat (limited to 'src/store/modules')
-rw-r--r--src/store/modules/Logs/DumpsStore.js39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/store/modules/Logs/DumpsStore.js b/src/store/modules/Logs/DumpsStore.js
index ac61d2dc..746733a0 100644
--- a/src/store/modules/Logs/DumpsStore.js
+++ b/src/store/modules/Logs/DumpsStore.js
@@ -10,7 +10,7 @@ const DumpsStore = {
allDumps: (state) => state.allDumps,
},
mutations: {
- setBmcDumps: (state, dumps) => {
+ setAllDumps: (state, dumps) => {
state.allDumps = dumps.map((dump) => ({
data: dump.AdditionalDataURI,
dateTime: new Date(dump.Created),
@@ -22,10 +22,35 @@ const DumpsStore = {
},
},
actions: {
- async getBmcDumpEntries({ commit }) {
+ async getBmcDumpEntries() {
+ return api
+ .get('/redfish/v1/')
+ .then((response) => api.get(response.data.Managers['@odata.id']))
+ .then((response) => api.get(`${response.data['@odata.id']}/bmc`))
+ .then((response) => api.get(response.data.LogServices['@odata.id']))
+ .then((response) => api.get(`${response.data['@odata.id']}/Dump`))
+ .then((response) => api.get(response.data.Entries['@odata.id']))
+ .catch((error) => console.log(error));
+ },
+ async getSystemDumpEntries() {
+ return api
+ .get('/redfish/v1/')
+ .then((response) => api.get(response.data.Systems['@odata.id']))
+ .then((response) => api.get(`${response.data['@odata.id']}/system`))
+ .then((response) => api.get(response.data.LogServices['@odata.id']))
+ .then((response) => api.get(`${response.data['@odata.id']}/Dump`))
+ .then((response) => api.get(response.data.Entries['@odata.id']))
+ .catch((error) => console.log(error));
+ },
+ async getAllDumps({ commit, dispatch }) {
return await api
- .get('/redfish/v1/Managers/bmc/LogServices/Dump/Entries')
- .then(({ data = {} }) => commit('setBmcDumps', data.Members || []))
+ .all([dispatch('getBmcDumpEntries'), dispatch('getSystemDumpEntries')])
+ .then((response) => {
+ const bmcDumpEntries = response[0].data?.Members || [];
+ const systemDumpEntries = response[1].data?.Members || [];
+ const allDumps = [...bmcDumpEntries, ...systemDumpEntries];
+ commit('setAllDumps', allDumps);
+ })
.catch((error) => console.log(error));
},
async createBmcDump() {
@@ -66,7 +91,7 @@ const DumpsStore = {
return await api
.all(promises)
.then((response) => {
- dispatch('getBmcDumpEntries');
+ dispatch('getAllDumps');
return response;
})
.then(
@@ -95,13 +120,13 @@ const DumpsStore = {
);
},
async deleteAllDumps({ commit, state }) {
- const totalDumpCount = state.bmcDumps.length;
+ const totalDumpCount = state.allDumps.length;
return await api
.post(
'/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.ClearLog'
)
.then(() => {
- commit('setBmcDumps', []);
+ commit('setAllDumps', []);
return i18n.tc('pageDumps.toast.successDeleteDump', totalDumpCount);
})
.catch((error) => {