feat(network): add network.set method
This commit is contained in:
parent
33702c09a6
commit
8ed2e51dde
@ -24,6 +24,41 @@ create.permission = 'admin'
|
|||||||
|
|
||||||
// =================================================================
|
// =================================================================
|
||||||
|
|
||||||
|
// ===================================================================
|
||||||
|
|
||||||
|
export async function set ({
|
||||||
|
network,
|
||||||
|
|
||||||
|
name_description: nameDescription,
|
||||||
|
name_label: nameLabel,
|
||||||
|
id
|
||||||
|
}) {
|
||||||
|
await this.getXapi(network).setNetworkProperties(network._xapiId, {
|
||||||
|
nameDescription,
|
||||||
|
nameLabel
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
set.params = {
|
||||||
|
id: {
|
||||||
|
type: 'string'
|
||||||
|
},
|
||||||
|
name_label: {
|
||||||
|
type: 'string',
|
||||||
|
optional: true
|
||||||
|
},
|
||||||
|
name_description: {
|
||||||
|
type: 'string',
|
||||||
|
optional: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set.resolve = {
|
||||||
|
network: ['id', 'network', 'administrate']
|
||||||
|
}
|
||||||
|
|
||||||
|
// =================================================================
|
||||||
|
|
||||||
export async function delete_ ({ network }) {
|
export async function delete_ ({ network }) {
|
||||||
return this.getXapi(network).deleteNetwork(network._xapiId)
|
return this.getXapi(network).deleteNetwork(network._xapiId)
|
||||||
}
|
}
|
||||||
|
@ -379,6 +379,16 @@ export default class Xapi extends XapiBase {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async setNetworkProperties (id, {
|
||||||
|
nameLabel,
|
||||||
|
nameDescription
|
||||||
|
}) {
|
||||||
|
await this._setObjectProperties(this.getObject(id), {
|
||||||
|
nameLabel,
|
||||||
|
nameDescription
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// =================================================================
|
// =================================================================
|
||||||
|
|
||||||
async addTag (id, tag) {
|
async addTag (id, tag) {
|
||||||
|
Loading…
Reference in New Issue
Block a user