summaryrefslogtreecommitdiff
path: root/src/buildstream/_protos/buildstream/v2/buildstream.proto
blob: e9cd1223bc1268dd442ca54c0919ff198e553893 (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
// Copyright 2018 Codethink Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package buildstream.v2;

import "build/bazel/remote/execution/v2/remote_execution.proto";
import "google/api/annotations.proto";

service ReferenceStorage {
  // Retrieve a CAS [Directory][build.bazel.remote.execution.v2.Directory]
  // digest by name.
  //
  // Errors:
  // * `NOT_FOUND`: The requested reference is not in the cache.
  rpc GetReference(GetReferenceRequest) returns (GetReferenceResponse) {
    option (google.api.http) = { get: "/v2/{instance_name=**}/buildstream/refs/{key}" };
  }

  // Associate a name with a CAS [Directory][build.bazel.remote.execution.v2.Directory]
  // digest.
  //
  // Errors:
  // * `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the
  //   entry to the cache.
  rpc UpdateReference(UpdateReferenceRequest) returns (UpdateReferenceResponse) {
    option (google.api.http) = { put: "/v2/{instance_name=**}/buildstream/refs/{key}" body: "digest" };
  }

  rpc Status(StatusRequest) returns (StatusResponse) {
    option (google.api.http) = { put: "/v2/{instance_name=**}/buildstream/refs:status" };
  }
}

service Capabilities {
  // GetCapabilities mirrors
  rpc GetCapabilities(GetCapabilitiesRequest) returns (ServerCapabilities) {
    option (google.api.http) = {
      get: "/v2/{instance_name=**}/capabilities"
    };
  }
}

message GetReferenceRequest {
  // The instance of the execution system to operate against. A server may
  // support multiple instances of the execution system (with their own workers,
  // storage, caches, etc.). The server MAY require use of this field to select
  // between them in an implementation-defined fashion, otherwise it can be
  // omitted.
  string instance_name = 1;

  // The name of the reference.
  string key = 2;
}

message GetReferenceResponse {
  // The digest of the CAS [Directory][build.bazel.remote.execution.v2.Directory].
  build.bazel.remote.execution.v2.Digest digest = 1;
}

message UpdateReferenceRequest {
  // The instance of the execution system to operate against. A server may
  // support multiple instances of the execution system (with their own workers,
  // storage, caches, etc.). The server MAY require use of this field to select
  // between them in an implementation-defined fashion, otherwise it can be
  // omitted.
  string instance_name = 1;

  // The name of the reference.
  repeated string keys = 2;

  // The digest of the CAS [Directory][build.bazel.remote.execution.v2.Directory]
  // to store in the cache.
  build.bazel.remote.execution.v2.Digest digest = 3;
}

message UpdateReferenceResponse {
}

message StatusRequest {
  // The instance of the execution system to operate against. A server may
  // support multiple instances of the execution system (with their own workers,
  // storage, caches, etc.). The server MAY require use of this field to select
  // between them in an implementation-defined fashion, otherwise it can be
  // omitted.
  string instance_name = 1;
}

message StatusResponse {
  // Whether reference updates are allowed for the connected client.
  bool allow_updates = 1;
}

message GetCapabilitiesRequest {
  string instance_name = 1;
}

// Capabilities of the artifact service
message ArtifactCapabilities {
  bool allow_updates = 1;
}

// All capabalities will be unset if the service isn't present
message ServerCapabilities {
  ArtifactCapabilities artifact_capabilities = 1;
}