Search in sources :

Example 1 with VlanBindingsKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsKey in project netvirt by opendaylight.

the class PhysicalSwitchHelper method createVlanBinding.

public static VlanBindings createVlanBinding(Long key, String logicalSwitch) {
    VlanBindingsBuilder vbBuilder = new VlanBindingsBuilder();
    VlanBindingsKey vbKey = new VlanBindingsKey(new VlanId(key.intValue()));
    vbBuilder.setKey(vbKey);
    vbBuilder.setVlanIdKey(vbKey.getVlanIdKey());
    HwvtepLogicalSwitchRef hwvtepLogicalSwitchRef = new HwvtepLogicalSwitchRef(createInstanceIdentifier(logicalSwitch));
    vbBuilder.setLogicalSwitchRef(hwvtepLogicalSwitchRef);
    return vbBuilder.build();
}
Also used : VlanBindingsKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsKey) HwvtepLogicalSwitchRef(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchRef) VlanId(org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId) VlanBindingsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsBuilder)

Example 2 with VlanBindingsKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsKey in project genius by opendaylight.

the class HwvtepSouthboundUtils method createVlanBinding.

/**
 * Create vlan binding.
 *
 * @param nodeId
 *            the node id
 * @param vlanId
 *            the vlan id
 * @param logicalSwitchName
 *            the logical switch name
 * @return the vlan bindings
 */
public static VlanBindings createVlanBinding(NodeId nodeId, int vlanId, String logicalSwitchName) {
    VlanBindingsBuilder vbBuilder = new VlanBindingsBuilder();
    VlanBindingsKey vbKey = new VlanBindingsKey(new VlanId(vlanId));
    vbBuilder.setKey(vbKey);
    vbBuilder.setVlanIdKey(vbKey.getVlanIdKey());
    final InstanceIdentifier<LogicalSwitches> lSwitchIid = createLogicalSwitchesInstanceIdentifier(nodeId, new HwvtepNodeName(logicalSwitchName));
    HwvtepLogicalSwitchRef lsRef = new HwvtepLogicalSwitchRef(lSwitchIid);
    vbBuilder.setLogicalSwitchRef(lsRef);
    return vbBuilder.build();
}
Also used : LogicalSwitches(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches) VlanBindingsKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsKey) HwvtepLogicalSwitchRef(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchRef) HwvtepNodeName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName) VlanId(org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId) VlanBindingsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsBuilder)

Aggregations

VlanId (org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId)2 HwvtepLogicalSwitchRef (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchRef)2 VlanBindingsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsBuilder)2 VlanBindingsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsKey)2 HwvtepNodeName (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName)1 LogicalSwitches (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches)1