use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder in project netvirt by opendaylight.
the class TestBuilders method buildTerminationPoint.
public static TerminationPoint buildTerminationPoint(InstanceIdentifier<Node> nodeIid, String ip) {
TerminationPointKey tpKey = new TerminationPointKey(new TpId("vxlan_over_ipv4:" + ip));
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
if (nodeIid != null && tpKey != null) {
tpBuilder.setKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
InstanceIdentifier<TerminationPoint> tpPath = buildTpId(nodeIid, ip);
HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder = new HwvtepPhysicalLocatorAugmentationBuilder();
tpAugmentationBuilder.setPhysicalLocatorUuid(getUUid(ip));
tpAugmentationBuilder.setEncapsulationType(createEncapsulationType("vxlan_over_ipv4"));
tpAugmentationBuilder.setDstIp(new IpAddress(ip.toCharArray()));
tpBuilder.addAugmentation(HwvtepPhysicalLocatorAugmentation.class, tpAugmentationBuilder.build());
}
return tpBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder in project genius by opendaylight.
the class HwvtepSouthboundUtils method createHwvtepPhysicalLocatorAugmentation.
/**
* Create hwvtep physical locator augmentation.
*
* @param ipAddress
* the ip address
* @return the hwvtep physical locator augmentation
*/
public static HwvtepPhysicalLocatorAugmentation createHwvtepPhysicalLocatorAugmentation(String ipAddress) {
// FIXME: Get encapsulation type dynamically
Class<? extends EncapsulationTypeBase> encapTypeClass = createEncapsulationType(StringUtils.EMPTY);
HwvtepPhysicalLocatorAugmentationBuilder phyLocBuilder = new HwvtepPhysicalLocatorAugmentationBuilder().setEncapsulationType(encapTypeClass).setDstIp(new IpAddress(ipAddress.toCharArray()));
return phyLocBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder in project genius by opendaylight.
the class HwVTEPInterfaceConfigAddHelper method createPhysicalLocatorEntry.
/*
* This method writes the termination end point details to the topology
* Config DS
*/
private static void createPhysicalLocatorEntry(WriteTransaction transaction, InstanceIdentifier<TerminationPoint> tpPath, TerminationPointKey terminationPointKey, IpAddress destIPAddress) {
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder = new HwvtepPhysicalLocatorAugmentationBuilder();
tpBuilder.setKey(terminationPointKey);
tpBuilder.setTpId(terminationPointKey.getTpId());
tpAugmentationBuilder.setEncapsulationType(EncapsulationTypeVxlanOverIpv4.class);
SouthboundUtils.setDstIp(tpAugmentationBuilder, destIPAddress);
tpBuilder.addAugmentation(HwvtepPhysicalLocatorAugmentation.class, tpAugmentationBuilder.build());
LOG.debug("creating physical locator entry for {}", terminationPointKey);
transaction.put(LogicalDatastoreType.CONFIGURATION, tpPath, tpBuilder.build(), true);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder in project genius by opendaylight.
the class SouthboundUtils method setDstIp.
public static void setDstIp(HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder, IpAddress ipAddress) {
IpAddress ip = new IpAddress(ipAddress);
tpAugmentationBuilder.setDstIp(ip);
}
Aggregations