Search in sources :

Example 1 with HwvtepPhysicalLocatorAugmentationBuilder

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();
}
Also used : TpId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId) HwvtepPhysicalLocatorAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder) TerminationPointKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) TerminationPointBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder) TerminationPoint(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint)

Example 2 with HwvtepPhysicalLocatorAugmentationBuilder

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();
}
Also used : HwvtepPhysicalLocatorAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Example 3 with HwvtepPhysicalLocatorAugmentationBuilder

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);
}
Also used : HwvtepPhysicalLocatorAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder) TerminationPointBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder)

Example 4 with HwvtepPhysicalLocatorAugmentationBuilder

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);
}
Also used : IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Aggregations

IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)3 HwvtepPhysicalLocatorAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder)3 TerminationPointBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder)2 TpId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId)1 TerminationPoint (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint)1 TerminationPointKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey)1