summaryrefslogtreecommitdiff
path: root/src/buildstream/_protos/build/bazel/remote/asset/v1/remote_asset_pb2_grpc.py
blob: 38d31a2a1cf396ce4530a04ee57353b481c85edd (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
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from buildstream._protos.build.bazel.remote.asset.v1 import remote_asset_pb2 as build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2


class FetchStub(object):
    """The Fetch service resolves or fetches assets referenced by URI and
    Qualifiers, returning a Digest for the content in 
    [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].

    As with other services in the Remote Execution API, any call may return an
    error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
    information about when the client should retry the request; clients SHOULD
    respect the information provided.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.FetchBlob = channel.unary_unary(
                '/build.bazel.remote.asset.v1.Fetch/FetchBlob',
                request_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchBlobRequest.SerializeToString,
                response_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchBlobResponse.FromString,
                )
        self.FetchDirectory = channel.unary_unary(
                '/build.bazel.remote.asset.v1.Fetch/FetchDirectory',
                request_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchDirectoryRequest.SerializeToString,
                response_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchDirectoryResponse.FromString,
                )


class FetchServicer(object):
    """The Fetch service resolves or fetches assets referenced by URI and
    Qualifiers, returning a Digest for the content in 
    [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].

    As with other services in the Remote Execution API, any call may return an
    error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
    information about when the client should retry the request; clients SHOULD
    respect the information provided.
    """

    def FetchBlob(self, request, context):
        """Resolve or fetch referenced assets, making them available to the caller and
        other consumers in the [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].

        Servers *MAY* fetch content that they do not already have cached, for any
        URLs they support.

        Servers *SHOULD* ensure that referenced files are present in the CAS at the
        time of the response, and (if supported) that they will remain available
        for a reasonable period of time. The TTLs of the referenced blobs *SHOULD*
        be increased if necessary and applicable.
        In the event that a client receives a reference to content that is no
        longer present, it *MAY* re-issue the request with
        `oldest_content_accepted` set to a more recent timestamp than the original
        attempt, to induce a re-fetch from origin.

        Servers *MAY* cache fetched content and reuse it for subsequent requests,
        subject to `oldest_content_accepted`.

        Servers *MAY* support the complementary [Push][build.bazel.remote.asset.v1.Push]
        API and allow content to be directly inserted for use in future fetch
        responses.

        Servers *MUST* ensure Fetch'd content matches all the specified
        qualifiers except in the case of previously Push'd resources, for which
        the server *MAY* trust the pushing client to have set the qualifiers
        correctly, without validation.

        Servers not implementing the complementary [Push][build.bazel.remote.asset.v1.Push]
        API *MUST* reject requests containing qualifiers it does not support.

        Servers *MAY* transform assets as part of the fetch. For example a
        tarball fetched by [FetchDirectory][build.bazel.remote.asset.v1.Fetch.FetchDirectory]
        might be unpacked, or a Git repository
        fetched by [FetchBlob][build.bazel.remote.asset.v1.Fetch.FetchBlob]
        might be passed through `git-archive`.

        Errors handling the requested assets will be returned as gRPC Status errors
        here; errors outside the server's control will be returned inline in the
        `status` field of the response (see comment there for details).
        The possible RPC errors include:
        * `INVALID_ARGUMENT`: One or more arguments were invalid, such as a
        qualifier that is not supported by the server.
        * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to
        perform the requested operation. The client may retry after a delay.
        * `UNAVAILABLE`: Due to a transient condition the operation could not be
        completed. The client should retry.
        * `INTERNAL`: An internal error occurred while performing the operation.
        The client should retry.
        * `DEADLINE_EXCEEDED`: The fetch could not be completed within the given
        RPC deadline. The client should retry for at least as long as the value
        provided in `timeout` field of the request.

        In the case of unsupported qualifiers, the server *SHOULD* additionally
        send a [BadRequest][google.rpc.BadRequest] error detail where, for each
        unsupported qualifier, there is a `FieldViolation` with a `field` of
        `qualifiers.name` and a `description` of `"{qualifier}" not supported`
        indicating the name of the unsupported qualifier.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FetchDirectory(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_FetchServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'FetchBlob': grpc.unary_unary_rpc_method_handler(
                    servicer.FetchBlob,
                    request_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchBlobRequest.FromString,
                    response_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchBlobResponse.SerializeToString,
            ),
            'FetchDirectory': grpc.unary_unary_rpc_method_handler(
                    servicer.FetchDirectory,
                    request_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchDirectoryRequest.FromString,
                    response_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchDirectoryResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'build.bazel.remote.asset.v1.Fetch', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Fetch(object):
    """The Fetch service resolves or fetches assets referenced by URI and
    Qualifiers, returning a Digest for the content in 
    [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].

    As with other services in the Remote Execution API, any call may return an
    error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
    information about when the client should retry the request; clients SHOULD
    respect the information provided.
    """

    @staticmethod
    def FetchBlob(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/build.bazel.remote.asset.v1.Fetch/FetchBlob',
            build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchBlobRequest.SerializeToString,
            build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchBlobResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def FetchDirectory(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/build.bazel.remote.asset.v1.Fetch/FetchDirectory',
            build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchDirectoryRequest.SerializeToString,
            build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchDirectoryResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)


class PushStub(object):
    """The Push service is complementary to the Fetch, and allows for
    associating contents of URLs to be returned in future Fetch API calls.

    As with other services in the Remote Execution API, any call may return an
    error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
    information about when the client should retry the request; clients SHOULD
    respect the information provided.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.PushBlob = channel.unary_unary(
                '/build.bazel.remote.asset.v1.Push/PushBlob',
                request_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushBlobRequest.SerializeToString,
                response_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushBlobResponse.FromString,
                )
        self.PushDirectory = channel.unary_unary(
                '/build.bazel.remote.asset.v1.Push/PushDirectory',
                request_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushDirectoryRequest.SerializeToString,
                response_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushDirectoryResponse.FromString,
                )


class PushServicer(object):
    """The Push service is complementary to the Fetch, and allows for
    associating contents of URLs to be returned in future Fetch API calls.

    As with other services in the Remote Execution API, any call may return an
    error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
    information about when the client should retry the request; clients SHOULD
    respect the information provided.
    """

    def PushBlob(self, request, context):
        """These APIs associate the identifying information of a resource, as
        indicated by URI and optionally Qualifiers, with content available in the
        CAS. For example, associating a repository url and a commit id with a
        Directory Digest.

        Servers *SHOULD* only allow trusted clients to associate content, and *MAY*
        only allow certain URIs to be pushed.

        Clients *MUST* ensure associated content is available in CAS prior to
        pushing.

        Clients *MUST* ensure the Qualifiers listed correctly match the contents,
        and Servers *MAY* trust these values without validation.
        Fetch servers *MAY* require exact match of all qualifiers when returning
        content previously pushed, or allow fetching content with only a subset of
        the qualifiers specified on Push.

        Clients can specify expiration information that the server *SHOULD*
        respect. Subsequent requests can be used to alter the expiration time.

        A minimal compliant Fetch implementation may support only Push'd content
        and return `NOT_FOUND` for any resource that was not pushed first.
        Alternatively, a compliant implementation may choose to not support Push
        and only return resources that can be Fetch'd from origin.

        Errors will be returned as gRPC Status errors.
        The possible RPC errors include:
        * `INVALID_ARGUMENT`: One or more arguments to the RPC were invalid.
        * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to
        perform the requested operation. The client may retry after a delay.
        * `UNAVAILABLE`: Due to a transient condition the operation could not be
        completed. The client should retry.
        * `INTERNAL`: An internal error occurred while performing the operation.
        The client should retry.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PushDirectory(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_PushServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'PushBlob': grpc.unary_unary_rpc_method_handler(
                    servicer.PushBlob,
                    request_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushBlobRequest.FromString,
                    response_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushBlobResponse.SerializeToString,
            ),
            'PushDirectory': grpc.unary_unary_rpc_method_handler(
                    servicer.PushDirectory,
                    request_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushDirectoryRequest.FromString,
                    response_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushDirectoryResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'build.bazel.remote.asset.v1.Push', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Push(object):
    """The Push service is complementary to the Fetch, and allows for
    associating contents of URLs to be returned in future Fetch API calls.

    As with other services in the Remote Execution API, any call may return an
    error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
    information about when the client should retry the request; clients SHOULD
    respect the information provided.
    """

    @staticmethod
    def PushBlob(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/build.bazel.remote.asset.v1.Push/PushBlob',
            build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushBlobRequest.SerializeToString,
            build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushBlobResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def PushDirectory(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/build.bazel.remote.asset.v1.Push/PushDirectory',
            build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushDirectoryRequest.SerializeToString,
            build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushDirectoryResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)