OLD | NEW |
| (Empty) |
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 isolate_bot_pb2 as isolate__bot__pb2 | |
7 | |
8 | |
9 class FileServiceStub(object): | |
10 """FileService exposes the main operations of an Isolate server | |
11 to upload and download blobs. | |
12 """ | |
13 | |
14 def __init__(self, channel): | |
15 """Constructor. | |
16 | |
17 Args: | |
18 channel: A grpc.Channel. | |
19 """ | |
20 self.Contains = channel.unary_unary( | |
21 '/luci.swarming.bot.FileService/Contains', | |
22 request_serializer=isolate__bot__pb2.ContainsRequest.SerializeToString, | |
23 response_deserializer=isolate__bot__pb2.ContainsReply.FromString, | |
24 ) | |
25 self.PushBlobs = channel.stream_unary( | |
26 '/luci.swarming.bot.FileService/PushBlobs', | |
27 request_serializer=isolate__bot__pb2.PushBlobsRequest.SerializeToString, | |
28 response_deserializer=isolate__bot__pb2.PushBlobsReply.FromString, | |
29 ) | |
30 self.FetchBlobs = channel.unary_stream( | |
31 '/luci.swarming.bot.FileService/FetchBlobs', | |
32 request_serializer=isolate__bot__pb2.FetchBlobsRequest.SerializeToString
, | |
33 response_deserializer=isolate__bot__pb2.FetchBlobsReply.FromString, | |
34 ) | |
35 | |
36 | |
37 class FileServiceServicer(object): | |
38 """FileService exposes the main operations of an Isolate server | |
39 to upload and download blobs. | |
40 """ | |
41 | |
42 def Contains(self, request, context): | |
43 """Unlike in the native Isolate API, it is not *necessary* to | |
44 call Contains prior to pushing a blob, as Contains does not | |
45 return "upload tickets." The BlobStatus returned by Contains | |
46 will have succeeded = True if all digests were found, and | |
47 false for any other reason (missing blobs, network error, | |
48 etc.) | |
49 """ | |
50 context.set_code(grpc.StatusCode.UNIMPLEMENTED) | |
51 context.set_details('Method not implemented!') | |
52 raise NotImplementedError('Method not implemented!') | |
53 | |
54 def PushBlobs(self, request_iterator, context): | |
55 """PushBlobs can push one or more blobs at a time (serially), | |
56 with each blob transmitted as one or more chunks. At the | |
57 beginning of a new blob, the chunk offset should be zero | |
58 and the digest must be provided. The function returns true | |
59 only if all blobs are successfully received, and returns | |
60 as soon as an error occurs. | |
61 """ | |
62 context.set_code(grpc.StatusCode.UNIMPLEMENTED) | |
63 context.set_details('Method not implemented!') | |
64 raise NotImplementedError('Method not implemented!') | |
65 | |
66 def FetchBlobs(self, request, context): | |
67 """FetchBlobs takes a list of digests and returns them all as | |
68 a stream of BlobChunks. | |
69 """ | |
70 context.set_code(grpc.StatusCode.UNIMPLEMENTED) | |
71 context.set_details('Method not implemented!') | |
72 raise NotImplementedError('Method not implemented!') | |
73 | |
74 | |
75 def add_FileServiceServicer_to_server(servicer, server): | |
76 rpc_method_handlers = { | |
77 'Contains': grpc.unary_unary_rpc_method_handler( | |
78 servicer.Contains, | |
79 request_deserializer=isolate__bot__pb2.ContainsRequest.FromString, | |
80 response_serializer=isolate__bot__pb2.ContainsReply.SerializeToString, | |
81 ), | |
82 'PushBlobs': grpc.stream_unary_rpc_method_handler( | |
83 servicer.PushBlobs, | |
84 request_deserializer=isolate__bot__pb2.PushBlobsRequest.FromString, | |
85 response_serializer=isolate__bot__pb2.PushBlobsReply.SerializeToString
, | |
86 ), | |
87 'FetchBlobs': grpc.unary_stream_rpc_method_handler( | |
88 servicer.FetchBlobs, | |
89 request_deserializer=isolate__bot__pb2.FetchBlobsRequest.FromString, | |
90 response_serializer=isolate__bot__pb2.FetchBlobsReply.SerializeToStrin
g, | |
91 ), | |
92 } | |
93 generic_handler = grpc.method_handlers_generic_handler( | |
94 'luci.swarming.bot.FileService', rpc_method_handlers) | |
95 server.add_generic_rpc_handlers((generic_handler,)) | |
OLD | NEW |