VOL-3645:Add UpdateStartupConfig RPC
Change-Id: I668c5d0e5461fcde607b3353a574069161e4456a
diff --git a/python/dmi/commons_pb2.py b/python/dmi/commons_pb2.py
index 411acd1..ce1e20b 100644
--- a/python/dmi/commons_pb2.py
+++ b/python/dmi/commons_pb2.py
@@ -20,7 +20,7 @@
syntax='proto3',
serialized_options=b'Z9github.com/opencord/device-management-interface/v3/go/dmi',
create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x11\x64mi/commons.proto\x12\x03\x64mi*?\n\x06Status\x12\x14\n\x10UNDEFINED_STATUS\x10\x00\x12\r\n\tOK_STATUS\x10\x01\x12\x10\n\x0c\x45RROR_STATUS\x10\x02*\xdc\x01\n\x06Reason\x12\x14\n\x10UNDEFINED_REASON\x10\x00\x12\x12\n\x0eUNKNOWN_DEVICE\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x10\n\x0cWRONG_METRIC\x10\x03\x12\x0f\n\x0bWRONG_EVENT\x10\x04\x12\x1a\n\x16LOGGING_ENDPOINT_ERROR\x10\x05\x12#\n\x1fLOGGING_ENDPOINT_PROTOCOL_ERROR\x10\x06\x12\x18\n\x14KAFKA_ENDPOINT_ERROR\x10\x07\x12\x16\n\x12UNKNOWN_LOG_ENTITY\x10\x08*?\n\x08LogLevel\x12\t\n\x05TRACE\x10\x00\x12\t\n\x05\x44\x45\x42UG\x10\x01\x12\x08\n\x04INFO\x10\x02\x12\x08\n\x04WARN\x10\x03\x12\t\n\x05\x45RROR\x10\x04\x42;Z9github.com/opencord/device-management-interface/v3/go/dmib\x06proto3'
+ serialized_pb=b'\n\x11\x64mi/commons.proto\x12\x03\x64mi*?\n\x06Status\x12\x14\n\x10UNDEFINED_STATUS\x10\x00\x12\r\n\tOK_STATUS\x10\x01\x12\x10\n\x0c\x45RROR_STATUS\x10\x02*\x8b\x02\n\x06Reason\x12\x14\n\x10UNDEFINED_REASON\x10\x00\x12\x12\n\x0eUNKNOWN_DEVICE\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x10\n\x0cWRONG_METRIC\x10\x03\x12\x0f\n\x0bWRONG_EVENT\x10\x04\x12\x1a\n\x16LOGGING_ENDPOINT_ERROR\x10\x05\x12#\n\x1fLOGGING_ENDPOINT_PROTOCOL_ERROR\x10\x06\x12\x18\n\x14KAFKA_ENDPOINT_ERROR\x10\x07\x12\x16\n\x12UNKNOWN_LOG_ENTITY\x10\x08\x12\x19\n\x15\x45RROR_FETCHING_CONFIG\x10\t\x12\x12\n\x0eINVALID_CONFIG\x10\n*?\n\x08LogLevel\x12\t\n\x05TRACE\x10\x00\x12\t\n\x05\x44\x45\x42UG\x10\x01\x12\x08\n\x04INFO\x10\x02\x12\x08\n\x04WARN\x10\x03\x12\t\n\x05\x45RROR\x10\x04\x42;Z9github.com/opencord/device-management-interface/v3/go/dmib\x06proto3'
)
_STATUS = _descriptor.EnumDescriptor(
@@ -106,11 +106,21 @@
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='ERROR_FETCHING_CONFIG', index=9, number=9,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
+ _descriptor.EnumValueDescriptor(
+ name='INVALID_CONFIG', index=10, number=10,
+ serialized_options=None,
+ type=None,
+ create_key=_descriptor._internal_create_key),
],
containing_type=None,
serialized_options=None,
serialized_start=92,
- serialized_end=312,
+ serialized_end=359,
)
_sym_db.RegisterEnumDescriptor(_REASON)
@@ -150,8 +160,8 @@
],
containing_type=None,
serialized_options=None,
- serialized_start=314,
- serialized_end=377,
+ serialized_start=361,
+ serialized_end=424,
)
_sym_db.RegisterEnumDescriptor(_LOGLEVEL)
@@ -168,6 +178,8 @@
LOGGING_ENDPOINT_PROTOCOL_ERROR = 6
KAFKA_ENDPOINT_ERROR = 7
UNKNOWN_LOG_ENTITY = 8
+ERROR_FETCHING_CONFIG = 9
+INVALID_CONFIG = 10
TRACE = 0
DEBUG = 1
INFO = 2
diff --git a/python/dmi/sw_management_service_pb2.py b/python/dmi/sw_management_service_pb2.py
index cc5d459..a21d9cb 100644
--- a/python/dmi/sw_management_service_pb2.py
+++ b/python/dmi/sw_management_service_pb2.py
@@ -22,7 +22,7 @@
syntax='proto3',
serialized_options=b'Z9github.com/opencord/device-management-interface/v3/go/dmi',
create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x1f\x64mi/sw_management_service.proto\x12\x03\x64mi\x1a\x11\x64mi/commons.proto\x1a\x0c\x64mi/hw.proto\x1a\x12\x64mi/sw_image.proto\"u\n\x1aSoftwareVersionInformation\x12*\n\x0f\x61\x63tive_versions\x18\x01 \x03(\x0b\x32\x11.dmi.ImageVersion\x12+\n\x10standby_versions\x18\x02 \x03(\x0b\x32\x11.dmi.ImageVersion\"\x90\x01\n%GetSoftwareVersionInformationResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\x12-\n\x04info\x18\x03 \x01(\x0b\x32\x1f.dmi.SoftwareVersionInformation\"a\n\x14\x44ownloadImageRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12)\n\nimage_info\x18\x02 \x01(\x0b\x32\x15.dmi.ImageInformation2\xa7\x02\n\x1fNativeSoftwareManagementService\x12Q\n\x12GetSoftwareVersion\x12\x0f.dmi.HardwareID\x1a*.dmi.GetSoftwareVersionInformationResponse\x12>\n\rDownloadImage\x12\x19.dmi.DownloadImageRequest\x1a\x10.dmi.ImageStatus0\x01\x12\x34\n\rActivateImage\x12\x0f.dmi.HardwareID\x1a\x10.dmi.ImageStatus0\x01\x12;\n\x14RevertToStandbyImage\x12\x0f.dmi.HardwareID\x1a\x10.dmi.ImageStatus0\x01\x42;Z9github.com/opencord/device-management-interface/v3/go/dmib\x06proto3'
+ serialized_pb=b'\n\x1f\x64mi/sw_management_service.proto\x12\x03\x64mi\x1a\x11\x64mi/commons.proto\x1a\x0c\x64mi/hw.proto\x1a\x12\x64mi/sw_image.proto\"u\n\x1aSoftwareVersionInformation\x12*\n\x0f\x61\x63tive_versions\x18\x01 \x03(\x0b\x32\x11.dmi.ImageVersion\x12+\n\x10standby_versions\x18\x02 \x03(\x0b\x32\x11.dmi.ImageVersion\"\x90\x01\n%GetSoftwareVersionInformationResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason\x12-\n\x04info\x18\x03 \x01(\x0b\x32\x1f.dmi.SoftwareVersionInformation\"a\n\x14\x44ownloadImageRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12)\n\nimage_info\x18\x02 \x01(\x0b\x32\x15.dmi.ImageInformation\"C\n\rConfigRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12\x12\n\nconfig_url\x18\x02 \x01(\t\"J\n\x0e\x43onfigResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x1b\n\x06reason\x18\x02 \x01(\x0e\x32\x0b.dmi.Reason2\xf0\x02\n\x1fNativeSoftwareManagementService\x12Q\n\x12GetSoftwareVersion\x12\x0f.dmi.HardwareID\x1a*.dmi.GetSoftwareVersionInformationResponse\x12>\n\rDownloadImage\x12\x19.dmi.DownloadImageRequest\x1a\x10.dmi.ImageStatus0\x01\x12\x34\n\rActivateImage\x12\x0f.dmi.HardwareID\x1a\x10.dmi.ImageStatus0\x01\x12;\n\x14RevertToStandbyImage\x12\x0f.dmi.HardwareID\x1a\x10.dmi.ImageStatus0\x01\x12G\n\x1aUpdateStartupConfiguration\x12\x12.dmi.ConfigRequest\x1a\x13.dmi.ConfigResponse0\x01\x42;Z9github.com/opencord/device-management-interface/v3/go/dmib\x06proto3'
,
dependencies=[dmi_dot_commons__pb2.DESCRIPTOR,dmi_dot_hw__pb2.DESCRIPTOR,dmi_dot_sw__image__pb2.DESCRIPTOR,])
@@ -152,6 +152,84 @@
serialized_end=456,
)
+
+_CONFIGREQUEST = _descriptor.Descriptor(
+ name='ConfigRequest',
+ full_name='dmi.ConfigRequest',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ create_key=_descriptor._internal_create_key,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='device_uuid', full_name='dmi.ConfigRequest.device_uuid', index=0,
+ number=1, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ _descriptor.FieldDescriptor(
+ name='config_url', full_name='dmi.ConfigRequest.config_url', index=1,
+ number=2, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=b"".decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=458,
+ serialized_end=525,
+)
+
+
+_CONFIGRESPONSE = _descriptor.Descriptor(
+ name='ConfigResponse',
+ full_name='dmi.ConfigResponse',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ create_key=_descriptor._internal_create_key,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='status', full_name='dmi.ConfigResponse.status', index=0,
+ number=1, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ _descriptor.FieldDescriptor(
+ name='reason', full_name='dmi.ConfigResponse.reason', index=1,
+ number=2, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=527,
+ serialized_end=601,
+)
+
_SOFTWAREVERSIONINFORMATION.fields_by_name['active_versions'].message_type = dmi_dot_sw__image__pb2._IMAGEVERSION
_SOFTWAREVERSIONINFORMATION.fields_by_name['standby_versions'].message_type = dmi_dot_sw__image__pb2._IMAGEVERSION
_GETSOFTWAREVERSIONINFORMATIONRESPONSE.fields_by_name['status'].enum_type = dmi_dot_commons__pb2._STATUS
@@ -159,9 +237,14 @@
_GETSOFTWAREVERSIONINFORMATIONRESPONSE.fields_by_name['info'].message_type = _SOFTWAREVERSIONINFORMATION
_DOWNLOADIMAGEREQUEST.fields_by_name['device_uuid'].message_type = dmi_dot_hw__pb2._UUID
_DOWNLOADIMAGEREQUEST.fields_by_name['image_info'].message_type = dmi_dot_sw__image__pb2._IMAGEINFORMATION
+_CONFIGREQUEST.fields_by_name['device_uuid'].message_type = dmi_dot_hw__pb2._UUID
+_CONFIGRESPONSE.fields_by_name['status'].enum_type = dmi_dot_commons__pb2._STATUS
+_CONFIGRESPONSE.fields_by_name['reason'].enum_type = dmi_dot_commons__pb2._REASON
DESCRIPTOR.message_types_by_name['SoftwareVersionInformation'] = _SOFTWAREVERSIONINFORMATION
DESCRIPTOR.message_types_by_name['GetSoftwareVersionInformationResponse'] = _GETSOFTWAREVERSIONINFORMATIONRESPONSE
DESCRIPTOR.message_types_by_name['DownloadImageRequest'] = _DOWNLOADIMAGEREQUEST
+DESCRIPTOR.message_types_by_name['ConfigRequest'] = _CONFIGREQUEST
+DESCRIPTOR.message_types_by_name['ConfigResponse'] = _CONFIGRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
SoftwareVersionInformation = _reflection.GeneratedProtocolMessageType('SoftwareVersionInformation', (_message.Message,), {
@@ -185,6 +268,20 @@
})
_sym_db.RegisterMessage(DownloadImageRequest)
+ConfigRequest = _reflection.GeneratedProtocolMessageType('ConfigRequest', (_message.Message,), {
+ 'DESCRIPTOR' : _CONFIGREQUEST,
+ '__module__' : 'dmi.sw_management_service_pb2'
+ # @@protoc_insertion_point(class_scope:dmi.ConfigRequest)
+ })
+_sym_db.RegisterMessage(ConfigRequest)
+
+ConfigResponse = _reflection.GeneratedProtocolMessageType('ConfigResponse', (_message.Message,), {
+ 'DESCRIPTOR' : _CONFIGRESPONSE,
+ '__module__' : 'dmi.sw_management_service_pb2'
+ # @@protoc_insertion_point(class_scope:dmi.ConfigResponse)
+ })
+_sym_db.RegisterMessage(ConfigResponse)
+
DESCRIPTOR._options = None
@@ -195,8 +292,8 @@
index=0,
serialized_options=None,
create_key=_descriptor._internal_create_key,
- serialized_start=459,
- serialized_end=754,
+ serialized_start=604,
+ serialized_end=972,
methods=[
_descriptor.MethodDescriptor(
name='GetSoftwareVersion',
@@ -238,6 +335,16 @@
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
+ _descriptor.MethodDescriptor(
+ name='UpdateStartupConfiguration',
+ full_name='dmi.NativeSoftwareManagementService.UpdateStartupConfiguration',
+ index=4,
+ containing_service=None,
+ input_type=_CONFIGREQUEST,
+ output_type=_CONFIGRESPONSE,
+ serialized_options=None,
+ create_key=_descriptor._internal_create_key,
+ ),
])
_sym_db.RegisterServiceDescriptor(_NATIVESOFTWAREMANAGEMENTSERVICE)
diff --git a/python/dmi/sw_management_service_pb2_grpc.py b/python/dmi/sw_management_service_pb2_grpc.py
index b9669b7..f8b076e 100644
--- a/python/dmi/sw_management_service_pb2_grpc.py
+++ b/python/dmi/sw_management_service_pb2_grpc.py
@@ -36,6 +36,11 @@
request_serializer=dmi_dot_hw__pb2.HardwareID.SerializeToString,
response_deserializer=dmi_dot_sw__image__pb2.ImageStatus.FromString,
)
+ self.UpdateStartupConfiguration = channel.unary_stream(
+ '/dmi.NativeSoftwareManagementService/UpdateStartupConfiguration',
+ request_serializer=dmi_dot_sw__management__service__pb2.ConfigRequest.SerializeToString,
+ response_deserializer=dmi_dot_sw__management__service__pb2.ConfigResponse.FromString,
+ )
class NativeSoftwareManagementServiceServicer(object):
@@ -72,6 +77,13 @@
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
+ def UpdateStartupConfiguration(self, request, context):
+ """This API can be used to let the devices pickup their properitary configuration which they need at startup.
+ """
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
def add_NativeSoftwareManagementServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
@@ -95,6 +107,11 @@
request_deserializer=dmi_dot_hw__pb2.HardwareID.FromString,
response_serializer=dmi_dot_sw__image__pb2.ImageStatus.SerializeToString,
),
+ 'UpdateStartupConfiguration': grpc.unary_stream_rpc_method_handler(
+ servicer.UpdateStartupConfiguration,
+ request_deserializer=dmi_dot_sw__management__service__pb2.ConfigRequest.FromString,
+ response_serializer=dmi_dot_sw__management__service__pb2.ConfigResponse.SerializeToString,
+ ),
}
generic_handler = grpc.method_handlers_generic_handler(
'dmi.NativeSoftwareManagementService', rpc_method_handlers)
@@ -172,3 +189,20 @@
dmi_dot_sw__image__pb2.ImageStatus.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+ @staticmethod
+ def UpdateStartupConfiguration(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_stream(request, target, '/dmi.NativeSoftwareManagementService/UpdateStartupConfiguration',
+ dmi_dot_sw__management__service__pb2.ConfigRequest.SerializeToString,
+ dmi_dot_sw__management__service__pb2.ConfigResponse.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)