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


Requesting Data via dataBroker returns null, but via RestAPI works

asked 2015-07-29 04:22:57 -0800

luna gravatar image

updated 2015-07-29 04:34:57 -0800


I generally try to fetch some daat from openDaylight operational datastore. However if i follow the approach, using InstanceIdentifiers, read from datastore like following lines:

TopologyId topoId = new TopologyId("flow:1");
InstanceIdentifier<Topology> topoIdentifier = InstanceIdentifier
     .child(Topology.class, new TopologyKey(topoId)).toInstance();
CheckedFuture<Optional<Topology>, ReadFailedException> topoFuture =
     (CheckedFuture<Optional<Topology>, ReadFailedException>) dataBroker
     LogicalDatastoreType.OPERATIONAL, topoIdentifier);

Optional<Topology> topologyOpt = null;

try {
   if (topoFuture.isDone())
      topologyOpt = topoFuture.get();
} catch (InterruptedException | ExecutionException e1) {

But topologyOpt.isPresent() returns false. When I do the same via REST API, calling following url:


I get a valid response. What is wrong with my first approach ? In my case, this appears not only on topology, the same result ist when requesting nodes or other stuff. Is there some basic point, I'm missing ? Does anyone got the same issue. Working on ODL-helium. All the code is running in a self developed application, based on toaster example

Any help will be appreciated.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-08-05 13:26:13 -0800


So I think your problem is that you aren't submitting anything to the store, so your topology isn't present (based on the code snippet).

You say it works using RestConf, but did you do a POST / PUT to create the topology in the Operational Store before sending a GET ?

In OVSDB southbound, the ovsdb:1 is initialized under "network-topology" on the Operational and Config tree, when the module is loaded. Here is the code.


edit flag offensive delete publish link more


You are right, i didnt store anything and didnt do a POST / PUT before sending a GET request. What i basically did, is, connecting mininet to controller, do a pingall, so that all switches and host get "discovered". After a certain event which rises, after pingall, i request the nodes

luna ( 2015-08-06 13:57:52 -0800 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-07-29 04:22:57 -0800

Seen: 103 times

Last updated: Aug 05 '15