network.create instead of createNetwork for host and pool
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<<<<<<< 91431201771f54434ebda173c26bda1c3df405d4
|
||||
export async function create ({ pool, name, description, pif, mtu = 1500, vlan = 0 }) {
|
||||
return this.getXapi(pool).createNetwork({
|
||||
name,
|
||||
@@ -6,6 +7,20 @@ export async function create ({ pool, name, description, pif, mtu = 1500, vlan =
|
||||
mtu: +mtu,
|
||||
vlan: +vlan
|
||||
})
|
||||
=======
|
||||
export async function create ({ pool, name, description, pif, mtu, vlan }) {
|
||||
if (pif) {
|
||||
pif = this.getObject(pif, 'PIF')
|
||||
}
|
||||
const params = {
|
||||
name,
|
||||
description,
|
||||
pif: pif && pif._xapiRef,
|
||||
mtu: mtu || '1500',
|
||||
vlan: vlan || '0'
|
||||
}
|
||||
return this.getXapi(pool).createNetwork(params)
|
||||
>>>>>>> `network.create` instead of `createNetwork` for host and pool
|
||||
}
|
||||
|
||||
create.params = {
|
||||
@@ -13,11 +28,20 @@ create.params = {
|
||||
name: { type: 'string' },
|
||||
description: { type: 'string', optional: true },
|
||||
pif: { type: 'string', optional: true },
|
||||
<<<<<<< 91431201771f54434ebda173c26bda1c3df405d4
|
||||
mtu: { type: ['integer', 'string'], optional: true },
|
||||
vlan: { type: ['integer', 'string'], optional: true }
|
||||
=======
|
||||
mtu: { type: 'string', optional: true },
|
||||
vlan: { type: 'string', optional: true }
|
||||
>>>>>>> `network.create` instead of `createNetwork` for host and pool
|
||||
}
|
||||
|
||||
create.resolve = {
|
||||
pool: ['pool', 'pool', 'administrate']
|
||||
}
|
||||
create.permission = 'admin'
|
||||
<<<<<<< 91431201771f54434ebda173c26bda1c3df405d4
|
||||
=======
|
||||
exports.create = create
|
||||
>>>>>>> `network.create` instead of `createNetwork` for host and pool
|
||||
|
||||
Reference in New Issue
Block a user