Hi all,

I'm writing an application to get flow from the datastore.
I can get the flow from the restful API:
http://127.0.0.1:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:3/flow-node-inventory:table/0
{
    "flow-node-inventory:table": [
        {
            "id": 0,
            "opendaylight-flow-table-statistics:flow-table-statistics": {
                "active-flows": 1,
                "packets-looked-up": 25,
                "packets-matched": 6
            },
            "flow": [
                {
                    "id": "#UF$TABLE*0-35",
                    "idle-timeout": 0,
                    "cookie": 259813845,
                    "flags": "NO_PKT_COUNTS NO_BYT_COUNTS",
                    "hard-timeout": 0,
                    "instructions": {
                        "instruction": [
                            {
                                "order": 0,
                                "apply-actions": {
                                    "action": [
                                        {
                                            "order": 0,
                                            "output-action": {
                                                "output-node-connector":
"CONTROLLER",
                                                "max-length": 200
                                            }
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "cookie_mask": 0,
                    "opendaylight-flow-statistics:flow-statistics": {
                        "duration": {
                            "nanosecond": 701000000,
                            "second": 30
                        },
                        "byte-count": 2376,
                        "packet-count": 24
                    },
                    "priority": 510,
                    "table_id": 0,
                    "match": {
                        "ethernet-match": {
                            "ethernet-destination": {
                                "address": "01:23:00:00:00:01"
                            },
                            "ethernet-type": {
                                "type": 35020
                            }
                        }
                    }
                }
            ]
        }
    ]
}

However, when I tried to get flow inside the application as the following I
can't get anything:
        final ReadWriteTransaction rx =
dataBroker.newReadWriteTransaction();

        try {
                    Optional<Node> data =
                    rx.read(LogicalDatastoreType.OPERATIONAL,
InstanceIdentifier.builder(Nodes.class)..child(Node.class, new
NodeKey("openflow:3")).build()).checkedGet();
            if (data.isPresent()) {
                    Node node = data.get();
                    FlowCapableNode flowCapableNode =
node.getAugmentation(FlowCapableNode.class);
                    System.out.println("Flow: " +
flowCapableNode.getTable().get(0).getFlow());
            }
        } catch (ReadFailedException e1) {
            e1.printStackTrace();
        }

Console output: Flow: []

The switches were created by Mininet through:
mn --topo linear,3 --controller=remote --switch=ovs,protocols=OpenFlow13

Mininet version: 2.3.0d1
OvS version: 2.8.1

If anyone has any thought I'm really appreciated.
Thank you.

Best regards,
James
_______________________________________________
openflowplugin-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev

Reply via email to