github.com/kchristidis/fabric@v1.0.4-0.20171028114726-837acd08cde1/bddtests/peer/admin_pb2_grpc.py (about)

     1  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
     2  import grpc
     3  from grpc.framework.common import cardinality
     4  from grpc.framework.interfaces.face import utilities as face_utilities
     5  
     6  import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2
     7  import peer.admin_pb2 as peer_dot_admin__pb2
     8  
     9  
    10  class AdminStub(object):
    11    """Interface exported by the server.
    12    """
    13  
    14    def __init__(self, channel):
    15      """Constructor.
    16  
    17      Args:
    18        channel: A grpc.Channel.
    19      """
    20      self.GetStatus = channel.unary_unary(
    21          '/protos.Admin/GetStatus',
    22          request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
    23          response_deserializer=peer_dot_admin__pb2.ServerStatus.FromString,
    24          )
    25      self.StartServer = channel.unary_unary(
    26          '/protos.Admin/StartServer',
    27          request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
    28          response_deserializer=peer_dot_admin__pb2.ServerStatus.FromString,
    29          )
    30      self.StopServer = channel.unary_unary(
    31          '/protos.Admin/StopServer',
    32          request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
    33          response_deserializer=peer_dot_admin__pb2.ServerStatus.FromString,
    34          )
    35      self.GetModuleLogLevel = channel.unary_unary(
    36          '/protos.Admin/GetModuleLogLevel',
    37          request_serializer=peer_dot_admin__pb2.LogLevelRequest.SerializeToString,
    38          response_deserializer=peer_dot_admin__pb2.LogLevelResponse.FromString,
    39          )
    40      self.SetModuleLogLevel = channel.unary_unary(
    41          '/protos.Admin/SetModuleLogLevel',
    42          request_serializer=peer_dot_admin__pb2.LogLevelRequest.SerializeToString,
    43          response_deserializer=peer_dot_admin__pb2.LogLevelResponse.FromString,
    44          )
    45  
    46  
    47  class AdminServicer(object):
    48    """Interface exported by the server.
    49    """
    50  
    51    def GetStatus(self, request, context):
    52      """Return the serve status.
    53      """
    54      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    55      context.set_details('Method not implemented!')
    56      raise NotImplementedError('Method not implemented!')
    57  
    58    def StartServer(self, request, context):
    59      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    60      context.set_details('Method not implemented!')
    61      raise NotImplementedError('Method not implemented!')
    62  
    63    def StopServer(self, request, context):
    64      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    65      context.set_details('Method not implemented!')
    66      raise NotImplementedError('Method not implemented!')
    67  
    68    def GetModuleLogLevel(self, request, context):
    69      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    70      context.set_details('Method not implemented!')
    71      raise NotImplementedError('Method not implemented!')
    72  
    73    def SetModuleLogLevel(self, request, context):
    74      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    75      context.set_details('Method not implemented!')
    76      raise NotImplementedError('Method not implemented!')
    77  
    78  
    79  def add_AdminServicer_to_server(servicer, server):
    80    rpc_method_handlers = {
    81        'GetStatus': grpc.unary_unary_rpc_method_handler(
    82            servicer.GetStatus,
    83            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
    84            response_serializer=peer_dot_admin__pb2.ServerStatus.SerializeToString,
    85        ),
    86        'StartServer': grpc.unary_unary_rpc_method_handler(
    87            servicer.StartServer,
    88            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
    89            response_serializer=peer_dot_admin__pb2.ServerStatus.SerializeToString,
    90        ),
    91        'StopServer': grpc.unary_unary_rpc_method_handler(
    92            servicer.StopServer,
    93            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
    94            response_serializer=peer_dot_admin__pb2.ServerStatus.SerializeToString,
    95        ),
    96        'GetModuleLogLevel': grpc.unary_unary_rpc_method_handler(
    97            servicer.GetModuleLogLevel,
    98            request_deserializer=peer_dot_admin__pb2.LogLevelRequest.FromString,
    99            response_serializer=peer_dot_admin__pb2.LogLevelResponse.SerializeToString,
   100        ),
   101        'SetModuleLogLevel': grpc.unary_unary_rpc_method_handler(
   102            servicer.SetModuleLogLevel,
   103            request_deserializer=peer_dot_admin__pb2.LogLevelRequest.FromString,
   104            response_serializer=peer_dot_admin__pb2.LogLevelResponse.SerializeToString,
   105        ),
   106    }
   107    generic_handler = grpc.method_handlers_generic_handler(
   108        'protos.Admin', rpc_method_handlers)
   109    server.add_generic_rpc_handlers((generic_handler,))