handle sr rescan

This commit is contained in:
Olivier Lambert 2014-02-04 21:05:10 +01:00
parent f90c236fa4
commit a9436f9668

View File

@ -24,3 +24,20 @@ exports.set = ->
continue unless param of params
xapi.call "SR.set_#{field}", SR.ref, params[param]
exports.scan = ->
params = @getParams {
id: { type: 'string' }
}
# Current user must be an administrator.
@checkPermission 'admin'
try
SR = @getObject params.id
catch
@throw 'NO_SUCH_OBJECT'
xapi = @getXAPI SR
xapi.call "SR.scan", SR.ref