blob: 9b2e4592a9640b0274851e2583bb3be524acc239 [file] [log] [blame]
Yoshie Muranakac11d3892020-02-19 08:07:40 -08001import api from '../../api';
2import i18n from '../../../i18n';
3
4const ControlStore = {
5 namespaced: true,
6 actions: {
7 async rebootBmc() {
8 const data = { ResetType: 'GracefulRestart' };
9 return await api
10 .post('/redfish/v1/Managers/bmc/Actions/Manager.Reset', data)
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080011 .then(() => i18n.t('pageRebootBmc.toast.successRebootStart'))
Yoshie Muranakac11d3892020-02-19 08:07:40 -080012 .catch(error => {
13 console.log(error);
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080014 throw new Error(i18n.t('pageRebootBmc.toast.errorRebootStart'));
Yoshie Muranakac11d3892020-02-19 08:07:40 -080015 });
16 }
17 }
18};
19
20export default ControlStore;