Add Key clear page under Operations section
This page will allow privileged user to clear encrypted keys.
- Only admin and CE login user will be able to see the page
- The UI will be different for both, admin and CE login user(service)
- This page is IBM only
Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com>
Change-Id: Ic6fe3454de815629a6b2250daa99ab21f2b316c3
diff --git a/src/store/modules/Operations/KeyClearStore.js b/src/store/modules/Operations/KeyClearStore.js
new file mode 100644
index 0000000..1dc96e0
--- /dev/null
+++ b/src/store/modules/Operations/KeyClearStore.js
@@ -0,0 +1,25 @@
+import api from '@/store/api';
+import i18n from '@/i18n';
+
+const KeyClearStore = {
+ namespaced: true,
+ actions: {
+ async clearEncryptionKeys(_, selectedKey) {
+ const selectedKeyForClearing = {
+ Attributes: { hb_key_clear_request: selectedKey },
+ };
+ return await api
+ .patch(
+ '/redfish/v1/Systems/system/Bios/Settings',
+ selectedKeyForClearing
+ )
+ .then(() => i18n.t('pageKeyClear.toast.selectedKeyClearedSuccess'))
+ .catch((error) => {
+ console.log('Key clear', error);
+ throw new Error(i18n.t('pageKeyClear.toast.selectedKeyClearedError'));
+ });
+ },
+ },
+};
+
+export default KeyClearStore;