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

0

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();
tb.setKey(topology);
Topology top = tb.build();
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 ?

Thanks.

edit retag flag offensive close merge delete

Comments

I also have your question,please send you question and answer to xiansheng410426@163.com;

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

2 answers

Sort by » oldest newest most voted
1

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();
nb.setNodeId(nodeId);
tx.putOperationalData(path, nb.build());
edit flag offensive delete publish link more

Comments

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

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

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

Follow
1 follower

Stats

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

Seen: 474 times

Last updated: Jun 01 '15