storage: fix migrate volume API usage and update apis.remaining

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2020-02-08 17:41:03 +05:30
parent edeb25dfbc
commit 1c0cb19f64
2 changed files with 28 additions and 31 deletions

View File

@ -1,27 +1,10 @@
addResourceDetail
createLBHealthCheckPolicy createLBHealthCheckPolicy
createManagementNetworkIpRange
createNetworkACL
createSnapshotFromVMSnapshot
createStorageNetworkIpRange
createVlanIpRange
dedicatePublicIpRange
deleteLBHealthCheckPolicy deleteLBHealthCheckPolicy
deleteManagementNetworkIpRange
deleteNetworkACL
deleteStorageNetworkIpRange
deleteVlanIpRange
findStoragePoolsForMigration
listDeploymentPlanners listDeploymentPlanners
listHostTags listHostTags
listInternalLoadBalancerVMs listInternalLoadBalancerVMs
listLBHealthCheckPolicies listLBHealthCheckPolicies
listStorageNetworkIpRange
listStorageProviders listStorageProviders
listStorageTags listStorageTags
listVlanIpRanges
moveNetworkAclItem
releasePublicIpRange
startInternalLoadBalancerVM startInternalLoadBalancerVM
stopInternalLoadBalancerVM stopInternalLoadBalancerVM
updateNetworkACLItem

View File

@ -22,7 +22,7 @@
<p class="modal-form__label">{{ $t('storagePool') }}</p> <p class="modal-form__label">{{ $t('storagePool') }}</p>
<a-select v-model="selectedStoragePool" style="width: 100%;"> <a-select v-model="selectedStoragePool" style="width: 100%;">
<a-select-option v-for="(storagePool, index) in storagePools" :value="storagePool.id" :key="index"> <a-select-option v-for="(storagePool, index) in storagePools" :value="storagePool.id" :key="index">
{{ storagePool.name }} {{ storagePool.name }} <span v-if="resource.virtualmachineid">{{ storagePool.suitableformigration ? '(Suitable)' : '(Not Suitable)'}}</span>
</a-select-option> </a-select-option>
</a-select> </a-select>
<template v-if="this.resource.virtualmachineid"> <template v-if="this.resource.virtualmachineid">
@ -78,17 +78,18 @@ export default {
selectedDiskOffering: null selectedDiskOffering: null
} }
}, },
created () { mounted () {
this.fetchStoragePools() this.fetchStoragePools()
this.resource.virtualmachineid && this.fetchDiskOfferings() this.resource.virtualmachineid && this.fetchDiskOfferings()
}, },
methods: { methods: {
fetchStoragePools () { fetchStoragePools () {
api('listStoragePools', { if (this.resource.virtualmachineid) {
zoneid: this.resource.zoneid api('findStoragePoolsForMigration', {
id: this.resource.id
}).then(response => { }).then(response => {
this.storagePools = response.liststoragepoolsresponse.storagepool this.storagePools = response.findstoragepoolsformigrationresponse.storagepool || []
this.selectedStoragePool = this.storagePools[0].id this.selectedStoragePool = this.storagePools[0].id || ''
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notification.error({
message: `Error ${error.response.status}`, message: `Error ${error.response.status}`,
@ -96,6 +97,20 @@ export default {
}) })
this.closeModal() this.closeModal()
}) })
} else {
api('listStoragePools', {
zoneid: this.resource.zoneid
}).then(response => {
this.storagePools = response.liststoragepoolsresponse.storagepool || []
this.selectedStoragePool = this.storagePools[0].id || ''
}).catch(error => {
this.$notification.error({
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal()
})
}
}, },
fetchDiskOfferings () { fetchDiskOfferings () {
api('listDiskOfferings', { api('listDiskOfferings', {
@ -180,7 +195,6 @@ export default {
margin-top: -20px; margin-top: -20px;
&__label { &__label {
font-weight: bold;
margin-top: 10px; margin-top: 10px;
margin-bottom: 5px; margin-bottom: 5px;
} }