Replace fixed paths with response from API

Currently, the Redfish request used fixed URIs, modify the code to use
the BMC and System paths got from response of API calls.
For CertificateStore, since it was using the URL for constant variable
assignment, changed the constant CERTIFICATE_TYPES to method call.

Change-Id: I330b7272083e3e6993aae5705aae170b8e9a4659
Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
diff --git a/src/store/modules/SecurityAndAccess/PoliciesStore.js b/src/store/modules/SecurityAndAccess/PoliciesStore.js
index e6bcfb9..f1e98b2 100644
--- a/src/store/modules/SecurityAndAccess/PoliciesStore.js
+++ b/src/store/modules/SecurityAndAccess/PoliciesStore.js
@@ -31,7 +31,7 @@
   actions: {
     async getNetworkProtocolStatus({ commit }) {
       return await api
-        .get('/redfish/v1/Managers/bmc/NetworkProtocol')
+        .get(`${await this.dispatch('global/getBmcPath')}/NetworkProtocol`)
         .then((response) => {
           const sshProtocol = response.data.SSH.ProtocolEnabled;
           const ipmiProtocol = response.data.IPMI.ProtocolEnabled;
@@ -42,7 +42,7 @@
     },
     async getBiosStatus({ commit }) {
       return await api
-        .get('/redfish/v1/Systems/system/Bios')
+        .get(`${await this.dispatch('global/getSystemPath')}/Bios`)
         .then((response) => {
           commit('setRtadEnabled', response.data.Attributes.pvm_rtad);
           commit('setVtpmEnabled', response.data.Attributes.pvm_vtpm);
@@ -66,7 +66,10 @@
         },
       };
       return await api
-        .patch('/redfish/v1/Managers/bmc/NetworkProtocol', ipmi)
+        .patch(
+          `${await this.dispatch('global/getBmcPath')}/NetworkProtocol`,
+          ipmi,
+        )
         .then(() => {
           if (protocolEnabled) {
             return i18n.t('pagePolicies.toast.successIpmiEnabled');
@@ -92,7 +95,10 @@
         },
       };
       return await api
-        .patch('/redfish/v1/Managers/bmc/NetworkProtocol', ssh)
+        .patch(
+          `${await this.dispatch('global/getBmcPath')}/NetworkProtocol`,
+          ssh,
+        )
         .then(() => {
           if (protocolEnabled) {
             return i18n.t('pagePolicies.toast.successSshEnabled');
@@ -113,7 +119,7 @@
     async saveRtadState({ commit }, updatedRtad) {
       commit('setRtadEnabled', updatedRtad);
       return await api
-        .patch('/redfish/v1/Systems/system/Bios/Settings', {
+        .patch(`${await this.dispatch('global/getSystemPath')}/Bios/Settings`, {
           Attributes: {
             pvm_rtad: updatedRtad,
           },
@@ -137,7 +143,7 @@
     async saveVtpmState({ commit }, updatedVtpm) {
       commit('setVtpmEnabled', updatedVtpm);
       return await api
-        .patch('/redfish/v1/Systems/system/Bios/Settings', {
+        .patch(`${await this.dispatch('global/getSystemPath')}/Bios/Settings`, {
           Attributes: {
             pvm_vtpm: updatedVtpm,
           },