handle vdi remove
This commit is contained in:
parent
c5a2d6a1eb
commit
f90c236fa4
17
src/api/vdi.coffee
Normal file
17
src/api/vdi.coffee
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
exports.delete = ->
|
||||||
|
params = @getParams {
|
||||||
|
id: { type: 'string' }
|
||||||
|
}
|
||||||
|
|
||||||
|
# Current user must be an administrator.
|
||||||
|
@checkPermission 'admin'
|
||||||
|
|
||||||
|
try
|
||||||
|
VDI = @getObject params.id
|
||||||
|
catch
|
||||||
|
@throw 'NO_SUCH_OBJECT'
|
||||||
|
|
||||||
|
xapi = @getXAPI VDI
|
||||||
|
|
||||||
|
# TODO: check if VDI is attached before
|
||||||
|
xapi.call "VDI.destroy", VDI.ref
|
Loading…
Reference in New Issue
Block a user