use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project bgpcep by opendaylight.
the class PCEPTopologyDeployerImpl method removeTopologyProvider.
private synchronized void removeTopologyProvider(final Topology topology) {
if (!filterPcepTopologies(topology.getTopologyTypes())) {
return;
}
final TopologyId topologyId = topology.getTopologyId();
closeTopology(this.pcepTopologyServices.remove(topologyId), topologyId);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project bgpcep by opendaylight.
the class PcepStateUtils method displayNodeState.
/**
* Display to stream operational state, rib Id is mandatory.
*
* @param dataBroker data broker
* @param stream where to print
* @param topologyId mandatory, Topology where Node pertains
* @param nodeId mandatory, State per given Node Id will be printed
*/
public static void displayNodeState(@NonNull final DataBroker dataBroker, @NonNull final PrintStream stream, @NonNull final String topologyId, @NonNull final String nodeId) {
final Node node = readNodeFromDataStore(dataBroker, topologyId, nodeId);
if (node == null) {
stream.println(String.format("Node [%s] not found", nodeId));
return;
}
final PcepTopologyNodeStatsAug state = node.getAugmentation(PcepTopologyNodeStatsAug.class);
if (state == null) {
stream.println(String.format("State not found for [%s]", nodeId));
return;
}
final PcepSessionState nodeState = state.getPcepSessionState();
displayNodeState(topologyId, nodeId, nodeState, stream);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project netvirt by opendaylight.
the class NodeConnectedHandlerTest method getInstanceIdentifier.
public static InstanceIdentifier<Node> getInstanceIdentifier(String haUUidVal) {
String nodeString = "hwvtep://uuid/" + UUID.nameUUIDFromBytes(haUUidVal.getBytes()).toString();
NodeId nodeId = new NodeId(new Uri(nodeString));
NodeKey nodeKey = new NodeKey(nodeId);
TopologyKey topoKey = new TopologyKey(new TopologyId(new Uri("hwvtep:1")));
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.TopologyId in project netvirt by opendaylight.
the class NodeConnectedHandlerTest method createInstanceIdentifier.
public static InstanceIdentifier<Node> createInstanceIdentifier(String nodeIdString) {
NodeId nodeId = new NodeId(new Uri(nodeIdString));
NodeKey nodeKey = new NodeKey(nodeId);
TopologyKey topoKey = new TopologyKey(new TopologyId(new Uri("hwvtep:1")));
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.TopologyId in project netvirt by opendaylight.
the class StateManager method initializeNetvirtTopology.
private void initializeNetvirtTopology() {
final TopologyId topologyId = new TopologyId("netvirt:1");
InstanceIdentifier<Topology> path = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
TopologyBuilder tpb = new TopologyBuilder();
tpb.setTopologyId(topologyId);
try {
txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.put(LogicalDatastoreType.OPERATIONAL, path, tpb.build())).get();
} catch (InterruptedException | ExecutionException e) {
LOG.error("StateManager error initializing netvirt topology", e);
}
}
Aggregations