Search code examples
opendaylight

How to retrieve the dpid in opendaylight


I'm studying the opendaylight and one thing that I didn't find in any part of the documentation is how to get the Dpid of the switches (the switches are called openflow:1, openflow:2 etc) through the URLs that opendaylight provides to get information from the topology in the controller.

So my question is if the datastore of opendaylight actually store this information of the switches (the DatapathID's) and if there's a method for getting these dpids using the URLs that the controller provides.


Solution

  • You can get dpId using DCN on Node and another way is read from inventory of operational DataStore. Example for DCN is here line (81). You find method defination of MDSALUtil.getDpnIdFromNodeName here(along with few otherways).