You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2020/10/30 11:29:23 UTC
[cloudstack-primate] branch master updated: Use scaleVirtualMachine
API instead of changeServiceForVirtualMachine (#818)
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git
The following commit(s) were added to refs/heads/master by this push:
new 77a59f6 Use scaleVirtualMachine API instead of changeServiceForVirtualMachine (#818)
77a59f6 is described below
commit 77a59f6f2d5b4c77928e7b42ed60c677b4f6f54a
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Fri Oct 30 16:59:13 2020 +0530
Use scaleVirtualMachine API instead of changeServiceForVirtualMachine (#818)
Co-authored-by: Pearl Dsilva <pe...@shapeblue.com>
---
src/views/compute/ScaleVM.vue | 31 ++++++++++++-------------------
1 file changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/views/compute/ScaleVM.vue b/src/views/compute/ScaleVM.vue
index 6171c1f..125e753 100644
--- a/src/views/compute/ScaleVM.vue
+++ b/src/views/compute/ScaleVM.vue
@@ -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()