[VOL-1678] Resolve PENDING_ADD issue
This commit adds the necessary APIs in the rw_core that are
required to process a flow/group stats request from ONOS.
Change-Id: I5252ab74963ab4a1b1bd3b4cf4d88f1e28054cde
diff --git a/rw_core/core/logical_device_manager.go b/rw_core/core/logical_device_manager.go
index 37b3c3f..6dfcb86 100644
--- a/rw_core/core/logical_device_manager.go
+++ b/rw_core/core/logical_device_manager.go
@@ -300,13 +300,28 @@
return nil, status.Errorf(codes.NotFound, "%s", device.Id)
}
+func (ldMgr *LogicalDeviceManager) ListLogicalDeviceFlows(ctx context.Context, id string) (*openflow_13.Flows, error) {
+ log.Debugw("ListLogicalDeviceFlows", log.Fields{"logicaldeviceid": id})
+ if agent := ldMgr.getLogicalDeviceAgent(id); agent != nil {
+ return agent.ListLogicalDeviceFlows()
+ }
+ return nil, status.Errorf(codes.NotFound, "%s", id)
+}
+
+func (ldMgr *LogicalDeviceManager) ListLogicalDeviceFlowGroups(ctx context.Context, id string) (*openflow_13.FlowGroups, error) {
+ log.Debugw("ListLogicalDeviceFlowGroups", log.Fields{"logicaldeviceid": id})
+ if agent := ldMgr.getLogicalDeviceAgent(id); agent != nil {
+ return agent.ListLogicalDeviceFlowGroups()
+ }
+ return nil, status.Errorf(codes.NotFound, "%s", id)
+}
+
func (ldMgr *LogicalDeviceManager) ListLogicalDevicePorts(ctx context.Context, id string) (*voltha.LogicalPorts, error) {
log.Debugw("ListLogicalDevicePorts", log.Fields{"logicaldeviceid": id})
if agent := ldMgr.getLogicalDeviceAgent(id); agent != nil {
return agent.ListLogicalDevicePorts()
}
return nil, status.Errorf(codes.NotFound, "%s", id)
-
}
func (ldMgr *LogicalDeviceManager) getLogicalPort(lPortId *voltha.LogicalPortId) (*voltha.LogicalPort, error) {