Pool basic edition.
This commit is contained in:
@@ -27,6 +27,3 @@ exports.set = ->
|
||||
continue unless param of params
|
||||
|
||||
xapi.call "host.set_#{field}", host.ref, params[param]
|
||||
|
||||
|
||||
|
||||
|
||||
26
src/api/pool.coffee
Normal file
26
src/api/pool.coffee
Normal file
@@ -0,0 +1,26 @@
|
||||
exports.set = ->
|
||||
params = @getParams {
|
||||
id: { type: 'string' }
|
||||
|
||||
name_label: { type: 'string', optional: true }
|
||||
|
||||
name_description: { type: 'string', optional: true }
|
||||
}
|
||||
|
||||
# Current user must be an administrator.
|
||||
@checkPermission 'admin'
|
||||
|
||||
try
|
||||
pool = @getObject params.id
|
||||
catch
|
||||
@throw 'NO_SUCH_OBJECT'
|
||||
|
||||
xapi = @getXAPI pool
|
||||
|
||||
for param, field of {
|
||||
'name_label'
|
||||
'name_description'
|
||||
}
|
||||
continue unless param of params
|
||||
|
||||
xapi.call "pool.set_#{field}", pool.ref, params[param]
|
||||
@@ -24,6 +24,3 @@ exports.set = ->
|
||||
continue unless param of params
|
||||
|
||||
xapi.call "SR.set_#{field}", SR.ref, params[param]
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user