Ask Your Question

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

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

ggiorgio gravatar image

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

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 -0700 )edit

2 answers

Sort by » oldest newest most voted

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

ggiorgio gravatar image

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

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 -0700 )edit

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

wangruxun gravatar image

hi,please answer the question more clearly,thanks

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower


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

Seen: 464 times

Last updated: Jun 01 '15