I am using OpenDaylight Carbon release and the openflow plugin. I am writing code to install a flow. The flow gets written to MDSAL and picked up and installed by the Southbound plugin. I want to see what is in the config database for the switch. How can I do this? Thanks.
With the MDSAL Openflow plugin (and general MDSAL usage overall), the flows get written to the config datastore (which is effectively the intention of what you want) then if there is a switch connected for these flows, the flows will be written to the switch and to the operational data store (which is where the result is stored).
Lets assume you're using OVS and have set the manager and controller to Opendaylight, you can query the flows in the config and operational data stores as follows:
Get the OVS datapath ID: (needed below in the queries)
curl -H "Content-Type: application/json" -X GET --user admin:admin http://localhost:8181/restconf/config/opendaylight-inventory:nodes/ | python -m json.tool | grep "openflow:"
"id": "openflow:156930464280132",
"id": "openflow:156930464280132:1",
"id": "openflow:156930464280132:LOCAL",
Query the flows in the configuration data store:
curl -H "Content-Type: application/json" -X GET --user admin:admin http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:156930464280132 | python -m json.tool
Query the flows in the operational data store:
curl -H "Content-Type: application/json" -X GET --user admin:admin http://localhost:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:156930464280132 | python -m json.tool
Notice, you can go into more detail with the URL to get flows in specific tables, for instance, do this to get table 4 flows:
curl -H "Content-Type: application/json" -X GET --user admin:admin http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:156930464280132/table/4 | python -m json.tool
Also notice that using "python -m json.tool" formats the output so its not all on one line. Its not mandatory to use.