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/GlobalStore.js b/src/store/modules/GlobalStore.js
index 036dc48..10d50b1 100644
--- a/src/store/modules/GlobalStore.js
+++ b/src/store/modules/GlobalStore.js
@@ -77,9 +77,29 @@
     },
   },
   actions: {
+    async getBmcPath() {
+      const serviceRoot = await api
+        .get('/redfish/v1')
+        .catch((error) => console.log(error));
+      let bmcPath = serviceRoot.data?.ManagerProvidingService?.['@odata.id'];
+      if (!bmcPath) {
+        const managers = await api
+          .get('/redfish/v1/Managers')
+          .catch((error) => console.log(error));
+        bmcPath = managers.data?.Members?.[0]?.['@odata.id'];
+      }
+      return bmcPath;
+    },
+    async getSystemPath() {
+      const systems = await api
+        .get('/redfish/v1/Systems')
+        .catch((error) => console.log(error));
+      let systemPath = systems.data?.Members?.[0]?.['@odata.id'];
+      return systemPath;
+    },
     async getBmcTime({ commit }) {
       return await api
-        .get('/redfish/v1/Managers/bmc')
+        .get(`${await this.dispatch('global/getBmcPath')}`)
         .then((response) => {
           const bmcDateTime = response.data.DateTime;
           const date = new Date(bmcDateTime);
@@ -87,9 +107,9 @@
         })
         .catch((error) => console.log(error));
     },
-    getSystemInfo({ commit }) {
+    async getSystemInfo({ commit }) {
       api
-        .get('/redfish/v1/Systems/system')
+        .get(`${await this.dispatch('global/getSystemPath')}`)
         .then(
           ({
             data: {