Skip to content

Commit 1c0cb19

Browse files
committed
storage: fix migrate volume API usage and update apis.remaining
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent edeb25d commit 1c0cb19

2 files changed

Lines changed: 28 additions & 31 deletions

File tree

ui/docs/api/apis.remaining

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
1-
addResourceDetail
21
createLBHealthCheckPolicy
3-
createManagementNetworkIpRange
4-
createNetworkACL
5-
createSnapshotFromVMSnapshot
6-
createStorageNetworkIpRange
7-
createVlanIpRange
8-
dedicatePublicIpRange
92
deleteLBHealthCheckPolicy
10-
deleteManagementNetworkIpRange
11-
deleteNetworkACL
12-
deleteStorageNetworkIpRange
13-
deleteVlanIpRange
14-
findStoragePoolsForMigration
153
listDeploymentPlanners
164
listHostTags
175
listInternalLoadBalancerVMs
186
listLBHealthCheckPolicies
19-
listStorageNetworkIpRange
207
listStorageProviders
218
listStorageTags
22-
listVlanIpRanges
23-
moveNetworkAclItem
24-
releasePublicIpRange
259
startInternalLoadBalancerVM
2610
stopInternalLoadBalancerVM
27-
updateNetworkACLItem

ui/src/views/storage/MigrateVolume.vue

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<p class="modal-form__label">{{ $t('storagePool') }}</p>
2323
<a-select v-model="selectedStoragePool" style="width: 100%;">
2424
<a-select-option v-for="(storagePool, index) in storagePools" :value="storagePool.id" :key="index">
25-
{{ storagePool.name }}
25+
{{ storagePool.name }} <span v-if="resource.virtualmachineid">{{ storagePool.suitableformigration ? '(Suitable)' : '(Not Suitable)'}}</span>
2626
</a-select-option>
2727
</a-select>
2828
<template v-if="this.resource.virtualmachineid">
@@ -78,24 +78,39 @@ export default {
7878
selectedDiskOffering: null
7979
}
8080
},
81-
created () {
81+
mounted () {
8282
this.fetchStoragePools()
8383
this.resource.virtualmachineid && this.fetchDiskOfferings()
8484
},
8585
methods: {
8686
fetchStoragePools () {
87-
api('listStoragePools', {
88-
zoneid: this.resource.zoneid
89-
}).then(response => {
90-
this.storagePools = response.liststoragepoolsresponse.storagepool
91-
this.selectedStoragePool = this.storagePools[0].id
92-
}).catch(error => {
93-
this.$notification.error({
94-
message: `Error ${error.response.status}`,
95-
description: error.response.data.errorresponse.errortext
87+
if (this.resource.virtualmachineid) {
88+
api('findStoragePoolsForMigration', {
89+
id: this.resource.id
90+
}).then(response => {
91+
this.storagePools = response.findstoragepoolsformigrationresponse.storagepool || []
92+
this.selectedStoragePool = this.storagePools[0].id || ''
93+
}).catch(error => {
94+
this.$notification.error({
95+
message: `Error ${error.response.status}`,
96+
description: error.response.data.errorresponse.errortext
97+
})
98+
this.closeModal()
9699
})
97-
this.closeModal()
98-
})
100+
} else {
101+
api('listStoragePools', {
102+
zoneid: this.resource.zoneid
103+
}).then(response => {
104+
this.storagePools = response.liststoragepoolsresponse.storagepool || []
105+
this.selectedStoragePool = this.storagePools[0].id || ''
106+
}).catch(error => {
107+
this.$notification.error({
108+
message: `Error ${error.response.status}`,
109+
description: error.response.data.errorresponse.errortext
110+
})
111+
this.closeModal()
112+
})
113+
}
99114
},
100115
fetchDiskOfferings () {
101116
api('listDiskOfferings', {
@@ -180,7 +195,6 @@ export default {
180195
margin-top: -20px;
181196
182197
&__label {
183-
font-weight: bold;
184198
margin-top: 10px;
185199
margin-bottom: 5px;
186200
}

0 commit comments

Comments
 (0)