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) |
| 11 | .then(() => i18n.t('pageRebootBmc.toastMessages.successRebootStart')) |
| 12 | .catch(error => { |
| 13 | console.log(error); |
| 14 | throw new Error( |
| 15 | i18n.t('pageRebootBmc.toastMessages.errorRebootStart') |
| 16 | ); |
| 17 | }); |
| 18 | } |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | export default ControlStore; |