1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import api from '@/store/api';
const DumpsStore = {
namespaced: true,
state: {
bmcDumps: [],
},
getters: {
allDumps: (state) => state.bmcDumps,
},
mutations: {
setBmcDumps: (state, dumps) => {
state.bmcDumps = dumps.map((dump) => ({
dateTime: new Date(dump.Created),
dumpType: dump.Name,
id: dump.Id,
size: dump.AdditionalDataSizeBytes,
data: dump.AdditionalDataURI,
}));
},
},
actions: {
async getBmcDumps({ commit }) {
return await api
.get('/redfish/v1/Managers/bmc/LogServices/Dump/Entries')
.then(({ data = {} }) => commit('setBmcDumps', data.Members || []))
.catch((error) => console.log(error));
},
},
};
export default DumpsStore;
|