https://jira.opencord.org/browse/VOL-167
Device Management: Retrieve Software Version on the device
Provides a framework in voltha to retrieve the software
details on the device.
Addressed Review Comments
Change-Id: I2938e6e1a57f95d41cc8f548a5ebad9c952a23db
diff --git a/voltha/core/global_handler.py b/voltha/core/global_handler.py
index 7df3f29..63e2c60 100644
--- a/voltha/core/global_handler.py
+++ b/voltha/core/global_handler.py
@@ -19,7 +19,7 @@
from common.utils.grpc_utils import twisted_async
from voltha.core.config.config_root import ConfigRoot
-from voltha.protos.device_pb2 import PmConfigs
+from voltha.protos.device_pb2 import PmConfigs, Images
from voltha.protos.voltha_pb2 import \
add_VolthaGlobalServiceServicer_to_server, VolthaLocalServiceStub, \
VolthaGlobalServiceServicer, Voltha, VolthaInstances, VolthaInstance, \
@@ -557,3 +557,22 @@
'ListAlarmFilters',
Empty(),
context)
+
+ @twisted_async
+ def GetImages(self, request, context):
+ log.info('grpc-request', request=request)
+
+ try:
+ instance_id = self.dispatcher.instance_id_by_device_id(request.id)
+ except KeyError:
+ context.set_details(
+ 'Device \'{}\' not found'.format(request.id))
+ context.set_code(StatusCode.NOT_FOUND)
+ return Images()
+
+ return self.dispatcher.dispatch(
+ instance_id,
+ VolthaLocalServiceStub,
+ 'GetImages',
+ request,
+ context)