Yoshie Muranaka | c11d389 | 2020-02-19 08:07:40 -0800 | [diff] [blame] | 1 | import api from '../../api'; |
| 2 | import i18n from '../../../i18n'; |
| 3 | |
| 4 | const 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 Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame^] | 11 | .then(() => i18n.t('pageRebootBmc.toast.successRebootStart')) |
Yoshie Muranaka | c11d389 | 2020-02-19 08:07:40 -0800 | [diff] [blame] | 12 | .catch(error => { |
| 13 | console.log(error); |
Yoshie Muranaka | 547b5fc | 2020-02-24 15:42:40 -0800 | [diff] [blame^] | 14 | throw new Error(i18n.t('pageRebootBmc.toast.errorRebootStart')); |
Yoshie Muranaka | c11d389 | 2020-02-19 08:07:40 -0800 | [diff] [blame] | 15 | }); |
| 16 | } |
| 17 | } |
| 18 | }; |
| 19 | |
| 20 | export default ControlStore; |