Ask Your Question

Link retrieval from MD-SAL

asked 2014-05-07 09:47:04 -0700

To retrieve all the nodes or a particular node from MD-SAL, I used the method described on this link.

Is there any way to retrieve all the links or a particular link from MD-SAL?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-05-15 02:22:10 -0700

Hi Robert,

This is what worked for me:

    TopologyId topoId = new TopologyId("flow:1");
    InstanceIdentifier topoIdentifier = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(topoId)).toInstance();
     Topology topology = (Topology) dataProviderService.readOperationalData(topoIdentifier);
    List<Link> links = topology .getLink();

I have documented it here:

edit flag offensive delete publish link more

answered 2014-05-07 12:07:34 -0700

Robert Varga gravatar image

The approach would be the same, but you would create an InstanceIdentifier which would target links -- not sure what the original model was, assuming it was network-topology or similar, but it should work like this:

//Look up all the nodes from MD-SAL operational data store InstanceIdentifier<links> nodesIdentifier = InstanceIdentifier.builder(Links.class).toInstance() List<link/> nodes = dataService.readOperationalData(linksIdentifier).getLinks();</links>

//Look up a specific node "node001" LinkId linkId = new LinkId("link001"); InstanceIdentifier instanceIdentifier = InstanceIdentifier.builder(Links.class).child(Link.class, new LinkKey(linkId)).toInstance(); Link link = dataService.readOperationalData(instanceIdentifier);

The specifics really depend on the model -- if you look at the base network topology model ( ), you will see that both nodes and links have the same kind of containment.

edit flag offensive delete publish link more


Thanks Robert, I will try this out.

kanika28 ( 2014-05-09 07:10:58 -0700 )edit

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



Asked: 2014-05-07 09:47:04 -0700

Seen: 179 times

Last updated: May 15 '14