From d9a2b5e0c0628bbac67884b0cc9f1663bb3207a3 Mon Sep 17 00:00:00 2001 From: Lluis Gifre Date: Wed, 22 Sep 2021 15:50:11 +0200 Subject: [PATCH] Fix renaming of compute.proto methods from snake-case to camel-case. Added minor naming improvements. --- proto/compute.proto | 14 +-- src/compute/client/ComputeClient.py | 20 ++-- src/compute/proto/compute_pb2.py | 32 +++--- src/compute/proto/compute_pb2_grpc.py | 98 +++++++++---------- .../service/ComputeServiceServicerImpl.py | 70 ++++++------- 5 files changed, 114 insertions(+), 120 deletions(-) diff --git a/proto/compute.proto b/proto/compute.proto index 0860965b2..605ed0207 100644 --- a/proto/compute.proto +++ b/proto/compute.proto @@ -5,11 +5,11 @@ import "context.proto"; import "service.proto"; service ComputeService { - rpc checkCredentials (context.TeraFlowController) returns (context.AuthenticationResult) {} - rpc getConnectivityServiceStatus ( service.ServiceId ) returns (service.ServiceState) {} - rpc createConnectivityService ( service.Service ) returns (service.ServiceId) {} - rpc editConnectivityService ( service.Service ) returns (service.ServiceId) {} - rpc deleteConnectivityService ( service.Service ) returns ( context.Empty ) {} - rpc getAllActiveConnectivityServices ( context.Empty ) returns ( service.ServiceIdList ) {} - rpc clearAllConnectivityServices ( context.Empty ) returns ( context.Empty ) {} + rpc CheckCredentials (context.TeraFlowController) returns (context.AuthenticationResult) {} + rpc GetConnectivityServiceStatus ( service.ServiceId ) returns (service.ServiceState) {} + rpc CreateConnectivityService ( service.Service ) returns (service.ServiceId) {} + rpc EditConnectivityService ( service.Service ) returns (service.ServiceId) {} + rpc DeleteConnectivityService ( service.Service ) returns ( context.Empty ) {} + rpc GetAllActiveConnectivityServices ( context.Empty ) returns ( service.ServiceIdList ) {} + rpc ClearAllConnectivityServices ( context.Empty ) returns ( context.Empty ) {} } diff --git a/src/compute/client/ComputeClient.py b/src/compute/client/ComputeClient.py index ad651303d..73ec8e69f 100644 --- a/src/compute/client/ComputeClient.py +++ b/src/compute/client/ComputeClient.py @@ -29,54 +29,48 @@ class ComputeClient: @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') def CheckCredentials(self, request : TeraFlowController) -> AuthenticationResult: LOGGER.debug('CheckCredentials request: {}'.format(request)) - response = self.stub.check_credentials(request) + response = self.stub.CheckCredentials(request) LOGGER.debug('CheckCredentials result: {}'.format(response)) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') def GetConnectivityServiceStatus(self, request : ServiceId) -> ServiceState: LOGGER.debug('GetConnectivityServiceStatus request: {}'.format(request)) - response = self.stub.get_connectivity_service_status(request) + response = self.stub.GetConnectivityServiceStatus(request) LOGGER.debug('GetConnectivityServiceStatus result: {}'.format(response)) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') def CreateConnectivityService(self, request : Service) -> ServiceId: LOGGER.debug('CreateConnectivityService request: {}'.format(request)) - response = self.stub.create_connectivity_service(request) + response = self.stub.CreateConnectivityService(request) LOGGER.debug('CreateConnectivityService result: {}'.format(response)) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') def EditConnectivityService(self, request : Service) -> ServiceId: LOGGER.debug('EditConnectivityService request: {}'.format(request)) - response = self.stub.edit_connectivity_service(request) + response = self.stub.EditConnectivityService(request) LOGGER.debug('EditConnectivityService result: {}'.format(response)) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') def DeleteConnectivityService(self, request : Service) -> Empty: LOGGER.debug('DeleteConnectivityService request: {}'.format(request)) - response = self.stub.delete_connectivity_service(request) + response = self.stub.DeleteConnectivityService(request) LOGGER.debug('DeleteConnectivityService result: {}'.format(response)) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') def GetAllActiveConnectivityServices(self, request : Empty) -> ServiceIdList: LOGGER.debug('GetAllActiveConnectivityServices request: {}'.format(request)) - response = self.stub.get_all_active_connectivity_services(request) + response = self.stub.GetAllActiveConnectivityServices(request) LOGGER.debug('GetAllActiveConnectivityServices result: {}'.format(response)) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') def ClearAllConnectivityServices(self, request : Empty) -> Empty: LOGGER.debug('ClearAllConnectivityServices request: {}'.format(request)) - response = self.stub.clear_all_connectivity_services(request) + response = self.stub.ClearAllConnectivityServices(request) LOGGER.debug('ClearAllConnectivityServices result: {}'.format(response)) return response diff --git a/src/compute/proto/compute_pb2.py b/src/compute/proto/compute_pb2.py index 6cdb33c62..19f62a158 100644 --- a/src/compute/proto/compute_pb2.py +++ b/src/compute/proto/compute_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcompute.proto\x12\x07\x63ompute\x1a\rcontext.proto\x1a\rservice.proto2\x99\x04\n\x0e\x43omputeService\x12Q\n\x11\x63heck_credentials\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12N\n\x1fget_connectivity_service_status\x12\x12.service.ServiceId\x1a\x15.service.ServiceState\"\x00\x12\x45\n\x1b\x63reate_connectivity_service\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x43\n\x19\x65\x64it_connectivity_service\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x41\n\x1b\x64\x65lete_connectivity_service\x12\x10.service.Service\x1a\x0e.context.Empty\"\x00\x12P\n$get_all_active_connectivity_services\x12\x0e.context.Empty\x1a\x16.service.ServiceIdList\"\x00\x12\x43\n\x1f\x63lear_all_connectivity_services\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + serialized_pb=b'\n\rcompute.proto\x12\x07\x63ompute\x1a\rcontext.proto\x1a\rservice.proto2\x88\x04\n\x0e\x43omputeService\x12P\n\x10\x43heckCredentials\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12K\n\x1cGetConnectivityServiceStatus\x12\x12.service.ServiceId\x1a\x15.service.ServiceState\"\x00\x12\x43\n\x19\x43reateConnectivityService\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x41\n\x17\x45\x64itConnectivityService\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12?\n\x19\x44\x65leteConnectivityService\x12\x10.service.Service\x1a\x0e.context.Empty\"\x00\x12L\n GetAllActiveConnectivityServices\x12\x0e.context.Empty\x1a\x16.service.ServiceIdList\"\x00\x12@\n\x1c\x43learAllConnectivityServices\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x62\x06proto3' , dependencies=[context__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,]) @@ -39,11 +39,11 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=57, - serialized_end=594, + serialized_end=577, methods=[ _descriptor.MethodDescriptor( - name='check_credentials', - full_name='compute.ComputeService.check_credentials', + name='CheckCredentials', + full_name='compute.ComputeService.CheckCredentials', index=0, containing_service=None, input_type=context__pb2._TERAFLOWCONTROLLER, @@ -52,8 +52,8 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( - name='get_connectivity_service_status', - full_name='compute.ComputeService.get_connectivity_service_status', + name='GetConnectivityServiceStatus', + full_name='compute.ComputeService.GetConnectivityServiceStatus', index=1, containing_service=None, input_type=service__pb2._SERVICEID, @@ -62,8 +62,8 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( - name='create_connectivity_service', - full_name='compute.ComputeService.create_connectivity_service', + name='CreateConnectivityService', + full_name='compute.ComputeService.CreateConnectivityService', index=2, containing_service=None, input_type=service__pb2._SERVICE, @@ -72,8 +72,8 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( - name='edit_connectivity_service', - full_name='compute.ComputeService.edit_connectivity_service', + name='EditConnectivityService', + full_name='compute.ComputeService.EditConnectivityService', index=3, containing_service=None, input_type=service__pb2._SERVICE, @@ -82,8 +82,8 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( - name='delete_connectivity_service', - full_name='compute.ComputeService.delete_connectivity_service', + name='DeleteConnectivityService', + full_name='compute.ComputeService.DeleteConnectivityService', index=4, containing_service=None, input_type=service__pb2._SERVICE, @@ -92,8 +92,8 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( - name='get_all_active_connectivity_services', - full_name='compute.ComputeService.get_all_active_connectivity_services', + name='GetAllActiveConnectivityServices', + full_name='compute.ComputeService.GetAllActiveConnectivityServices', index=5, containing_service=None, input_type=context__pb2._EMPTY, @@ -102,8 +102,8 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( - name='clear_all_connectivity_services', - full_name='compute.ComputeService.clear_all_connectivity_services', + name='ClearAllConnectivityServices', + full_name='compute.ComputeService.ClearAllConnectivityServices', index=6, containing_service=None, input_type=context__pb2._EMPTY, diff --git a/src/compute/proto/compute_pb2_grpc.py b/src/compute/proto/compute_pb2_grpc.py index a5ceb93c5..96394dccb 100644 --- a/src/compute/proto/compute_pb2_grpc.py +++ b/src/compute/proto/compute_pb2_grpc.py @@ -15,38 +15,38 @@ class ComputeServiceStub(object): Args: channel: A grpc.Channel. """ - self.check_credentials = channel.unary_unary( - '/compute.ComputeService/check_credentials', + self.CheckCredentials = channel.unary_unary( + '/compute.ComputeService/CheckCredentials', request_serializer=context__pb2.TeraFlowController.SerializeToString, response_deserializer=context__pb2.AuthenticationResult.FromString, ) - self.get_connectivity_service_status = channel.unary_unary( - '/compute.ComputeService/get_connectivity_service_status', + self.GetConnectivityServiceStatus = channel.unary_unary( + '/compute.ComputeService/GetConnectivityServiceStatus', request_serializer=service__pb2.ServiceId.SerializeToString, response_deserializer=service__pb2.ServiceState.FromString, ) - self.create_connectivity_service = channel.unary_unary( - '/compute.ComputeService/create_connectivity_service', + self.CreateConnectivityService = channel.unary_unary( + '/compute.ComputeService/CreateConnectivityService', request_serializer=service__pb2.Service.SerializeToString, response_deserializer=service__pb2.ServiceId.FromString, ) - self.edit_connectivity_service = channel.unary_unary( - '/compute.ComputeService/edit_connectivity_service', + self.EditConnectivityService = channel.unary_unary( + '/compute.ComputeService/EditConnectivityService', request_serializer=service__pb2.Service.SerializeToString, response_deserializer=service__pb2.ServiceId.FromString, ) - self.delete_connectivity_service = channel.unary_unary( - '/compute.ComputeService/delete_connectivity_service', + self.DeleteConnectivityService = channel.unary_unary( + '/compute.ComputeService/DeleteConnectivityService', request_serializer=service__pb2.Service.SerializeToString, response_deserializer=context__pb2.Empty.FromString, ) - self.get_all_active_connectivity_services = channel.unary_unary( - '/compute.ComputeService/get_all_active_connectivity_services', + self.GetAllActiveConnectivityServices = channel.unary_unary( + '/compute.ComputeService/GetAllActiveConnectivityServices', request_serializer=context__pb2.Empty.SerializeToString, response_deserializer=service__pb2.ServiceIdList.FromString, ) - self.clear_all_connectivity_services = channel.unary_unary( - '/compute.ComputeService/clear_all_connectivity_services', + self.ClearAllConnectivityServices = channel.unary_unary( + '/compute.ComputeService/ClearAllConnectivityServices', request_serializer=context__pb2.Empty.SerializeToString, response_deserializer=context__pb2.Empty.FromString, ) @@ -55,43 +55,43 @@ class ComputeServiceStub(object): class ComputeServiceServicer(object): """Missing associated documentation comment in .proto file.""" - def check_credentials(self, request, context): + def CheckCredentials(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def get_connectivity_service_status(self, request, context): + def GetConnectivityServiceStatus(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def create_connectivity_service(self, request, context): + def CreateConnectivityService(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def edit_connectivity_service(self, request, context): + def EditConnectivityService(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def delete_connectivity_service(self, request, context): + def DeleteConnectivityService(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def get_all_active_connectivity_services(self, request, context): + def GetAllActiveConnectivityServices(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def clear_all_connectivity_services(self, request, context): + def ClearAllConnectivityServices(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -100,38 +100,38 @@ class ComputeServiceServicer(object): def add_ComputeServiceServicer_to_server(servicer, server): rpc_method_handlers = { - 'check_credentials': grpc.unary_unary_rpc_method_handler( - servicer.check_credentials, + 'CheckCredentials': grpc.unary_unary_rpc_method_handler( + servicer.CheckCredentials, request_deserializer=context__pb2.TeraFlowController.FromString, response_serializer=context__pb2.AuthenticationResult.SerializeToString, ), - 'get_connectivity_service_status': grpc.unary_unary_rpc_method_handler( - servicer.get_connectivity_service_status, + 'GetConnectivityServiceStatus': grpc.unary_unary_rpc_method_handler( + servicer.GetConnectivityServiceStatus, request_deserializer=service__pb2.ServiceId.FromString, response_serializer=service__pb2.ServiceState.SerializeToString, ), - 'create_connectivity_service': grpc.unary_unary_rpc_method_handler( - servicer.create_connectivity_service, + 'CreateConnectivityService': grpc.unary_unary_rpc_method_handler( + servicer.CreateConnectivityService, request_deserializer=service__pb2.Service.FromString, response_serializer=service__pb2.ServiceId.SerializeToString, ), - 'edit_connectivity_service': grpc.unary_unary_rpc_method_handler( - servicer.edit_connectivity_service, + 'EditConnectivityService': grpc.unary_unary_rpc_method_handler( + servicer.EditConnectivityService, request_deserializer=service__pb2.Service.FromString, response_serializer=service__pb2.ServiceId.SerializeToString, ), - 'delete_connectivity_service': grpc.unary_unary_rpc_method_handler( - servicer.delete_connectivity_service, + 'DeleteConnectivityService': grpc.unary_unary_rpc_method_handler( + servicer.DeleteConnectivityService, request_deserializer=service__pb2.Service.FromString, response_serializer=context__pb2.Empty.SerializeToString, ), - 'get_all_active_connectivity_services': grpc.unary_unary_rpc_method_handler( - servicer.get_all_active_connectivity_services, + 'GetAllActiveConnectivityServices': grpc.unary_unary_rpc_method_handler( + servicer.GetAllActiveConnectivityServices, request_deserializer=context__pb2.Empty.FromString, response_serializer=service__pb2.ServiceIdList.SerializeToString, ), - 'clear_all_connectivity_services': grpc.unary_unary_rpc_method_handler( - servicer.clear_all_connectivity_services, + 'ClearAllConnectivityServices': grpc.unary_unary_rpc_method_handler( + servicer.ClearAllConnectivityServices, request_deserializer=context__pb2.Empty.FromString, response_serializer=context__pb2.Empty.SerializeToString, ), @@ -146,7 +146,7 @@ class ComputeService(object): """Missing associated documentation comment in .proto file.""" @staticmethod - def check_credentials(request, + def CheckCredentials(request, target, options=(), channel_credentials=None, @@ -156,14 +156,14 @@ class ComputeService(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/check_credentials', + return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/CheckCredentials', context__pb2.TeraFlowController.SerializeToString, context__pb2.AuthenticationResult.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def get_connectivity_service_status(request, + def GetConnectivityServiceStatus(request, target, options=(), channel_credentials=None, @@ -173,14 +173,14 @@ class ComputeService(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/get_connectivity_service_status', + return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/GetConnectivityServiceStatus', service__pb2.ServiceId.SerializeToString, service__pb2.ServiceState.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def create_connectivity_service(request, + def CreateConnectivityService(request, target, options=(), channel_credentials=None, @@ -190,14 +190,14 @@ class ComputeService(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/create_connectivity_service', + return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/CreateConnectivityService', service__pb2.Service.SerializeToString, service__pb2.ServiceId.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def edit_connectivity_service(request, + def EditConnectivityService(request, target, options=(), channel_credentials=None, @@ -207,14 +207,14 @@ class ComputeService(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/edit_connectivity_service', + return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/EditConnectivityService', service__pb2.Service.SerializeToString, service__pb2.ServiceId.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def delete_connectivity_service(request, + def DeleteConnectivityService(request, target, options=(), channel_credentials=None, @@ -224,14 +224,14 @@ class ComputeService(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/delete_connectivity_service', + return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/DeleteConnectivityService', service__pb2.Service.SerializeToString, context__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def get_all_active_connectivity_services(request, + def GetAllActiveConnectivityServices(request, target, options=(), channel_credentials=None, @@ -241,14 +241,14 @@ class ComputeService(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/get_all_active_connectivity_services', + return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/GetAllActiveConnectivityServices', context__pb2.Empty.SerializeToString, service__pb2.ServiceIdList.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def clear_all_connectivity_services(request, + def ClearAllConnectivityServices(request, target, options=(), channel_credentials=None, @@ -258,7 +258,7 @@ class ComputeService(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/clear_all_connectivity_services', + return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/ClearAllConnectivityServices', context__pb2.Empty.SerializeToString, context__pb2.Empty.FromString, options, channel_credentials, diff --git a/src/compute/service/ComputeServiceServicerImpl.py b/src/compute/service/ComputeServiceServicerImpl.py index 5d00031b9..a736d5770 100644 --- a/src/compute/service/ComputeServiceServicerImpl.py +++ b/src/compute/service/ComputeServiceServicerImpl.py @@ -106,12 +106,12 @@ class ComputeServiceServicerImpl(ComputeServiceServicer): LOGGER.info('Servicer Created') @CHECKCREDENTIALS_HISTOGRAM_DURATION.time() - def check_credentials( + def CheckCredentials( self, request : TeraFlowController, grpc_context : grpc.ServicerContext) -> AuthenticationResult: CHECKCREDENTIALS_COUNTER_STARTED.inc() try: - LOGGER.info('check_credentials request: {}'.format(str(request))) + LOGGER.info('CheckCredentials request: {}'.format(str(request))) LOGGER.warning('NOT IMPLEMENTED') # ----- Validate request data and pre-conditions ----------------------------------------------------------- @@ -120,25 +120,25 @@ class ComputeServiceServicerImpl(ComputeServiceServicer): # ----- Compose reply -------------------------------------------------------------------------------------- reply = AuthenticationResult() - LOGGER.info('check_credentials reply: {}'.format(str(reply))) + LOGGER.info('CheckCredentials reply: {}'.format(str(reply))) CHECKCREDENTIALS_COUNTER_COMPLETED.inc() return reply except ServiceException as e: # pragma: no cover (ServiceException not thrown) - LOGGER.exception('check_credentials exception') + LOGGER.exception('CheckCredentials exception') CHECKCREDENTIALS_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('check_credentials exception') + LOGGER.exception('CheckCredentials exception') CHECKCREDENTIALS_COUNTER_FAILED.inc() grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) @GETCONNECTIVITYSERVICESTATUS_HISTOGRAM_DURATION.time() - def get_connectivity_service_status( + def GetConnectivityServiceStatus( self, request : ServiceId, grpc_context : grpc.ServicerContext) -> ServiceState: GETCONNECTIVITYSERVICESTATUS_COUNTER_STARTED.inc() try: - LOGGER.info('get_connectivity_service_status request: {}'.format(str(request))) + LOGGER.info('GetConnectivityServiceStatus request: {}'.format(str(request))) LOGGER.warning('NOT IMPLEMENTED') # ----- Validate request data and pre-conditions ----------------------------------------------------------- @@ -147,25 +147,25 @@ class ComputeServiceServicerImpl(ComputeServiceServicer): # ----- Compose reply -------------------------------------------------------------------------------------- reply = ServiceState() - LOGGER.info('get_connectivity_service_status reply: {}'.format(str(reply))) + LOGGER.info('GetConnectivityServiceStatus reply: {}'.format(str(reply))) GETCONNECTIVITYSERVICESTATUS_COUNTER_COMPLETED.inc() return reply except ServiceException as e: # pragma: no cover (ServiceException not thrown) - LOGGER.exception('get_connectivity_service_status exception') + LOGGER.exception('GetConnectivityServiceStatus exception') GETCONNECTIVITYSERVICESTATUS_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('get_connectivity_service_status exception') + LOGGER.exception('GetConnectivityServiceStatus exception') GETCONNECTIVITYSERVICESTATUS_COUNTER_FAILED.inc() grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) @CREATECONNECTIVITYSERVICE_HISTOGRAM_DURATION.time() - def create_connectivity_service( + def CreateConnectivityService( self, request : Service, grpc_context : grpc.ServicerContext) -> ServiceId: CREATECONNECTIVITYSERVICE_COUNTER_STARTED.inc() try: - LOGGER.info('create_connectivity_service request: {}'.format(str(request))) + LOGGER.info('CreateConnectivityService request: {}'.format(str(request))) LOGGER.warning('NOT IMPLEMENTED') # ----- Validate request data and pre-conditions ----------------------------------------------------------- @@ -174,25 +174,25 @@ class ComputeServiceServicerImpl(ComputeServiceServicer): # ----- Compose reply -------------------------------------------------------------------------------------- reply = ServiceId() - LOGGER.info('create_connectivity_service reply: {}'.format(str(reply))) + LOGGER.info('CreateConnectivityService reply: {}'.format(str(reply))) CREATECONNECTIVITYSERVICE_COUNTER_COMPLETED.inc() return reply except ServiceException as e: # pragma: no cover (ServiceException not thrown) - LOGGER.exception('create_connectivity_service exception') + LOGGER.exception('CreateConnectivityService exception') CREATECONNECTIVITYSERVICE_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('create_connectivity_service exception') + LOGGER.exception('CreateConnectivityService exception') CREATECONNECTIVITYSERVICE_COUNTER_FAILED.inc() grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) @EDITCONNECTIVITYSERVICE_HISTOGRAM_DURATION.time() - def edit_connectivity_service( + def EditConnectivityService( self, request : Service, grpc_context : grpc.ServicerContext) -> ServiceId: EDITCONNECTIVITYSERVICE_COUNTER_STARTED.inc() try: - LOGGER.info('edit_connectivity_service request: {}'.format(str(request))) + LOGGER.info('EditConnectivityService request: {}'.format(str(request))) LOGGER.warning('NOT IMPLEMENTED') # ----- Validate request data and pre-conditions ----------------------------------------------------------- @@ -201,25 +201,25 @@ class ComputeServiceServicerImpl(ComputeServiceServicer): # ----- Compose reply -------------------------------------------------------------------------------------- reply = ServiceId() - LOGGER.info('edit_connectivity_service reply: {}'.format(str(reply))) + LOGGER.info('EditConnectivityService reply: {}'.format(str(reply))) EDITCONNECTIVITYSERVICE_COUNTER_COMPLETED.inc() return reply except ServiceException as e: # pragma: no cover (ServiceException not thrown) - LOGGER.exception('edit_connectivity_service exception') + LOGGER.exception('EditConnectivityService exception') EDITCONNECTIVITYSERVICE_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('edit_connectivity_service exception') + LOGGER.exception('EditConnectivityService exception') EDITCONNECTIVITYSERVICE_COUNTER_FAILED.inc() grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) @DELETECONNECTIVITYSERVICE_HISTOGRAM_DURATION.time() - def delete_connectivity_service( + def DeleteConnectivityService( self, request : Service, grpc_context : grpc.ServicerContext) -> Empty: DELETECONNECTIVITYSERVICE_COUNTER_STARTED.inc() try: - LOGGER.info('delete_connectivity_service request: {}'.format(str(request))) + LOGGER.info('DeleteConnectivityService request: {}'.format(str(request))) LOGGER.warning('NOT IMPLEMENTED') # ----- Validate request data and pre-conditions ----------------------------------------------------------- @@ -228,25 +228,25 @@ class ComputeServiceServicerImpl(ComputeServiceServicer): # ----- Compose reply -------------------------------------------------------------------------------------- reply = Empty() - LOGGER.info('delete_connectivity_service reply: {}'.format(str(reply))) + LOGGER.info('DeleteConnectivityService reply: {}'.format(str(reply))) DELETECONNECTIVITYSERVICE_COUNTER_COMPLETED.inc() return reply except ServiceException as e: # pragma: no cover (ServiceException not thrown) - LOGGER.exception('delete_connectivity_service exception') + LOGGER.exception('DeleteConnectivityService exception') DELETECONNECTIVITYSERVICE_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('delete_connectivity_service exception') + LOGGER.exception('DeleteConnectivityService exception') DELETECONNECTIVITYSERVICE_COUNTER_FAILED.inc() grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) @GETALLACTIVECONNECTIVITYSERVICES_HISTOGRAM_DURATION.time() - def get_all_active_connectivity_services( + def GetAllActiveConnectivityServices( self, request : Empty, grpc_context : grpc.ServicerContext) -> ServiceIdList: GETALLACTIVECONNECTIVITYSERVICES_COUNTER_STARTED.inc() try: - LOGGER.info('get_all_active_connectivity_services request: {}'.format(str(request))) + LOGGER.info('GetAllActiveConnectivityServices request: {}'.format(str(request))) LOGGER.warning('NOT IMPLEMENTED') # ----- Validate request data and pre-conditions ----------------------------------------------------------- @@ -255,25 +255,25 @@ class ComputeServiceServicerImpl(ComputeServiceServicer): # ----- Compose reply -------------------------------------------------------------------------------------- reply = ServiceIdList() - LOGGER.info('get_all_active_connectivity_services reply: {}'.format(str(reply))) + LOGGER.info('GetAllActiveConnectivityServices reply: {}'.format(str(reply))) GETALLACTIVECONNECTIVITYSERVICES_COUNTER_COMPLETED.inc() return reply except ServiceException as e: # pragma: no cover (ServiceException not thrown) - LOGGER.exception('get_all_active_connectivity_services exception') + LOGGER.exception('GetAllActiveConnectivityServices exception') GETALLACTIVECONNECTIVITYSERVICES_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('get_all_active_connectivity_services exception') + LOGGER.exception('GetAllActiveConnectivityServices exception') GETALLACTIVECONNECTIVITYSERVICES_COUNTER_FAILED.inc() grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) @CLEARALLCONNECTIVITYSERVICES_HISTOGRAM_DURATION.time() - def clear_all_connectivity_services( + def ClearAllConnectivityServices( self, request : Empty, grpc_context : grpc.ServicerContext) -> Empty: CLEARALLCONNECTIVITYSERVICES_COUNTER_STARTED.inc() try: - LOGGER.info('clear_all_connectivity_services request: {}'.format(str(request))) + LOGGER.info('ClearAllConnectivityServices request: {}'.format(str(request))) LOGGER.warning('NOT IMPLEMENTED') # ----- Validate request data and pre-conditions ----------------------------------------------------------- @@ -282,14 +282,14 @@ class ComputeServiceServicerImpl(ComputeServiceServicer): # ----- Compose reply -------------------------------------------------------------------------------------- reply = Empty() - LOGGER.info('clear_all_connectivity_services reply: {}'.format(str(reply))) + LOGGER.info('ClearAllConnectivityServices reply: {}'.format(str(reply))) CLEARALLCONNECTIVITYSERVICES_COUNTER_COMPLETED.inc() return reply except ServiceException as e: # pragma: no cover (ServiceException not thrown) - LOGGER.exception('clear_all_connectivity_services exception') + LOGGER.exception('ClearAllConnectivityServices exception') CLEARALLCONNECTIVITYSERVICES_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('clear_all_connectivity_services exception') + LOGGER.exception('ClearAllConnectivityServices exception') CLEARALLCONNECTIVITYSERVICES_COUNTER_FAILED.inc() grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) -- GitLab