summaryrefslogtreecommitdiff
path: root/src/store/modules/Control/FactoryResetStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/Control/FactoryResetStore.js')
-rw-r--r--src/store/modules/Control/FactoryResetStore.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/store/modules/Control/FactoryResetStore.js b/src/store/modules/Control/FactoryResetStore.js
new file mode 100644
index 00000000..8118cf7f
--- /dev/null
+++ b/src/store/modules/Control/FactoryResetStore.js
@@ -0,0 +1,32 @@
+import api from '@/store/api';
+import i18n from '@/i18n';
+
+const FactoryResetStore = {
+ namespaced: true,
+ actions: {
+ async resetToDefaults() {
+ return await api
+ .post('/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults', {
+ ResetToDefaultsType: 'ResetAll',
+ })
+ .then(() => i18n.t('pageFactoryReset.toast.resetToDefaultsSuccess'))
+ .catch((error) => {
+ console.log('Factory Reset: ', error);
+ throw new Error(
+ i18n.t('pageFactoryReset.toast.resetToDefaultsError')
+ );
+ });
+ },
+ async resetBios() {
+ return await api
+ .post('/redfish/v1/Systems/system/Bios/Actions/Bios.ResetBios')
+ .then(() => i18n.t('pageFactoryReset.toast.resetBiosSuccess'))
+ .catch((error) => {
+ console.log('Factory Reset: ', error);
+ throw new Error(i18n.t('pageFactoryReset.toast.resetBiosError'));
+ });
+ },
+ },
+};
+
+export default FactoryResetStore;