[VOL-5292] Implementation for fetching the GEM port history Data from the ONT

Change-Id: I4cf22555cbd13bcd5e49e620c8aa8b67cbd2891c
Signed-off-by: Akash Reddy Kankanala <akash.kankanala@radisys.com>
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index bab59ef..3d12954 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -4770,6 +4770,13 @@
 	return resp
 }
 
+// getONUGEMStatsInfo - Get the GEM PM history data of the request ONT device
+func (dh *deviceHandler) getONUGEMStatsInfo(ctx context.Context) *extension.SingleGetValueResponse {
+	resp := dh.pOnuMetricsMgr.GetONUGEMCounters(ctx)
+	logger.Debugw(ctx, "Received response from AlarmManager for Active Alarms for DeviceEntry", log.Fields{"device-id": dh.DeviceID})
+	return resp
+}
+
 func (dh *deviceHandler) GetDeviceDeleteCommChan(ctx context.Context) chan bool {
 	return dh.deviceDeleteCommChan
 }
diff --git a/internal/pkg/core/openonu.go b/internal/pkg/core/openonu.go
index 4d68e8f..75ba35e 100755
--- a/internal/pkg/core/openonu.go
+++ b/internal/pkg/core/openonu.go
@@ -498,6 +498,10 @@
 			resp := handler.getOnuActiveAlarms(ctx)
 			logger.Infow(ctx, "Received response for on demand active alarms request ", log.Fields{"response": resp})
 			return resp, nil
+		case *extension.GetValueRequest_OnuAllocGemStats:
+			resp := handler.getONUGEMStatsInfo(ctx)
+			logger.Infow(ctx, "Received response for on demand active alarms request ", log.Fields{"response": resp})
+			return resp, nil
 		default:
 			return uniprt.PostUniStatusErrResponse(extension.GetValueResponse_UNSUPPORTED), nil
 		}