task_pb2_grpc.py 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
  2. """Client and server classes corresponding to protobuf-defined services."""
  3. import grpc
  4. import warnings
  5. from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
  6. import protos.task_pb2 as task__pb2
  7. GRPC_GENERATED_VERSION = '1.71.0'
  8. GRPC_VERSION = grpc.__version__
  9. _version_not_supported = False
  10. try:
  11. from grpc._utilities import first_version_is_lower
  12. _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
  13. except ImportError:
  14. _version_not_supported = True
  15. if _version_not_supported:
  16. raise RuntimeError(
  17. f'The grpc package installed is at version {GRPC_VERSION},'
  18. + f' but the generated code in task_pb2_grpc.py depends on'
  19. + f' grpcio>={GRPC_GENERATED_VERSION}.'
  20. + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
  21. + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
  22. )
  23. class TaskRunnerStub(object):
  24. """Missing associated documentation comment in .proto file."""
  25. def __init__(self, channel):
  26. """Constructor.
  27. Args:
  28. channel: A grpc.Channel.
  29. """
  30. self.StartContainer = channel.unary_unary(
  31. '/TaskRunner/StartContainer',
  32. request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
  33. response_deserializer=task__pb2.StartContainerResponse.FromString,
  34. _registered_method=True)
  35. self.StopContainer = channel.unary_unary(
  36. '/TaskRunner/StopContainer',
  37. request_serializer=task__pb2.StopContainerRequest.SerializeToString,
  38. response_deserializer=task__pb2.StopContainerResponse.FromString,
  39. _registered_method=True)
  40. self.RunCommand = channel.unary_stream(
  41. '/TaskRunner/RunCommand',
  42. request_serializer=task__pb2.RunCommandRequest.SerializeToString,
  43. response_deserializer=task__pb2.RunCommandResponse.FromString,
  44. _registered_method=True)
  45. self.FileExists = channel.unary_unary(
  46. '/TaskRunner/FileExists',
  47. request_serializer=task__pb2.FileExistsRequest.SerializeToString,
  48. response_deserializer=task__pb2.FileExistsResponse.FromString,
  49. _registered_method=True)
  50. self.GetFile = channel.unary_unary(
  51. '/TaskRunner/GetFile',
  52. request_serializer=task__pb2.GetFileRequest.SerializeToString,
  53. response_deserializer=task__pb2.GetFileResponse.FromString,
  54. _registered_method=True)
  55. self.PutFile = channel.unary_unary(
  56. '/TaskRunner/PutFile',
  57. request_serializer=task__pb2.PutFileRequest.SerializeToString,
  58. response_deserializer=task__pb2.PutFileResponse.FromString,
  59. _registered_method=True)
  60. class TaskRunnerServicer(object):
  61. """Missing associated documentation comment in .proto file."""
  62. def StartContainer(self, request, context):
  63. """Missing associated documentation comment in .proto file."""
  64. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  65. context.set_details('Method not implemented!')
  66. raise NotImplementedError('Method not implemented!')
  67. def StopContainer(self, request, context):
  68. """Missing associated documentation comment in .proto file."""
  69. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  70. context.set_details('Method not implemented!')
  71. raise NotImplementedError('Method not implemented!')
  72. def RunCommand(self, request, context):
  73. """Missing associated documentation comment in .proto file."""
  74. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  75. context.set_details('Method not implemented!')
  76. raise NotImplementedError('Method not implemented!')
  77. def FileExists(self, request, context):
  78. """Missing associated documentation comment in .proto file."""
  79. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  80. context.set_details('Method not implemented!')
  81. raise NotImplementedError('Method not implemented!')
  82. def GetFile(self, request, context):
  83. """Missing associated documentation comment in .proto file."""
  84. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  85. context.set_details('Method not implemented!')
  86. raise NotImplementedError('Method not implemented!')
  87. def PutFile(self, request, context):
  88. """Missing associated documentation comment in .proto file."""
  89. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  90. context.set_details('Method not implemented!')
  91. raise NotImplementedError('Method not implemented!')
  92. def add_TaskRunnerServicer_to_server(servicer, server):
  93. rpc_method_handlers = {
  94. 'StartContainer': grpc.unary_unary_rpc_method_handler(
  95. servicer.StartContainer,
  96. request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
  97. response_serializer=task__pb2.StartContainerResponse.SerializeToString,
  98. ),
  99. 'StopContainer': grpc.unary_unary_rpc_method_handler(
  100. servicer.StopContainer,
  101. request_deserializer=task__pb2.StopContainerRequest.FromString,
  102. response_serializer=task__pb2.StopContainerResponse.SerializeToString,
  103. ),
  104. 'RunCommand': grpc.unary_stream_rpc_method_handler(
  105. servicer.RunCommand,
  106. request_deserializer=task__pb2.RunCommandRequest.FromString,
  107. response_serializer=task__pb2.RunCommandResponse.SerializeToString,
  108. ),
  109. 'FileExists': grpc.unary_unary_rpc_method_handler(
  110. servicer.FileExists,
  111. request_deserializer=task__pb2.FileExistsRequest.FromString,
  112. response_serializer=task__pb2.FileExistsResponse.SerializeToString,
  113. ),
  114. 'GetFile': grpc.unary_unary_rpc_method_handler(
  115. servicer.GetFile,
  116. request_deserializer=task__pb2.GetFileRequest.FromString,
  117. response_serializer=task__pb2.GetFileResponse.SerializeToString,
  118. ),
  119. 'PutFile': grpc.unary_unary_rpc_method_handler(
  120. servicer.PutFile,
  121. request_deserializer=task__pb2.PutFileRequest.FromString,
  122. response_serializer=task__pb2.PutFileResponse.SerializeToString,
  123. ),
  124. }
  125. generic_handler = grpc.method_handlers_generic_handler(
  126. 'TaskRunner', rpc_method_handlers)
  127. server.add_generic_rpc_handlers((generic_handler,))
  128. server.add_registered_method_handlers('TaskRunner', rpc_method_handlers)
  129. # This class is part of an EXPERIMENTAL API.
  130. class TaskRunner(object):
  131. """Missing associated documentation comment in .proto file."""
  132. @staticmethod
  133. def StartContainer(request,
  134. target,
  135. options=(),
  136. channel_credentials=None,
  137. call_credentials=None,
  138. insecure=False,
  139. compression=None,
  140. wait_for_ready=None,
  141. timeout=None,
  142. metadata=None):
  143. return grpc.experimental.unary_unary(
  144. request,
  145. target,
  146. '/TaskRunner/StartContainer',
  147. google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
  148. task__pb2.StartContainerResponse.FromString,
  149. options,
  150. channel_credentials,
  151. insecure,
  152. call_credentials,
  153. compression,
  154. wait_for_ready,
  155. timeout,
  156. metadata,
  157. _registered_method=True)
  158. @staticmethod
  159. def StopContainer(request,
  160. target,
  161. options=(),
  162. channel_credentials=None,
  163. call_credentials=None,
  164. insecure=False,
  165. compression=None,
  166. wait_for_ready=None,
  167. timeout=None,
  168. metadata=None):
  169. return grpc.experimental.unary_unary(
  170. request,
  171. target,
  172. '/TaskRunner/StopContainer',
  173. task__pb2.StopContainerRequest.SerializeToString,
  174. task__pb2.StopContainerResponse.FromString,
  175. options,
  176. channel_credentials,
  177. insecure,
  178. call_credentials,
  179. compression,
  180. wait_for_ready,
  181. timeout,
  182. metadata,
  183. _registered_method=True)
  184. @staticmethod
  185. def RunCommand(request,
  186. target,
  187. options=(),
  188. channel_credentials=None,
  189. call_credentials=None,
  190. insecure=False,
  191. compression=None,
  192. wait_for_ready=None,
  193. timeout=None,
  194. metadata=None):
  195. return grpc.experimental.unary_stream(
  196. request,
  197. target,
  198. '/TaskRunner/RunCommand',
  199. task__pb2.RunCommandRequest.SerializeToString,
  200. task__pb2.RunCommandResponse.FromString,
  201. options,
  202. channel_credentials,
  203. insecure,
  204. call_credentials,
  205. compression,
  206. wait_for_ready,
  207. timeout,
  208. metadata,
  209. _registered_method=True)
  210. @staticmethod
  211. def FileExists(request,
  212. target,
  213. options=(),
  214. channel_credentials=None,
  215. call_credentials=None,
  216. insecure=False,
  217. compression=None,
  218. wait_for_ready=None,
  219. timeout=None,
  220. metadata=None):
  221. return grpc.experimental.unary_unary(
  222. request,
  223. target,
  224. '/TaskRunner/FileExists',
  225. task__pb2.FileExistsRequest.SerializeToString,
  226. task__pb2.FileExistsResponse.FromString,
  227. options,
  228. channel_credentials,
  229. insecure,
  230. call_credentials,
  231. compression,
  232. wait_for_ready,
  233. timeout,
  234. metadata,
  235. _registered_method=True)
  236. @staticmethod
  237. def GetFile(request,
  238. target,
  239. options=(),
  240. channel_credentials=None,
  241. call_credentials=None,
  242. insecure=False,
  243. compression=None,
  244. wait_for_ready=None,
  245. timeout=None,
  246. metadata=None):
  247. return grpc.experimental.unary_unary(
  248. request,
  249. target,
  250. '/TaskRunner/GetFile',
  251. task__pb2.GetFileRequest.SerializeToString,
  252. task__pb2.GetFileResponse.FromString,
  253. options,
  254. channel_credentials,
  255. insecure,
  256. call_credentials,
  257. compression,
  258. wait_for_ready,
  259. timeout,
  260. metadata,
  261. _registered_method=True)
  262. @staticmethod
  263. def PutFile(request,
  264. target,
  265. options=(),
  266. channel_credentials=None,
  267. call_credentials=None,
  268. insecure=False,
  269. compression=None,
  270. wait_for_ready=None,
  271. timeout=None,
  272. metadata=None):
  273. return grpc.experimental.unary_unary(
  274. request,
  275. target,
  276. '/TaskRunner/PutFile',
  277. task__pb2.PutFileRequest.SerializeToString,
  278. task__pb2.PutFileResponse.FromString,
  279. options,
  280. channel_credentials,
  281. insecure,
  282. call_credentials,
  283. compression,
  284. wait_for_ready,
  285. timeout,
  286. metadata,
  287. _registered_method=True)