From 0d9b976dd2ebbded13b035a2447009a4458767d5 Mon Sep 17 00:00:00 2001 From: Marcelo Fukumoto Date: Tue, 7 Jul 2026 12:03:07 +0200 Subject: [PATCH] feat: Added new API for the vms Signed-off-by: Marcelo Fukumoto --- .../components/vm-migration/ConfigureMappingsStep.vue | 8 +++++--- .../components/vm-migration/SelectVmsStep.vue | 11 +++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pkg/harvester/components/vm-migration/ConfigureMappingsStep.vue b/pkg/harvester/components/vm-migration/ConfigureMappingsStep.vue index e703b0ff..1d6a2ecb 100644 --- a/pkg/harvester/components/vm-migration/ConfigureMappingsStep.vue +++ b/pkg/harvester/components/vm-migration/ConfigureMappingsStep.vue @@ -398,11 +398,13 @@ const init = async() => { try { const providerUid = props.provider?.metadata?.uid; const providerType = props.provider?.spec?.type || 'vsphere'; - const baseUrl = `https://forklift-apir.13.48.147.135.sslip.io/providers/${ providerType }/${ providerUid }`; + const baseUrl = store.getters['harvester-common/getHarvesterClusterUrl']( + `v1/harvester/providers/${ providerType }/${ providerUid }` + ); const [networksData, datastoresData] = await Promise.all([ - fetch(`${ baseUrl }/networks`).then((r) => r.json()).catch(() => []), - fetch(`${ baseUrl }/datastores?detail=1`).then((r) => r.json()).catch(() => []), + store.dispatch(`${ inStore }/request`, { url: `${ baseUrl }/networks` }).catch(() => []), + store.dispatch(`${ inStore }/request`, { url: `${ baseUrl }/datastores?detail=1` }).catch(() => []), ]); if (props.useAllProviderData) { diff --git a/pkg/harvester/components/vm-migration/SelectVmsStep.vue b/pkg/harvester/components/vm-migration/SelectVmsStep.vue index 3c4c673d..9e124d96 100644 --- a/pkg/harvester/components/vm-migration/SelectVmsStep.vue +++ b/pkg/harvester/components/vm-migration/SelectVmsStep.vue @@ -279,14 +279,17 @@ const fetchVMs = async() => { return; } + const inStore = store.getters['currentProduct'].inStore; const providerUid = props.provider.metadata.uid; const providerType = props.provider.spec?.type || 'vsphere'; - const baseUrl = `https://forklift-apir.13.48.147.135.sslip.io/providers/${ providerType }/${ providerUid }`; + const baseUrl = store.getters['harvester-common/getHarvesterClusterUrl']( + `v1/harvester/providers/${ providerType }/${ providerUid }` + ); const [vmsResp, networksResp, datastoresResp] = await Promise.all([ - fetch(`${ baseUrl }/vms`).then((r) => r.json()), - fetch(`${ baseUrl }/networks`).then((r) => r.json()).catch(() => []), - fetch(`${ baseUrl }/datastores`).then((r) => r.json()).catch(() => []), + store.dispatch(`${ inStore }/request`, { url: `${ baseUrl }/vms` }), + store.dispatch(`${ inStore }/request`, { url: `${ baseUrl }/networks` }).catch(() => []), + store.dispatch(`${ inStore }/request`, { url: `${ baseUrl }/datastores` }).catch(() => []), ]); if (Array.isArray(vmsResp)) {