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/Operations/ControlStore.js b/src/store/modules/Operations/ControlStore.js
index e76063b..efcdf62 100644
--- a/src/store/modules/Operations/ControlStore.js
+++ b/src/store/modules/Operations/ControlStore.js
@@ -51,7 +51,7 @@
   actions: {
     async getLastPowerOperationTime({ commit }) {
       return await api
-        .get('/redfish/v1/Systems/system')
+        .get(`${await this.dispatch('global/getSystemPath')}`)
         .then((response) => {
           const lastReset = response.data.LastResetTime;
           if (lastReset) {
@@ -61,9 +61,9 @@
         })
         .catch((error) => console.log(error));
     },
-    getLastBmcRebootTime({ commit }) {
+    async getLastBmcRebootTime({ commit }) {
       return api
-        .get('/redfish/v1/Managers/bmc')
+        .get(`${await this.dispatch('global/getBmcPath')}`)
         .then((response) => {
           const lastBmcReset = response.data.LastResetTime;
           const lastBmcRebootTime = new Date(lastBmcReset);
@@ -74,7 +74,10 @@
     async rebootBmc({ dispatch }) {
       const data = { ResetType: 'GracefulRestart' };
       return await api
-        .post('/redfish/v1/Managers/bmc/Actions/Manager.Reset', data)
+        .post(
+          `${await this.dispatch('global/getBmcPath')}/Actions/Manager.Reset`,
+          data,
+        )
         .then(() => dispatch('getLastBmcRebootTime'))
         .then(() => i18n.t('pageRebootBmc.toast.successRebootStart'))
         .catch((error) => {
@@ -117,10 +120,13 @@
       commit('setOperationInProgress', false);
       dispatch('getLastPowerOperationTime');
     },
-    serverPowerChange({ commit }, data) {
+    async serverPowerChange({ commit }, data) {
       commit('setOperationInProgress', true);
       api
-        .post('/redfish/v1/Systems/system/Actions/ComputerSystem.Reset', data)
+        .post(
+          `${await this.dispatch('global/getSystemPath')}/Actions/ComputerSystem.Reset`,
+          data,
+        )
         .catch((error) => {
           console.log(error);
           commit('setOperationInProgress', false);