Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


How can nodes and links be associated to a specific topology ?

asked 2014-07-30 10:36:06 -0800

ggiorgio gravatar image

updated 2014-07-30 12:07:58 -0800

By taking advantage of the MD-SAL, I would like to write a Java procedure able to add nodes and links to a specific topology identifier (instance). I do NOT mean to do that by the RestConf interface. In other words, once created a topology by:

TopologyKey topology = new TopologyKey(new TopologyId("mytopo:1"));
topologyPath = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology).build();
TopologyBuilder tb = new TopologyBuilder();
Topology top =;
DataModificationTransaction tx = dataService.beginTransaction();
tx.putOperationalData(topologyPath, top);

I would further create nodes and associated them to that topology. How to associate the nodes and links to a specific topology instance ?


edit retag flag offensive close merge delete


I also have your question,please send you question and answer to;

wangruxun ( 2015-06-01 22:52:43 -0800 )edit

2 answers

Sort by » oldest newest most voted

answered 2014-07-31 01:02:58 -0800

ggiorgio gravatar image

updated 2014-07-31 01:03:37 -0800

Inside the package package org.opendaylight.yangtools.yang.binding, there is the InstanceIdentifier.child() method allowing to implement such kind of relationship as result of the node path computation. Herein how to starting from the above shown code.

NodeId nodeId = new NodeId("node_001");
NodeKey nodeKey = new NodeKey(nodeId);

InstanceIdentifier<Node> path = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology).child(Node.class, nodeKey).build();
NodeBuilder nb = new NodeBuilder();
edit flag offensive delete publish link more


how to slice openflow topology to make a topology come from the underlay topology?

wangruxun ( 2015-06-01 06:24:37 -0800 )edit

answered 2015-06-01 22:55:51 -0800

wangruxun gravatar image

hi,please answer the question more clearly,thanks

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-07-30 10:36:06 -0800

Seen: 498 times

Last updated: Jun 01 '15