summaryrefslogtreecommitdiff
path: root/src/buildstream/_protos/build/buildgrid/local_cas_pb2_grpc.py
blob: 2c39fc90029046e728513d77b5790259b727bc5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from buildstream._protos.build.buildgrid import local_cas_pb2 as build_dot_buildgrid_dot_local__cas__pb2


class LocalContentAddressableStorageStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.FetchMissingBlobs = channel.unary_unary(
                '/build.buildgrid.LocalContentAddressableStorage/FetchMissingBlobs',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.FetchMissingBlobsRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.FetchMissingBlobsResponse.FromString,
                )
        self.UploadMissingBlobs = channel.unary_unary(
                '/build.buildgrid.LocalContentAddressableStorage/UploadMissingBlobs',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.UploadMissingBlobsRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.UploadMissingBlobsResponse.FromString,
                )
        self.FetchTree = channel.unary_unary(
                '/build.buildgrid.LocalContentAddressableStorage/FetchTree',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.FetchTreeRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.FetchTreeResponse.FromString,
                )
        self.UploadTree = channel.unary_unary(
                '/build.buildgrid.LocalContentAddressableStorage/UploadTree',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.UploadTreeRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.UploadTreeResponse.FromString,
                )
        self.StageTree = channel.stream_stream(
                '/build.buildgrid.LocalContentAddressableStorage/StageTree',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.StageTreeRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.StageTreeResponse.FromString,
                )
        self.CaptureTree = channel.unary_unary(
                '/build.buildgrid.LocalContentAddressableStorage/CaptureTree',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.CaptureTreeRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.CaptureTreeResponse.FromString,
                )
        self.CaptureFiles = channel.unary_unary(
                '/build.buildgrid.LocalContentAddressableStorage/CaptureFiles',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.CaptureFilesRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.CaptureFilesResponse.FromString,
                )
        self.GetInstanceNameForRemote = channel.unary_unary(
                '/build.buildgrid.LocalContentAddressableStorage/GetInstanceNameForRemote',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemoteRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemoteResponse.FromString,
                )
        self.GetInstanceNameForRemotes = channel.unary_unary(
                '/build.buildgrid.LocalContentAddressableStorage/GetInstanceNameForRemotes',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemotesRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemotesResponse.FromString,
                )
        self.GetLocalDiskUsage = channel.unary_unary(
                '/build.buildgrid.LocalContentAddressableStorage/GetLocalDiskUsage',
                request_serializer=build_dot_buildgrid_dot_local__cas__pb2.GetLocalDiskUsageRequest.SerializeToString,
                response_deserializer=build_dot_buildgrid_dot_local__cas__pb2.GetLocalDiskUsageResponse.FromString,
                )


class LocalContentAddressableStorageServicer(object):
    """Missing associated documentation comment in .proto file."""

    def FetchMissingBlobs(self, request, context):
        """Fetch blobs from a remote CAS to the local cache.

        This request is equivalent to ByteStream `Read` or `BatchReadBlobs`
        requests, storing the downloaded blobs in the local cache.

        Requested blobs that failed to be downloaded will be listed in the
        response.

        Errors:
        * `INVALID_ARGUMENT`: The client attempted to download more than the
        server supported limit.

        Individual requests may return the following error, additionally:
        * `NOT_FOUND`: The requested blob is not present in the remote CAS.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UploadMissingBlobs(self, request, context):
        """Upload blobs from the local cache to a remote CAS.

        This request is equivalent to `FindMissingBlobs` followed by
        ByteStream `Write` or `BatchUpdateBlobs` requests.

        Blobs that failed to be uploaded will be listed in the response.

        Errors:
        * `INVALID_ARGUMENT`: The client attempted to upload more than the
        server supported limit.

        Individual requests may return the following error, additionally:
        * `NOT_FOUND`: The requested blob is not present in the local cache.
        * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FetchTree(self, request, context):
        """Fetch the entire directory tree rooted at a node from a remote CAS to the
        local cache.

        This request is equivalent to `GetTree`, storing the `Directory` objects
        in the local cache. Optionally, this will also fetch all blobs referenced
        by the `Directory` objects, equivalent to `FetchMissingBlobs`.

        If no remote CAS is available, this will check presence of the entire
        directory tree (and optionally also file blobs) in the local cache.

        * `NOT_FOUND`: The requested tree is not present in the CAS or incomplete.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UploadTree(self, request, context):
        """Upload the entire directory tree from the local cache to a remote CAS.

        This request is equivalent to `UploadMissingBlobs` for all blobs
        referenced by the specified tree (recursively).

        Errors:
        * `NOT_FOUND`: The requested tree root is not present in the local cache.
        * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the tree.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StageTree(self, request_iterator, context):
        """Stage a directory tree in the local filesystem.

        This makes the specified directory tree temporarily available for local
        filesystem access. It is implementation-defined whether this uses a
        userspace filesystem such as FUSE, hardlinking or a full copy.

        Missing blobs are fetched, if a CAS remote is configured.

        The staging starts when the server receives the initial request and
        it is ready to be used on the initial (non-error) response from the
        server.

        The server will clean up the staged directory when it either
        receives an additional request (with all fields unset) or when the
        stream is closed. The server will send an additional response after
        cleanup is complete.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CaptureTree(self, request, context):
        """Capture a directory tree from the local filesystem.

        This imports the specified path from the local filesystem into CAS.

        If a CAS remote is configured, the blobs are uploaded.
        The `bypass_local_cache` parameter is a hint to indicate whether the blobs
        shall be uploaded without first storing them in the local cache.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CaptureFiles(self, request, context):
        """Capture files from the local filesystem.

        This imports the specified paths from the local filesystem into CAS.

        If a CAS remote is configured, the blobs are uploaded.
        The `bypass_local_cache` parameter is a hint to indicate whether the blobs
        shall be uploaded without first storing them in the local cache.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetInstanceNameForRemote(self, request, context):
        """Configure remote CAS endpoint.

        This returns a string that can be used as instance_name to access the
        specified endpoint in further requests.

        DEPRECATED: Use `content_addressable_storage` in `GetInstanceNameForRemotes()`
        instead.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetInstanceNameForRemotes(self, request, context):
        """Configure remote endpoints.

        This returns a string that can be used as instance_name to access the
        specified endpoints in further requests.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLocalDiskUsage(self, request, context):
        """Query total space used by the local cache.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_LocalContentAddressableStorageServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'FetchMissingBlobs': grpc.unary_unary_rpc_method_handler(
                    servicer.FetchMissingBlobs,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.FetchMissingBlobsRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.FetchMissingBlobsResponse.SerializeToString,
            ),
            'UploadMissingBlobs': grpc.unary_unary_rpc_method_handler(
                    servicer.UploadMissingBlobs,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.UploadMissingBlobsRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.UploadMissingBlobsResponse.SerializeToString,
            ),
            'FetchTree': grpc.unary_unary_rpc_method_handler(
                    servicer.FetchTree,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.FetchTreeRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.FetchTreeResponse.SerializeToString,
            ),
            'UploadTree': grpc.unary_unary_rpc_method_handler(
                    servicer.UploadTree,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.UploadTreeRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.UploadTreeResponse.SerializeToString,
            ),
            'StageTree': grpc.stream_stream_rpc_method_handler(
                    servicer.StageTree,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.StageTreeRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.StageTreeResponse.SerializeToString,
            ),
            'CaptureTree': grpc.unary_unary_rpc_method_handler(
                    servicer.CaptureTree,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.CaptureTreeRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.CaptureTreeResponse.SerializeToString,
            ),
            'CaptureFiles': grpc.unary_unary_rpc_method_handler(
                    servicer.CaptureFiles,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.CaptureFilesRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.CaptureFilesResponse.SerializeToString,
            ),
            'GetInstanceNameForRemote': grpc.unary_unary_rpc_method_handler(
                    servicer.GetInstanceNameForRemote,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemoteRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemoteResponse.SerializeToString,
            ),
            'GetInstanceNameForRemotes': grpc.unary_unary_rpc_method_handler(
                    servicer.GetInstanceNameForRemotes,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemotesRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemotesResponse.SerializeToString,
            ),
            'GetLocalDiskUsage': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLocalDiskUsage,
                    request_deserializer=build_dot_buildgrid_dot_local__cas__pb2.GetLocalDiskUsageRequest.FromString,
                    response_serializer=build_dot_buildgrid_dot_local__cas__pb2.GetLocalDiskUsageResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'build.buildgrid.LocalContentAddressableStorage', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class LocalContentAddressableStorage(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def FetchMissingBlobs(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, '/build.buildgrid.LocalContentAddressableStorage/FetchMissingBlobs',
            build_dot_buildgrid_dot_local__cas__pb2.FetchMissingBlobsRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.FetchMissingBlobsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UploadMissingBlobs(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, '/build.buildgrid.LocalContentAddressableStorage/UploadMissingBlobs',
            build_dot_buildgrid_dot_local__cas__pb2.UploadMissingBlobsRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.UploadMissingBlobsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def FetchTree(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, '/build.buildgrid.LocalContentAddressableStorage/FetchTree',
            build_dot_buildgrid_dot_local__cas__pb2.FetchTreeRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.FetchTreeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UploadTree(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, '/build.buildgrid.LocalContentAddressableStorage/UploadTree',
            build_dot_buildgrid_dot_local__cas__pb2.UploadTreeRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.UploadTreeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StageTree(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/build.buildgrid.LocalContentAddressableStorage/StageTree',
            build_dot_buildgrid_dot_local__cas__pb2.StageTreeRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.StageTreeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CaptureTree(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, '/build.buildgrid.LocalContentAddressableStorage/CaptureTree',
            build_dot_buildgrid_dot_local__cas__pb2.CaptureTreeRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.CaptureTreeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CaptureFiles(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, '/build.buildgrid.LocalContentAddressableStorage/CaptureFiles',
            build_dot_buildgrid_dot_local__cas__pb2.CaptureFilesRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.CaptureFilesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetInstanceNameForRemote(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, '/build.buildgrid.LocalContentAddressableStorage/GetInstanceNameForRemote',
            build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemoteRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemoteResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetInstanceNameForRemotes(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, '/build.buildgrid.LocalContentAddressableStorage/GetInstanceNameForRemotes',
            build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemotesRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.GetInstanceNameForRemotesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetLocalDiskUsage(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, '/build.buildgrid.LocalContentAddressableStorage/GetLocalDiskUsage',
            build_dot_buildgrid_dot_local__cas__pb2.GetLocalDiskUsageRequest.SerializeToString,
            build_dot_buildgrid_dot_local__cas__pb2.GetLocalDiskUsageResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)