Newer
Older
grpcdemo / python / grpcdemo_pb2_grpc.py
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities

import grpcdemo_pb2 as grpcdemo__pb2


class HostCommandStub(object):
  """The date service

  """

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.runcommand = channel.unary_unary(
        '/HostCommand/runcommand',
        request_serializer=grpcdemo__pb2.Command.SerializeToString,
        response_deserializer=grpcdemo__pb2.Results.FromString,
        )


class HostCommandServicer(object):
  """The date service

  """

  def runcommand(self, request, context):
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_HostCommandServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'runcommand': grpc.unary_unary_rpc_method_handler(
          servicer.runcommand,
          request_deserializer=grpcdemo__pb2.Command.FromString,
          response_serializer=grpcdemo__pb2.Results.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'HostCommand', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))