summaryrefslogtreecommitdiff
path: root/src/buildstream/_protos/build/buildgrid/local_cas_pb2_grpc.py
blob: 68af4826c8c460fc8539bb6822b9ff4ea0dbd933 (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
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
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
  pass

  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.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
  pass

  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.
    """
    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,
      ),
      '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,))