# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc import control_pb2 as control__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 class ControlServiceStub(object): """////////////////////////////////////////////////////////////////// agent client ////////////////////////////////////////////////////////////////// """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetNextTask = channel.unary_unary( '/scalebox.ControlService/GetNextTask', request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, response_deserializer=control__pb2.TaskItem.FromString, ) self.SetTaskStarted = channel.unary_unary( '/scalebox.ControlService/SetTaskStarted', request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int64Value.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, ) self.SetTaskFinished = channel.unary_unary( '/scalebox.ControlService/SetTaskFinished', request_serializer=control__pb2.TaskExecMessage.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, ) self.SetSlotTerminated = channel.unary_unary( '/scalebox.ControlService/SetSlotTerminated', request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, ) self.GetRunnableSlotList = channel.unary_unary( '/scalebox.ControlService/GetRunnableSlotList', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=control__pb2.CommandList.FromString, ) self.SetSlotInitialized = channel.unary_unary( '/scalebox.ControlService/SetSlotInitialized', request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, ) self.GetTerminableSlotList = channel.unary_unary( '/scalebox.ControlService/GetTerminableSlotList', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=control__pb2.CommandList.FromString, ) self.GetRunnableWorkerList = channel.unary_unary( '/scalebox.ControlService/GetRunnableWorkerList', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=control__pb2.CommandList.FromString, ) self.SetWorkerInitialized = channel.unary_unary( '/scalebox.ControlService/SetWorkerInitialized', request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, ) self.GetTerminableWorkerList = channel.unary_unary( '/scalebox.ControlService/GetTerminableWorkerList', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=control__pb2.CommandList.FromString, ) self.SetWorkerTerminated = channel.unary_unary( '/scalebox.ControlService/SetWorkerTerminated', request_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, ) self.SendJobMessage = channel.unary_unary( '/scalebox.ControlService/SendJobMessage', request_serializer=control__pb2.JobKey.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, ) self.SendJobMessages = channel.unary_unary( '/scalebox.ControlService/SendJobMessages', request_serializer=control__pb2.JobKeys.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, ) class ControlServiceServicer(object): """////////////////////////////////////////////////////////////////// agent client ////////////////////////////////////////////////////////////////// """ def GetNextTask(self, request, context): """input : slot id('ON') return : job-key of the task, id==0(NULL) task id : 'READY/-1' -> 'QUEUED/-2' """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SetTaskStarted(self, request, context): """input : task id('QUEUED/-2') return : ret_code : 0(OK), -1(task NOT FOUND), -2(WRONG STATUS) task_status_code:'QUEUED'/-2 -> 'RUNNING'/-3 """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SetTaskFinished(self, request, context): """input : TaskExecMessage return : ret_code : 0(OK), -1(task NOT FOUND), -2(task WRONG STATUS) task_status_code:'RUNNING'/-3 -> 'OK'/0, ... """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SetSlotTerminated(self, request, context): """slot exit automatically, called in agent side input : slot id return : ret_code : 0(OK), -1(slot NOT FOUND), -2(slot WRONG STATUS) slot : 'ON' -> 'OFF' """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetRunnableSlotList(self, request, context): """////////////////////////////////////////////////////////////////// actuator client ////////////////////////////////////////////////////////////////// input: token_string ? job:'RUNNING' && slot:'READY' """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SetSlotInitialized(self, request, context): """input : slot id return : ret_code : 0(OK), -1(slot NOT FOUND), -2(slot WRONG STATUS) slot: 'READY' -> 'ON' """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetTerminableSlotList(self, request, context): """job:'PAUSED'/'ARCHIVED' && slot:'ON' """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetRunnableWorkerList(self, request, context): """job:'RUNNING' && worker:'PAUSED' """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SetWorkerInitialized(self, request, context): """input : worker id return : ret_code : 0(OK), -1(worker NOT FOUND), -2(worker WRONG STATUS) worker: 'PAUSED' -> 'RUNNING' """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetTerminableWorkerList(self, request, context): """job:'PAUSED' && worker:'RUNNING' """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SetWorkerTerminated(self, request, context): """input : worker id, return ret_code; return : ret_code : 0(OK), -1(worker NOT FOUND), -2(worker WRONG STATUS) worker : 'RUNNING' -> 'PAUSED' """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SendJobMessage(self, request, context): """////////////////////////////////////////////////////////////////// app client , called by user app. ////////////////////////////////////////////////////////////////// send task-key to next job in current pipeline return : ret_code : 0(OK), -1(job NOT FOUND) task_status_code : 'INITIAL'/-9 rpc SendToNextJob(JobKey) returns (google.protobuf.Int32Value); """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SendJobMessages(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 add_ControlServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'GetNextTask': grpc.unary_unary_rpc_method_handler( servicer.GetNextTask, request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, response_serializer=control__pb2.TaskItem.SerializeToString, ), 'SetTaskStarted': grpc.unary_unary_rpc_method_handler( servicer.SetTaskStarted, request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int64Value.FromString, response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, ), 'SetTaskFinished': grpc.unary_unary_rpc_method_handler( servicer.SetTaskFinished, request_deserializer=control__pb2.TaskExecMessage.FromString, response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, ), 'SetSlotTerminated': grpc.unary_unary_rpc_method_handler( servicer.SetSlotTerminated, request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, ), 'GetRunnableSlotList': grpc.unary_unary_rpc_method_handler( servicer.GetRunnableSlotList, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, response_serializer=control__pb2.CommandList.SerializeToString, ), 'SetSlotInitialized': grpc.unary_unary_rpc_method_handler( servicer.SetSlotInitialized, request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, ), 'GetTerminableSlotList': grpc.unary_unary_rpc_method_handler( servicer.GetTerminableSlotList, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, response_serializer=control__pb2.CommandList.SerializeToString, ), 'GetRunnableWorkerList': grpc.unary_unary_rpc_method_handler( servicer.GetRunnableWorkerList, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, response_serializer=control__pb2.CommandList.SerializeToString, ), 'SetWorkerInitialized': grpc.unary_unary_rpc_method_handler( servicer.SetWorkerInitialized, request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, ), 'GetTerminableWorkerList': grpc.unary_unary_rpc_method_handler( servicer.GetTerminableWorkerList, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, response_serializer=control__pb2.CommandList.SerializeToString, ), 'SetWorkerTerminated': grpc.unary_unary_rpc_method_handler( servicer.SetWorkerTerminated, request_deserializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, ), 'SendJobMessage': grpc.unary_unary_rpc_method_handler( servicer.SendJobMessage, request_deserializer=control__pb2.JobKey.FromString, response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, ), 'SendJobMessages': grpc.unary_unary_rpc_method_handler( servicer.SendJobMessages, request_deserializer=control__pb2.JobKeys.FromString, response_serializer=google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'scalebox.ControlService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class ControlService(object): """////////////////////////////////////////////////////////////////// agent client ////////////////////////////////////////////////////////////////// """ @staticmethod def GetNextTask(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_unary(request, target, '/scalebox.ControlService/GetNextTask', google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, control__pb2.TaskItem.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SetTaskStarted(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_unary(request, target, '/scalebox.ControlService/SetTaskStarted', google_dot_protobuf_dot_wrappers__pb2.Int64Value.SerializeToString, google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SetTaskFinished(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_unary(request, target, '/scalebox.ControlService/SetTaskFinished', control__pb2.TaskExecMessage.SerializeToString, google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SetSlotTerminated(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_unary(request, target, '/scalebox.ControlService/SetSlotTerminated', google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetRunnableSlotList(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_unary(request, target, '/scalebox.ControlService/GetRunnableSlotList', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, control__pb2.CommandList.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SetSlotInitialized(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_unary(request, target, '/scalebox.ControlService/SetSlotInitialized', google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetTerminableSlotList(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_unary(request, target, '/scalebox.ControlService/GetTerminableSlotList', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, control__pb2.CommandList.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetRunnableWorkerList(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_unary(request, target, '/scalebox.ControlService/GetRunnableWorkerList', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, control__pb2.CommandList.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SetWorkerInitialized(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_unary(request, target, '/scalebox.ControlService/SetWorkerInitialized', google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetTerminableWorkerList(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_unary(request, target, '/scalebox.ControlService/GetTerminableWorkerList', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, control__pb2.CommandList.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SetWorkerTerminated(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_unary(request, target, '/scalebox.ControlService/SetWorkerTerminated', google_dot_protobuf_dot_wrappers__pb2.Int32Value.SerializeToString, google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SendJobMessage(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_unary(request, target, '/scalebox.ControlService/SendJobMessage', control__pb2.JobKey.SerializeToString, google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SendJobMessages(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_unary(request, target, '/scalebox.ControlService/SendJobMessages', control__pb2.JobKeys.SerializeToString, google_dot_protobuf_dot_wrappers__pb2.Int32Value.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)