use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project genius by opendaylight.
the class SouthboundUtils method createTerminationPointInstanceIdentifier.
public static InstanceIdentifier<TerminationPoint> createTerminationPointInstanceIdentifier(NodeKey nodekey, String portName) {
InstanceIdentifier<TerminationPoint> terminationPointPath = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(IfmConstants.OVSDB_TOPOLOGY_ID)).child(Node.class, nodekey).child(TerminationPoint.class, new TerminationPointKey(new TpId(portName)));
LOG.debug("Termination point InstanceIdentifier generated : {}", terminationPointPath);
return terminationPointPath;
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project genius by opendaylight.
the class SouthboundUtils method createGlobalNodeInstanceIdentifier.
@Nullable
public static InstanceIdentifier<Node> createGlobalNodeInstanceIdentifier(String psNodeIdString) {
String globalNodeIdStr;
try {
globalNodeIdStr = psNodeIdString.substring(0, psNodeIdString.indexOf(PS_NODE_ID_PREFIX));
} catch (StringIndexOutOfBoundsException ex) {
LOG.error("cannot determine global-node-id for the physical node {}", psNodeIdString);
return null;
}
NodeId globalNodeId = new NodeId(globalNodeIdStr);
InstanceIdentifier<Node> globalNodeInstanceId = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(HWVTEP_TOPOLOGY_ID)).child(Node.class, new NodeKey(globalNodeId));
return globalNodeInstanceId;
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project genius by opendaylight.
the class SouthboundUtils method createTunnelsInstanceIdentifier.
public static InstanceIdentifier<Tunnels> createTunnelsInstanceIdentifier(InstanceIdentifier<Node> nodeId, IpAddress localIP, IpAddress remoteIp) {
InstanceIdentifier<TerminationPoint> localTEPInstanceIdentifier = createTEPInstanceIdentifier(nodeId, localIP);
InstanceIdentifier<TerminationPoint> remoteTEPInstanceIdentifier = createTEPInstanceIdentifier(nodeId, remoteIp);
TunnelsKey tunnelsKey = new TunnelsKey(new HwvtepPhysicalLocatorRef(localTEPInstanceIdentifier), new HwvtepPhysicalLocatorRef(remoteTEPInstanceIdentifier));
return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(HWVTEP_TOPOLOGY_ID)).child(Node.class, new NodeKey(nodeId.firstKeyOf(Node.class))).augmentation(PhysicalSwitchAugmentation.class).child(Tunnels.class, tunnelsKey).build();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project genius by opendaylight.
the class HwvtepHACacheTest method newNodeInstanceIdentifier.
public static InstanceIdentifier<Node> newNodeInstanceIdentifier(String id) {
String nodeString = "hwvtep://uuid/" + java.util.UUID.nameUUIDFromBytes(id.getBytes()).toString();
NodeId nodeId = new NodeId(new Uri(nodeString));
NodeKey nodeKey = new NodeKey(nodeId);
TopologyKey topoKey = new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID);
return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topoKey).child(Node.class, nodeKey).build();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey in project bgpcep by opendaylight.
the class NetworkTopologyConfigFileProcessorTest method configFileTest.
@Test
public void configFileTest() throws ReadFailedException, InterruptedException {
final KeyedInstanceIdentifier<Topology, TopologyKey> topologyIIdKeyed = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(new TopologyId("topology-test")));
checkNotPresentConfiguration(getDataBroker(), topologyIIdKeyed);
assertNotNull(ClassLoader.getSystemClassLoader().getResource("initial/network-topology-config.xml"));
final NetworkTopologyConfigFileProcessor processor = new NetworkTopologyConfigFileProcessor(this.configLoader, getDataBroker());
processor.init();
checkPresentConfiguration(getDataBroker(), topologyIIdKeyed);
assertEquals(SchemaPath.create(true, NetworkTopology.QNAME), processor.getSchemaPath());
processor.close();
}
Aggregations