From 05887b50f1d1b08468b401b357faf13f505ee75f Mon Sep 17 00:00:00 2001 From: Sandeepa Singh Date: Mon, 10 Jan 2022 19:19:36 +0530 Subject: 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 Change-Id: Ic6fe3454de815629a6b2250daa99ab21f2b316c3 --- src/store/modules/Operations/KeyClearStore.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/store/modules/Operations/KeyClearStore.js (limited to 'src/store/modules') diff --git a/src/store/modules/Operations/KeyClearStore.js b/src/store/modules/Operations/KeyClearStore.js new file mode 100644 index 00000000..1dc96e0f --- /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; -- cgit v1.2.3