use of org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.vpn._interface.VpnInstanceNamesKey in project netvirt by opendaylight.
the class CoeUtils method createVpnInterface.
public static void createVpnInterface(String vpnName, Pods pod, String interfaceName, String macAddress, boolean isRouterInterface, WriteTransaction wrtConfigTxn) {
LOG.trace("createVpnInterface for Port: {}, isRouterInterface: {}", interfaceName, isRouterInterface);
List<VpnInstanceNames> listVpn = new ArrayList<>();
listVpn.add(new VpnInstanceNamesBuilder().setKey(new VpnInstanceNamesKey(vpnName)).setVpnName(vpnName).setAssociatedSubnetType(VpnInstanceNames.AssociatedSubnetType.V4Subnet).build());
VpnInterfaceBuilder vpnb = new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(interfaceName)).setName(interfaceName).setVpnInstanceNames(listVpn).setRouterInterface(isRouterInterface);
Adjacencies adjs = createPortIpAdjacencies(pod, interfaceName, macAddress, isRouterInterface);
if (adjs != null) {
vpnb.addAugmentation(Adjacencies.class, adjs);
}
VpnInterface vpnIf = vpnb.build();
LOG.info("Creating vpn interface {}", vpnIf);
InstanceIdentifier<VpnInterface> vpnIfIdentifier = buildVpnInterfaceIdentifier(interfaceName);
wrtConfigTxn.put(LogicalDatastoreType.CONFIGURATION, vpnIfIdentifier, vpnIf);
}
Aggregations