summaryrefslogtreecommitdiff
path: root/src/store/modules/Logs/DumpsStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/Logs/DumpsStore.js')
-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) => {