mirror of https://github.com/apache/cloudstack.git
Use scaleVirtualMachine API instead of changeServiceForVirtualMachine (#818)
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com> Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
53bf04a19e
commit
2189ebb4ca
|
|
@ -153,29 +153,22 @@ export default {
|
|||
handleSubmit () {
|
||||
this.loading = true
|
||||
|
||||
const apiName = this.resource.state === 'Stopped' ? 'changeServiceForVirtualMachine' : 'scaleVirtualMachine'
|
||||
if ('cpuspeed' in this.selectedOffering && this.selectedOffering.iscustomized) {
|
||||
delete this.params[this.cpuSpeedKey]
|
||||
}
|
||||
|
||||
api(apiName, this.params).then(response => {
|
||||
if (apiName === 'scaleVirtualMachine') {
|
||||
const jobId = response.scalevirtualmachineresponse.jobid
|
||||
if (jobId) {
|
||||
this.$pollJob({
|
||||
jobId,
|
||||
successMethod: result => {
|
||||
this.$notification.success({
|
||||
message: this.$t('message.success.change.offering')
|
||||
})
|
||||
},
|
||||
loadingMessage: this.$t('message.scale.processing'),
|
||||
catchMessage: this.$t('error.fetching.async.job.result')
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$notification.success({
|
||||
message: this.$t('message.success.change.offering')
|
||||
api('scaleVirtualMachine', this.params).then(response => {
|
||||
const jobId = response.scalevirtualmachineresponse.jobid
|
||||
if (jobId) {
|
||||
this.$pollJob({
|
||||
jobId,
|
||||
successMethod: result => {
|
||||
this.$notification.success({
|
||||
message: this.$t('message.success.change.offering')
|
||||
})
|
||||
},
|
||||
loadingMessage: this.$t('message.scale.processing'),
|
||||
catchMessage: this.$t('error.fetching.async.job.result')
|
||||
})
|
||||
}
|
||||
this.$parent.$parent.close()
|
||||
|
|
|
|||
Loading…
Reference in New Issue