Loading src/automation/service/AutomationServiceServicerImpl.py +14 −6 Original line number Diff line number Diff line Loading @@ -12,10 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging, os, grpc import grpc , logging, os, grpc from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.method_wrappers.Decorator import MetricsPool from common.proto.automation_pb2_grpc import AutomationServiceServicer from common.proto.automation_pb2 import ( ZSMCreateRequest , ZSMService ,ZSMServiceID ,ZSMServiceState,ZSMCreateUpdate , ZSMServiceStateEnum) from common.proto.context_pb2 import ( ServiceId , ContextId , Uuid , Empty) from common.proto.policy_pb2 import ( PolicyRuleList) LOGGER = logging.getLogger(__name__) METRICS_POOL = MetricsPool('Automation', 'RPC') Loading @@ -23,22 +26,27 @@ METRICS_POOL = MetricsPool('Automation', 'RPC') class AutomationServiceServicerImpl(AutomationServiceServicer): @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMCreate(self) -> None: def ZSMCreate(self, request : ZSMCreateRequest, context : grpc.ServicerContext) -> ZSMService: LOGGER.info('NOT IMPLEMENTED ZSMCreate') return ZSMService() @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMUpdate(self) -> None: def ZSMUpdate(self, request : ZSMCreateUpdate, context : grpc.ServicerContext) -> ZSMService: LOGGER.info('NOT IMPLEMENTED ZSMUpdate') return ZSMService() @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMDelete(self) -> None: def ZSMDelete(self, request : ZSMServiceID, context : grpc.ServicerContext) -> ZSMServiceState: LOGGER.info('NOT IMPLEMENTED ZSMDelete') return ZSMServiceState() @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMGetById(self) -> None: def ZSMGetById(self, request : ZSMServiceID, context : grpc.ServicerContext) -> ZSMService: LOGGER.info('NOT IMPLEMENTED ZSMGetById') return ZSMService() @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMGetByService(self) -> None: def ZSMGetByService(self, request : ServiceId, context : grpc.ServicerContext) -> ZSMService: LOGGER.info('NOT IMPLEMENTED ZSMGetByService') return ZSMService() Loading
src/automation/service/AutomationServiceServicerImpl.py +14 −6 Original line number Diff line number Diff line Loading @@ -12,10 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging, os, grpc import grpc , logging, os, grpc from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.method_wrappers.Decorator import MetricsPool from common.proto.automation_pb2_grpc import AutomationServiceServicer from common.proto.automation_pb2 import ( ZSMCreateRequest , ZSMService ,ZSMServiceID ,ZSMServiceState,ZSMCreateUpdate , ZSMServiceStateEnum) from common.proto.context_pb2 import ( ServiceId , ContextId , Uuid , Empty) from common.proto.policy_pb2 import ( PolicyRuleList) LOGGER = logging.getLogger(__name__) METRICS_POOL = MetricsPool('Automation', 'RPC') Loading @@ -23,22 +26,27 @@ METRICS_POOL = MetricsPool('Automation', 'RPC') class AutomationServiceServicerImpl(AutomationServiceServicer): @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMCreate(self) -> None: def ZSMCreate(self, request : ZSMCreateRequest, context : grpc.ServicerContext) -> ZSMService: LOGGER.info('NOT IMPLEMENTED ZSMCreate') return ZSMService() @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMUpdate(self) -> None: def ZSMUpdate(self, request : ZSMCreateUpdate, context : grpc.ServicerContext) -> ZSMService: LOGGER.info('NOT IMPLEMENTED ZSMUpdate') return ZSMService() @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMDelete(self) -> None: def ZSMDelete(self, request : ZSMServiceID, context : grpc.ServicerContext) -> ZSMServiceState: LOGGER.info('NOT IMPLEMENTED ZSMDelete') return ZSMServiceState() @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMGetById(self) -> None: def ZSMGetById(self, request : ZSMServiceID, context : grpc.ServicerContext) -> ZSMService: LOGGER.info('NOT IMPLEMENTED ZSMGetById') return ZSMService() @safe_and_metered_rpc_method(METRICS_POOL,LOGGER) def ZSMGetByService(self) -> None: def ZSMGetByService(self, request : ServiceId, context : grpc.ServicerContext) -> ZSMService: LOGGER.info('NOT IMPLEMENTED ZSMGetByService') return ZSMService()