@@ -90,47 +90,69 @@ export default {
9090 docHelp : 'adminguide/virtual_machines.html#stopping-and-starting-vms' ,
9191 dataView : true ,
9292 groupAction : true ,
93- args : [ 'id' , ' forced'] ,
93+ args : [ 'forced' ] ,
9494 show : ( record ) => { return [ 'Running' ] . includes ( record . state ) }
9595 } ,
9696 {
9797 api : 'rebootVirtualMachine' ,
9898 icon : 'reload' ,
9999 label : 'label.action.reboot.instance' ,
100100 dataView : true ,
101- args : [ 'id' ] ,
102101 show : ( record ) => { return [ 'Running' ] . includes ( record . state ) }
103102 } ,
104103 {
105104 api : 'restoreVirtualMachine' ,
106105 icon : 'sync' ,
107106 label : 'label.reinstall.vm' ,
108107 dataView : true ,
109- args : [ 'virtualmachineid' , 'templateid' ]
108+ args : [ 'virtualmachineid' , 'templateid' ] ,
109+ mapping : {
110+ virtualmachineid : {
111+ value : ( record ) => { return record . id }
112+ }
113+ }
110114 } ,
111115 {
112116 api : 'createVMSnapshot' ,
113117 icon : 'camera' ,
114118 label : 'Create VM Snapshot' ,
115119 dataView : true ,
116120 args : [ 'virtualmachineid' , 'name' , 'description' , 'snapshotmemory' , 'quiescevm' ] ,
117- show : ( record ) => { return [ 'Running' ] . includes ( record . state ) }
121+ show : ( record ) => { return [ 'Running' ] . includes ( record . state ) } ,
122+ mapping : {
123+ virtualmachineid : {
124+ value : ( record , params ) => { return record . id }
125+ }
126+ }
118127 } ,
119128 {
120129 api : 'attachIso' ,
121130 icon : 'paper-clip' ,
122131 label : 'label.action.attach.iso' ,
123132 dataView : true ,
124133 args : [ 'id' , 'virtualmachineid' ] ,
125- show : ( record ) => { return ! record . isoid }
134+ show : ( record ) => { return ! record . isoid } ,
135+ mapping : {
136+ id : {
137+ api : 'listIsos'
138+ } ,
139+ virtualmachineid : {
140+ value : ( record , params ) => { return record . id }
141+ }
142+ }
126143 } ,
127144 {
128145 api : 'detachIso' ,
129146 icon : 'link' ,
130147 label : 'label.action.detach.iso' ,
131148 dataView : true ,
132- args : [ 'id' , 'virtualmachineid' ] ,
133- show : ( record ) => { return 'isoid' in record && record . isoid }
149+ args : [ 'virtualmachineid' ] ,
150+ show : ( record ) => { return 'isoid' in record && record . isoid } ,
151+ mapping : {
152+ virtualmachineid : {
153+ value : ( record , params ) => { return record . id }
154+ }
155+ }
134156 } ,
135157 {
136158 api : 'migrateVirtualMachine' ,
@@ -158,68 +180,77 @@ export default {
158180 icon : 'swap' ,
159181 label : 'label.change.affinity' ,
160182 dataView : true ,
161- args : [ 'id' , 'serviceofferingid '] ,
183+ args : [ 'affinitygroupids ' ] ,
162184 show : ( record ) => { return [ 'Stopped' ] . includes ( record . state ) }
163185 } ,
164186 {
165187 api : 'scaleVirtualMachine' ,
166188 icon : 'arrows-alt' ,
167189 label : 'Scale VM' ,
168190 dataView : true ,
169- args : [ 'id' , ' serviceofferingid', 'details' ] ,
170- show : ( record ) => { return record . state === 'Stopped' || record . hypervisor === 'VMWare ' }
191+ args : [ 'serviceofferingid' , 'details' ] ,
192+ show : ( record ) => { return record . hypervisor !== 'KVM ' }
171193 } ,
172194 {
173195 api : 'changeServiceForVirtualMachine' ,
174196 icon : 'sliders' ,
175197 label : 'Change Service Offering' ,
176198 dataView : true ,
177- args : [ 'id' , ' serviceofferingid'] ,
199+ args : [ 'serviceofferingid' ] ,
178200 show : ( record ) => { return [ 'Stopped' ] . includes ( record . state ) }
179201 } ,
180202 {
181203 api : 'resetPasswordForVirtualMachine' ,
182204 icon : 'key' ,
183205 label : 'Reset Instance Password' ,
184206 dataView : true ,
185- args : [ 'id' ] ,
186207 show : ( record ) => { return [ 'Stopped' ] . includes ( record . state ) }
187208 } ,
188209 {
189210 api : 'resetSSHKeyForVirtualMachine' ,
190211 icon : 'lock' ,
191212 label : 'Reset SSH Key' ,
192213 dataView : true ,
193- show : ( record ) => { return [ 'Stopped' ] . includes ( record . state ) }
214+ args : [ 'keypair' ] ,
215+ show : ( record ) => { return [ 'Stopped' ] . includes ( record . state ) } ,
216+ mapping : {
217+ keypair : {
218+ api : 'listSSHKeyPairs'
219+ }
220+ }
194221 } ,
195222 {
196223 api : 'assignVirtualMachine' ,
197224 icon : 'user-add' ,
198225 label : 'Assign Instance to Another Account' ,
199226 dataView : true ,
200- show : ( record ) => { return [ 'Stopped' ] . includes ( record . state ) }
227+ show : ( record ) => { return [ 'Stopped' ] . includes ( record . state ) } ,
228+ args : [ 'virtualmachineid' , 'account' , 'domainid' ] ,
229+ mapping : {
230+ virtualmachineid : {
231+ value : ( record , params ) => { return record . id }
232+ }
233+ }
201234 } ,
202235 {
203236 api : 'recoverVirtualMachine' ,
204237 icon : 'medicine-box' ,
205238 label : 'label.recover.vm' ,
206- args : [ 'id' ] ,
207239 dataView : true ,
208240 show : ( record ) => { return [ 'Destroyed' ] . includes ( record . state ) }
209241 } ,
210242 {
211243 api : 'expungeVirtualMachine' ,
212244 icon : 'delete' ,
213245 label : 'label.action.expunge.instance' ,
214- args : [ 'id' ] ,
215246 dataView : true ,
216247 show : ( record ) => { return [ 'Destroyed' ] . includes ( record . state ) }
217248 } ,
218249 {
219250 api : 'destroyVirtualMachine' ,
220251 icon : 'delete' ,
221252 label : 'label.action.destroy.instance' ,
222- args : [ 'id' , ' expunge', 'volumeids' ] ,
253+ args : [ 'expunge' , 'volumeids' ] ,
223254 dataView : true ,
224255 groupAction : true
225256 }
@@ -266,8 +297,7 @@ export default {
266297 api : 'deleteInstanceGroup' ,
267298 icon : 'delete' ,
268299 label : 'Delete Instance Group' ,
269- dataView : true ,
270- args : [ 'id' ]
300+ dataView : true
271301 }
272302 ]
273303 } ,
@@ -304,7 +334,18 @@ export default {
304334 icon : 'delete' ,
305335 label : 'Delete SSH key pair' ,
306336 dataView : true ,
307- args : [ 'name' , 'account' , 'domainid' ]
337+ args : [ 'name' , 'account' , 'domainid' ] ,
338+ mapping : {
339+ name : {
340+ value : ( record , params ) => { return record . name }
341+ } ,
342+ account : {
343+ value : ( record , params ) => { return record . account }
344+ } ,
345+ domainid : {
346+ value : ( record , params ) => { return record . domainid }
347+ }
348+ }
308349 }
309350 ]
310351 } ,
@@ -327,14 +368,18 @@ export default {
327368 icon : 'plus' ,
328369 label : 'New Affinity Group' ,
329370 listView : true ,
330- args : [ 'name' , 'description' , 'type' ]
371+ args : [ 'name' , 'description' , 'type' ] ,
372+ mapping : {
373+ type : {
374+ options : [ 'host anti-affinity' , 'host affinity' ]
375+ }
376+ }
331377 } ,
332378 {
333379 api : 'deleteAffinityGroup' ,
334380 icon : 'delete' ,
335381 label : 'Delete Affinity Group' ,
336- dataView : true ,
337- args : [ 'id' ]
382+ dataView : true
338383 }
339384 ]
340385 }
0 commit comments