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/HardwareStatus/BmcStore.js b/src/store/modules/HardwareStatus/BmcStore.js
index d96926e..f0e4cf9 100644
--- a/src/store/modules/HardwareStatus/BmcStore.js
+++ b/src/store/modules/HardwareStatus/BmcStore.js
@@ -47,7 +47,7 @@
   actions: {
     async getBmcInfo({ commit }) {
       return await api
-        .get('/redfish/v1/Managers/bmc')
+        .get(`${await this.dispatch('global/getBmcPath')}`)
         .then(({ data }) => commit('setBmcInfo', data))
         .catch((error) => console.log(error));
     },
diff --git a/src/store/modules/HardwareStatus/MemoryStore.js b/src/store/modules/HardwareStatus/MemoryStore.js
index 787a050..d9a107d 100644
--- a/src/store/modules/HardwareStatus/MemoryStore.js
+++ b/src/store/modules/HardwareStatus/MemoryStore.js
@@ -60,7 +60,7 @@
   actions: {
     async getDimms({ commit }) {
       return await api
-        .get('/redfish/v1/Systems/system/Memory')
+        .get(`${await this.dispatch('global/getSystemPath')}/Memory`)
         .then(({ data: { Members } }) => {
           const promises = Members.map((item) => api.get(item['@odata.id']));
           return api.all(promises);
diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js
index 49f9620..446fdb9 100644
--- a/src/store/modules/HardwareStatus/ProcessorStore.js
+++ b/src/store/modules/HardwareStatus/ProcessorStore.js
@@ -63,7 +63,7 @@
   actions: {
     async getProcessorsInfo({ commit }) {
       return await api
-        .get('/redfish/v1/Systems/system/Processors')
+        .get(`${await this.dispatch('global/getSystemPath')}/Processors`)
         .then(({ data: { Members = [] } }) =>
           Members.map((member) => api.get(member['@odata.id'])),
         )
diff --git a/src/store/modules/HardwareStatus/ServerLedStore.js b/src/store/modules/HardwareStatus/ServerLedStore.js
index af22802..d4af064 100644
--- a/src/store/modules/HardwareStatus/ServerLedStore.js
+++ b/src/store/modules/HardwareStatus/ServerLedStore.js
@@ -17,7 +17,7 @@
   actions: {
     async getIndicatorLedActiveState({ commit }) {
       return await api
-        .get('/redfish/v1/Systems/system')
+        .get(`${await this.dispatch('global/getSystemPath')}`)
         .then((response) => {
           commit(
             'setIndicatorLedActiveState',
@@ -29,7 +29,7 @@
     async saveIndicatorLedActiveState({ commit }, payload) {
       commit('setIndicatorLedActiveState', payload);
       return await api
-        .patch('/redfish/v1/Systems/system', {
+        .patch(`${await this.dispatch('global/getSystemPath')}`, {
           LocationIndicatorActive: payload,
         })
         .catch((error) => {
diff --git a/src/store/modules/HardwareStatus/SystemStore.js b/src/store/modules/HardwareStatus/SystemStore.js
index ea519d7..87d2810 100644
--- a/src/store/modules/HardwareStatus/SystemStore.js
+++ b/src/store/modules/HardwareStatus/SystemStore.js
@@ -37,16 +37,13 @@
   actions: {
     async getSystem({ commit }) {
       return await api
-        .get('/redfish/v1')
-        .then((response) =>
-          api.get(`${response.data.Systems['@odata.id']}/system`),
-        )
+        .get(`${await this.dispatch('global/getSystemPath')}`)
         .then(({ data }) => commit('setSystemInfo', data))
         .catch((error) => console.log(error));
     },
     async changeIdentifyLedState({ commit }, ledState) {
       return await api
-        .patch('/redfish/v1/Systems/system', {
+        .patch(`${await this.dispatch('global/getSystemPath')}`, {
           LocationIndicatorActive: ledState,
         })
         .then(() => {