use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId in project genius by opendaylight.
the class OvsdbSouthboundTestUtil method createTerminationPoint.
public static void createTerminationPoint(DataBroker dataBroker, String interfaceName, Class<? extends InterfaceTypeBase> type, String externalId) throws TransactionCommitFailedException {
final OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName("s2");
final InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier("192.168.56.101", 6640, ovsdbBridgeName);
InstanceIdentifier<TerminationPoint> tpId = createTerminationPointInstanceIdentifier(InstanceIdentifier.keyOf(bridgeIid.firstIdentifierOf(Node.class)), interfaceName);
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
tpBuilder.setKey(InstanceIdentifier.keyOf(tpId));
OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder();
tpAugmentationBuilder.setName(interfaceName);
if (type != null) {
tpAugmentationBuilder.setInterfaceType(type);
}
if (externalId != null) {
List<InterfaceExternalIds> interfaceExternalIds = new ArrayList<>();
InterfaceExternalIds interfaceExternalIds1 = new InterfaceExternalIdsBuilder().setExternalIdKey("iface-id").setExternalIdValue(externalId).build();
interfaceExternalIds.add(interfaceExternalIds1);
tpAugmentationBuilder.setInterfaceExternalIds(interfaceExternalIds);
}
tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
tx.put(OPERATIONAL, tpId, tpBuilder.build(), true);
tx.submit().checkedGet();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId in project genius by opendaylight.
the class HwvtepSouthboundUtils method getTerminationPointKey.
/**
* Gets the termination point key.
*
* @param phyLocator
* the phy locator
* @return the termination point key
*/
public static TerminationPointKey getTerminationPointKey(HwvtepPhysicalLocatorAugmentation phyLocator) {
TerminationPointKey tpKey = null;
if (phyLocator.getEncapsulationType() != null && phyLocator.getDstIp() != null) {
String encapType = HwvtepSouthboundConstants.ENCAPS_TYPE_MAP.get(phyLocator.getEncapsulationType());
String tpKeyStr = encapType + ":" + String.valueOf(phyLocator.getDstIp().getValue());
tpKey = new TerminationPointKey(new TpId(tpKeyStr));
}
return tpKey;
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId in project bgpcep by opendaylight.
the class LinkstateTopologyBuilder method buildLocalTp.
private static TerminationPoint buildLocalTp(final UriBuilder base, final LinkDescriptors linkDescriptors) {
final TpId id = buildLocalTpId(base, linkDescriptors);
final TerminationPointType t = getTpType(linkDescriptors.getIpv4InterfaceAddress(), linkDescriptors.getIpv6InterfaceAddress(), linkDescriptors.getLinkLocalIdentifier());
return buildTp(id, t);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId in project bgpcep by opendaylight.
the class LinkstateTopologyBuilder method buildRemoteTp.
private static TerminationPoint buildRemoteTp(final UriBuilder base, final LinkDescriptors linkDescriptors) {
final TpId id = buildRemoteTpId(base, linkDescriptors);
final TerminationPointType t = getTpType(linkDescriptors.getIpv4NeighborAddress(), linkDescriptors.getIpv6NeighborAddress(), linkDescriptors.getLinkRemoteIdentifier());
return buildTp(id, t);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId in project bgpcep by opendaylight.
the class TunnelProgrammingTest method createNode.
private static Node createNode(final NodeId nodeId, final TpId tpId, final String ipv4Address) {
final TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
tpBuilder.setTpId(tpId);
tpBuilder.setKey(new TerminationPointKey(tpId));
tpBuilder.addAugmentation(TerminationPoint1.class, new TerminationPoint1Builder().setIgpTerminationPointAttributes(new IgpTerminationPointAttributesBuilder().setTerminationPointType(new IpBuilder().setIpAddress(Collections.singletonList(new IpAddress(new Ipv4Address(ipv4Address)))).build()).build()).build());
final NodeBuilder nodeBuilder = new NodeBuilder();
nodeBuilder.setNodeId(nodeId);
nodeBuilder.setKey(new NodeKey(nodeId));
nodeBuilder.setTerminationPoint(Lists.newArrayList(tpBuilder.build()));
final SupportingNode supportingNode = new SupportingNodeBuilder().setKey(new SupportingNodeKey(nodeId, new TopologyId("dummy"))).addAugmentation(SupportingNode1.class, new SupportingNode1Builder().setPathComputationClient(new PathComputationClientBuilder().setControlling(true).build()).build()).build();
nodeBuilder.setSupportingNode(Lists.newArrayList(supportingNode));
return nodeBuilder.build();
}
Aggregations