diff options
author | Sean Zhang <xiazhang@nvidia.com> | 2024-06-15 08:42:41 +0300 |
---|---|---|
committer | Gunnar Mills <gunnar@gmills.xyz> | 2024-06-25 18:45:07 +0300 |
commit | 8841b7d463a5272a87faaa14cb103f778a772770 (patch) | |
tree | 731d8c82ddb76c1c9358c36d707747b09c5189cd /src/store/modules/Operations/VirtualMediaStore.js | |
parent | ccb71f0bd6b91b4344cf9a776a433528a5771217 (diff) | |
download | webui-vue-8841b7d463a5272a87faaa14cb103f778a772770.tar.xz |
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>
Diffstat (limited to 'src/store/modules/Operations/VirtualMediaStore.js')
-rw-r--r-- | src/store/modules/Operations/VirtualMediaStore.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/store/modules/Operations/VirtualMediaStore.js b/src/store/modules/Operations/VirtualMediaStore.js index 1d27e215..9688d9c6 100644 --- a/src/store/modules/Operations/VirtualMediaStore.js +++ b/src/store/modules/Operations/VirtualMediaStore.js @@ -49,7 +49,7 @@ const VirtualMediaStore = { } return await api - .get('/redfish/v1/Managers/bmc/VirtualMedia') + .get(`${await this.dispatch('global/getBmcPath')}/VirtualMedia`) .then((response) => response.data.Members.map( (virtualMedia) => virtualMedia['@odata.id'], @@ -95,7 +95,7 @@ const VirtualMediaStore = { async mountImage(_, { id, data }) { return await api .post( - `/redfish/v1/Managers/bmc/VirtualMedia/${id}/Actions/VirtualMedia.InsertMedia`, + `${await this.dispatch('global/getBmcPath')}/VirtualMedia/${id}/Actions/VirtualMedia.InsertMedia`, data, ) .catch((error) => { @@ -106,7 +106,7 @@ const VirtualMediaStore = { async unmountImage(_, id) { return await api .post( - `/redfish/v1/Managers/bmc/VirtualMedia/${id}/Actions/VirtualMedia.EjectMedia`, + `${await this.dispatch('global/getBmcPath')}/VirtualMedia/${id}/Actions/VirtualMedia.EjectMedia`, ) .catch((error) => { console.log('Unmount image:', error); |