feat(vif.set): allowed IPv4/IPv6 addresses (#328)
This commit is contained in:
parent
a797edfae9
commit
1127ec3a90
@ -41,3 +41,31 @@ connect.params = {
|
|||||||
connect.resolve = {
|
connect.resolve = {
|
||||||
vif: ['id', 'VIF', 'operate']
|
vif: ['id', 'VIF', 'operate']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
|
||||||
|
export const set = ({ vif, allowedIpv4Addresses, allowedIpv6Addresses }) => (
|
||||||
|
this.getXapi(vif._xapiId).editVif({
|
||||||
|
ipv4Allowed: allowedIpv4Addresses,
|
||||||
|
ipv6Allowed: allowedIpv6Addresses
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
set.params = {
|
||||||
|
allowedIpv4Addresses: {
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
allowedIpv6Addresses: {
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set.resolve = {
|
||||||
|
vif: ['id', 'VIF', 'operate']
|
||||||
|
}
|
||||||
|
@ -464,6 +464,8 @@ const TRANSFORMS = {
|
|||||||
return {
|
return {
|
||||||
type: 'VIF',
|
type: 'VIF',
|
||||||
|
|
||||||
|
allowedIpv4Addresses: obj.ipv4_allowed,
|
||||||
|
allowedIpv6Addresses: obj.ipv6_allowed,
|
||||||
attached: Boolean(obj.currently_attached),
|
attached: Boolean(obj.currently_attached),
|
||||||
device: obj.device, // TODO: should it be cast to a number?
|
device: obj.device, // TODO: should it be cast to a number?
|
||||||
MAC: obj.MAC,
|
MAC: obj.MAC,
|
||||||
|
10
src/xapi/mixins/networking.js
Normal file
10
src/xapi/mixins/networking.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import {
|
||||||
|
makeEditObject
|
||||||
|
} from '../utils'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
editVif: makeEditObject({
|
||||||
|
ipv4Allowed: true,
|
||||||
|
ipv6Allowed: true
|
||||||
|
})
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user