container_pb2_grpc.py 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  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. import protos.container_pb2 as container__pb2
  6. from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
  7. GRPC_GENERATED_VERSION = '1.74.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 container_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 ContainerServiceStub(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. '/protos.ContainerService/StartContainer',
  32. request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
  33. response_deserializer=container__pb2.StartContainerResponse.FromString,
  34. _registered_method=True)
  35. self.StopContainer = channel.unary_unary(
  36. '/protos.ContainerService/StopContainer',
  37. request_serializer=container__pb2.StopContainerRequest.SerializeToString,
  38. response_deserializer=container__pb2.StopContainerResponse.FromString,
  39. _registered_method=True)
  40. self.RunCommand = channel.unary_stream(
  41. '/protos.ContainerService/RunCommand',
  42. request_serializer=container__pb2.RunCommandRequest.SerializeToString,
  43. response_deserializer=container__pb2.RunCommandResponse.FromString,
  44. _registered_method=True)
  45. self.FileExists = channel.unary_unary(
  46. '/protos.ContainerService/FileExists',
  47. request_serializer=container__pb2.FileExistsRequest.SerializeToString,
  48. response_deserializer=container__pb2.FileExistsResponse.FromString,
  49. _registered_method=True)
  50. self.GetFile = channel.unary_stream(
  51. '/protos.ContainerService/GetFile',
  52. request_serializer=container__pb2.GetFileRequest.SerializeToString,
  53. response_deserializer=container__pb2.ReusableChunk.FromString,
  54. _registered_method=True)
  55. self.PutFile = channel.stream_unary(
  56. '/protos.ContainerService/PutFile',
  57. request_serializer=container__pb2.ReusableChunk.SerializeToString,
  58. response_deserializer=container__pb2.PutFileResponse.FromString,
  59. _registered_method=True)
  60. self.DownloadOss = channel.unary_unary(
  61. '/protos.ContainerService/DownloadOss',
  62. request_serializer=container__pb2.DownloadOssRequest.SerializeToString,
  63. response_deserializer=container__pb2.DownloadOssResponse.FromString,
  64. _registered_method=True)
  65. self.UploadOss = channel.unary_unary(
  66. '/protos.ContainerService/UploadOss',
  67. request_serializer=container__pb2.UploadOssRequest.SerializeToString,
  68. response_deserializer=container__pb2.UploadOssResponse.FromString,
  69. _registered_method=True)
  70. class ContainerServiceServicer(object):
  71. """Missing associated documentation comment in .proto file."""
  72. def StartContainer(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 StopContainer(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 RunCommand(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 FileExists(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 GetFile(self, request, context):
  93. """Missing associated documentation comment in .proto file."""
  94. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  95. context.set_details('Method not implemented!')
  96. raise NotImplementedError('Method not implemented!')
  97. def PutFile(self, request_iterator, context):
  98. """Missing associated documentation comment in .proto file."""
  99. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  100. context.set_details('Method not implemented!')
  101. raise NotImplementedError('Method not implemented!')
  102. def DownloadOss(self, request, context):
  103. """Missing associated documentation comment in .proto file."""
  104. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  105. context.set_details('Method not implemented!')
  106. raise NotImplementedError('Method not implemented!')
  107. def UploadOss(self, request, context):
  108. """Missing associated documentation comment in .proto file."""
  109. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  110. context.set_details('Method not implemented!')
  111. raise NotImplementedError('Method not implemented!')
  112. def add_ContainerServiceServicer_to_server(servicer, server):
  113. rpc_method_handlers = {
  114. 'StartContainer': grpc.unary_unary_rpc_method_handler(
  115. servicer.StartContainer,
  116. request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
  117. response_serializer=container__pb2.StartContainerResponse.SerializeToString,
  118. ),
  119. 'StopContainer': grpc.unary_unary_rpc_method_handler(
  120. servicer.StopContainer,
  121. request_deserializer=container__pb2.StopContainerRequest.FromString,
  122. response_serializer=container__pb2.StopContainerResponse.SerializeToString,
  123. ),
  124. 'RunCommand': grpc.unary_stream_rpc_method_handler(
  125. servicer.RunCommand,
  126. request_deserializer=container__pb2.RunCommandRequest.FromString,
  127. response_serializer=container__pb2.RunCommandResponse.SerializeToString,
  128. ),
  129. 'FileExists': grpc.unary_unary_rpc_method_handler(
  130. servicer.FileExists,
  131. request_deserializer=container__pb2.FileExistsRequest.FromString,
  132. response_serializer=container__pb2.FileExistsResponse.SerializeToString,
  133. ),
  134. 'GetFile': grpc.unary_stream_rpc_method_handler(
  135. servicer.GetFile,
  136. request_deserializer=container__pb2.GetFileRequest.FromString,
  137. response_serializer=container__pb2.ReusableChunk.SerializeToString,
  138. ),
  139. 'PutFile': grpc.stream_unary_rpc_method_handler(
  140. servicer.PutFile,
  141. request_deserializer=container__pb2.ReusableChunk.FromString,
  142. response_serializer=container__pb2.PutFileResponse.SerializeToString,
  143. ),
  144. 'DownloadOss': grpc.unary_unary_rpc_method_handler(
  145. servicer.DownloadOss,
  146. request_deserializer=container__pb2.DownloadOssRequest.FromString,
  147. response_serializer=container__pb2.DownloadOssResponse.SerializeToString,
  148. ),
  149. 'UploadOss': grpc.unary_unary_rpc_method_handler(
  150. servicer.UploadOss,
  151. request_deserializer=container__pb2.UploadOssRequest.FromString,
  152. response_serializer=container__pb2.UploadOssResponse.SerializeToString,
  153. ),
  154. }
  155. generic_handler = grpc.method_handlers_generic_handler(
  156. 'protos.ContainerService', rpc_method_handlers)
  157. server.add_generic_rpc_handlers((generic_handler,))
  158. server.add_registered_method_handlers('protos.ContainerService', rpc_method_handlers)
  159. # This class is part of an EXPERIMENTAL API.
  160. class ContainerService(object):
  161. """Missing associated documentation comment in .proto file."""
  162. @staticmethod
  163. def StartContainer(request,
  164. target,
  165. options=(),
  166. channel_credentials=None,
  167. call_credentials=None,
  168. insecure=False,
  169. compression=None,
  170. wait_for_ready=None,
  171. timeout=None,
  172. metadata=None):
  173. return grpc.experimental.unary_unary(
  174. request,
  175. target,
  176. '/protos.ContainerService/StartContainer',
  177. google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
  178. container__pb2.StartContainerResponse.FromString,
  179. options,
  180. channel_credentials,
  181. insecure,
  182. call_credentials,
  183. compression,
  184. wait_for_ready,
  185. timeout,
  186. metadata,
  187. _registered_method=True)
  188. @staticmethod
  189. def StopContainer(request,
  190. target,
  191. options=(),
  192. channel_credentials=None,
  193. call_credentials=None,
  194. insecure=False,
  195. compression=None,
  196. wait_for_ready=None,
  197. timeout=None,
  198. metadata=None):
  199. return grpc.experimental.unary_unary(
  200. request,
  201. target,
  202. '/protos.ContainerService/StopContainer',
  203. container__pb2.StopContainerRequest.SerializeToString,
  204. container__pb2.StopContainerResponse.FromString,
  205. options,
  206. channel_credentials,
  207. insecure,
  208. call_credentials,
  209. compression,
  210. wait_for_ready,
  211. timeout,
  212. metadata,
  213. _registered_method=True)
  214. @staticmethod
  215. def RunCommand(request,
  216. target,
  217. options=(),
  218. channel_credentials=None,
  219. call_credentials=None,
  220. insecure=False,
  221. compression=None,
  222. wait_for_ready=None,
  223. timeout=None,
  224. metadata=None):
  225. return grpc.experimental.unary_stream(
  226. request,
  227. target,
  228. '/protos.ContainerService/RunCommand',
  229. container__pb2.RunCommandRequest.SerializeToString,
  230. container__pb2.RunCommandResponse.FromString,
  231. options,
  232. channel_credentials,
  233. insecure,
  234. call_credentials,
  235. compression,
  236. wait_for_ready,
  237. timeout,
  238. metadata,
  239. _registered_method=True)
  240. @staticmethod
  241. def FileExists(request,
  242. target,
  243. options=(),
  244. channel_credentials=None,
  245. call_credentials=None,
  246. insecure=False,
  247. compression=None,
  248. wait_for_ready=None,
  249. timeout=None,
  250. metadata=None):
  251. return grpc.experimental.unary_unary(
  252. request,
  253. target,
  254. '/protos.ContainerService/FileExists',
  255. container__pb2.FileExistsRequest.SerializeToString,
  256. container__pb2.FileExistsResponse.FromString,
  257. options,
  258. channel_credentials,
  259. insecure,
  260. call_credentials,
  261. compression,
  262. wait_for_ready,
  263. timeout,
  264. metadata,
  265. _registered_method=True)
  266. @staticmethod
  267. def GetFile(request,
  268. target,
  269. options=(),
  270. channel_credentials=None,
  271. call_credentials=None,
  272. insecure=False,
  273. compression=None,
  274. wait_for_ready=None,
  275. timeout=None,
  276. metadata=None):
  277. return grpc.experimental.unary_stream(
  278. request,
  279. target,
  280. '/protos.ContainerService/GetFile',
  281. container__pb2.GetFileRequest.SerializeToString,
  282. container__pb2.ReusableChunk.FromString,
  283. options,
  284. channel_credentials,
  285. insecure,
  286. call_credentials,
  287. compression,
  288. wait_for_ready,
  289. timeout,
  290. metadata,
  291. _registered_method=True)
  292. @staticmethod
  293. def PutFile(request_iterator,
  294. target,
  295. options=(),
  296. channel_credentials=None,
  297. call_credentials=None,
  298. insecure=False,
  299. compression=None,
  300. wait_for_ready=None,
  301. timeout=None,
  302. metadata=None):
  303. return grpc.experimental.stream_unary(
  304. request_iterator,
  305. target,
  306. '/protos.ContainerService/PutFile',
  307. container__pb2.ReusableChunk.SerializeToString,
  308. container__pb2.PutFileResponse.FromString,
  309. options,
  310. channel_credentials,
  311. insecure,
  312. call_credentials,
  313. compression,
  314. wait_for_ready,
  315. timeout,
  316. metadata,
  317. _registered_method=True)
  318. @staticmethod
  319. def DownloadOss(request,
  320. target,
  321. options=(),
  322. channel_credentials=None,
  323. call_credentials=None,
  324. insecure=False,
  325. compression=None,
  326. wait_for_ready=None,
  327. timeout=None,
  328. metadata=None):
  329. return grpc.experimental.unary_unary(
  330. request,
  331. target,
  332. '/protos.ContainerService/DownloadOss',
  333. container__pb2.DownloadOssRequest.SerializeToString,
  334. container__pb2.DownloadOssResponse.FromString,
  335. options,
  336. channel_credentials,
  337. insecure,
  338. call_credentials,
  339. compression,
  340. wait_for_ready,
  341. timeout,
  342. metadata,
  343. _registered_method=True)
  344. @staticmethod
  345. def UploadOss(request,
  346. target,
  347. options=(),
  348. channel_credentials=None,
  349. call_credentials=None,
  350. insecure=False,
  351. compression=None,
  352. wait_for_ready=None,
  353. timeout=None,
  354. metadata=None):
  355. return grpc.experimental.unary_unary(
  356. request,
  357. target,
  358. '/protos.ContainerService/UploadOss',
  359. container__pb2.UploadOssRequest.SerializeToString,
  360. container__pb2.UploadOssResponse.FromString,
  361. options,
  362. channel_credentials,
  363. insecure,
  364. call_credentials,
  365. compression,
  366. wait_for_ready,
  367. timeout,
  368. metadata,
  369. _registered_method=True)