Skip to content
This repository was archived by the owner on Jan 20, 2021. It is now read-only.

Commit 77a59f6

Browse files
Pearl1594Pearl Dsilva
andauthored
Use scaleVirtualMachine API instead of changeServiceForVirtualMachine (#818)
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
1 parent 1a15d1e commit 77a59f6

1 file changed

Lines changed: 12 additions & 19 deletions

File tree

src/views/compute/ScaleVM.vue

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -153,29 +153,22 @@ export default {
153153
handleSubmit () {
154154
this.loading = true
155155
156-
const apiName = this.resource.state === 'Stopped' ? 'changeServiceForVirtualMachine' : 'scaleVirtualMachine'
157156
if ('cpuspeed' in this.selectedOffering && this.selectedOffering.iscustomized) {
158157
delete this.params[this.cpuSpeedKey]
159158
}
160159
161-
api(apiName, this.params).then(response => {
162-
if (apiName === 'scaleVirtualMachine') {
163-
const jobId = response.scalevirtualmachineresponse.jobid
164-
if (jobId) {
165-
this.$pollJob({
166-
jobId,
167-
successMethod: result => {
168-
this.$notification.success({
169-
message: this.$t('message.success.change.offering')
170-
})
171-
},
172-
loadingMessage: this.$t('message.scale.processing'),
173-
catchMessage: this.$t('error.fetching.async.job.result')
174-
})
175-
}
176-
} else {
177-
this.$notification.success({
178-
message: this.$t('message.success.change.offering')
160+
api('scaleVirtualMachine', this.params).then(response => {
161+
const jobId = response.scalevirtualmachineresponse.jobid
162+
if (jobId) {
163+
this.$pollJob({
164+
jobId,
165+
successMethod: result => {
166+
this.$notification.success({
167+
message: this.$t('message.success.change.offering')
168+
})
169+
},
170+
loadingMessage: this.$t('message.scale.processing'),
171+
catchMessage: this.$t('error.fetching.async.job.result')
179172
})
180173
}
181174
this.$parent.$parent.close()

0 commit comments

Comments
 (0)