feat(network): add defaultIsLocked to API (#385)
This commit is contained in:
parent
63c676ebfe
commit
7d1f9e33fe
@ -31,11 +31,13 @@ export async function set ({
|
||||
|
||||
name_description: nameDescription,
|
||||
name_label: nameLabel,
|
||||
defaultIsLocked,
|
||||
id
|
||||
}) {
|
||||
await this.getXapi(network).setNetworkProperties(network._xapiId, {
|
||||
nameDescription,
|
||||
nameLabel
|
||||
nameLabel,
|
||||
defaultIsLocked
|
||||
})
|
||||
}
|
||||
|
||||
@ -50,6 +52,10 @@ set.params = {
|
||||
name_description: {
|
||||
type: 'string',
|
||||
optional: true
|
||||
},
|
||||
defaultIsLocked: {
|
||||
type: 'boolean',
|
||||
optional: true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -483,6 +483,7 @@ const TRANSFORMS = {
|
||||
network (obj) {
|
||||
return {
|
||||
bridge: obj.bridge,
|
||||
defaultIsLocked: obj.default_locking_mode === 'disabled',
|
||||
MTU: +obj.MTU,
|
||||
name_description: obj.name_description,
|
||||
name_label: obj.name_label,
|
||||
|
@ -384,11 +384,17 @@ export default class Xapi extends XapiBase {
|
||||
|
||||
async setNetworkProperties (id, {
|
||||
nameLabel,
|
||||
nameDescription
|
||||
nameDescription,
|
||||
defaultIsLocked
|
||||
}) {
|
||||
let defaultLockingMode
|
||||
if (defaultIsLocked != null) {
|
||||
defaultLockingMode = defaultIsLocked ? 'disabled' : 'unlocked'
|
||||
}
|
||||
await this._setObjectProperties(this.getObject(id), {
|
||||
nameLabel,
|
||||
nameDescription
|
||||
nameDescription,
|
||||
defaultLockingMode
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user