summaryrefslogtreecommitdiff
path: root/src/store/modules/Control/ControlStore.js
blob: f6415771f99609b37eeabc87dbe5805af02233e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import api from '../../api';
import i18n from '../../../i18n';

const ControlStore = {
  namespaced: true,
  actions: {
    async rebootBmc() {
      const data = { ResetType: 'GracefulRestart' };
      return await api
        .post('/redfish/v1/Managers/bmc/Actions/Manager.Reset', data)
        .then(() => i18n.t('pageRebootBmc.toastMessages.successRebootStart'))
        .catch(error => {
          console.log(error);
          throw new Error(
            i18n.t('pageRebootBmc.toastMessages.errorRebootStart')
          );
        });
    }
  }
};

export default ControlStore;