1 // Copyright 2018 Google LLC.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
18 package google.devtools.resultstore.v2;
20 import "google/api/annotations.proto";
21 import "google/devtools/resultstore/v2/action.proto";
22 import "google/devtools/resultstore/v2/configuration.proto";
23 import "google/devtools/resultstore/v2/configured_target.proto";
24 import "google/devtools/resultstore/v2/file_set.proto";
25 import "google/devtools/resultstore/v2/invocation.proto";
26 import "google/devtools/resultstore/v2/target.proto";
27 import "google/protobuf/field_mask.proto";
28 import "google/protobuf/timestamp.proto";
30 option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
31 option java_multiple_files = true;
32 option java_package = "com.google.devtools.resultstore.v2";
34 // This is the interface used to upload information to the ResultStore database,
35 // to update that information as necessary, and to make it immutable at the end.
36 // Every Update and Append method supports an update_mask field for restricting
37 // the affected fields.
38 service ResultStoreUpload {
39 // Creates the given invocation. Generally, a unique ID will be assigned to
40 // the invocation's name field by the server. This is not an implicitly
41 // idempotent API, so a request id is required to make it idempotent.
43 // Returns an empty Invocation proto with only the name and ID fields
46 // An error will be reported in the following cases:
47 // - If an invocation with the same ID already exists.
48 rpc CreateInvocation(CreateInvocationRequest) returns (Invocation) {
49 option (google.api.http) = {
50 post: "/v2/invocations"
55 // Applies a standard update to the invocation identified by the given proto's
56 // name. For all types of fields (primitive, message, or repeated), replaces
57 // them with the given proto fields if they are under the given field mask
58 // paths. Fields that match the mask but aren't populated in the given
59 // invocation are cleared. This is an implicitly idempotent API.
61 // Returns an empty Invocation proto with only the name and ID fields
64 // An error will be reported in the following cases:
65 // - If the invocation does not exist.
66 // - If the invocation is finished.
67 // - If no field mask was given.
68 rpc UpdateInvocation(UpdateInvocationRequest) returns (Invocation) {
69 option (google.api.http) = {
70 patch: "/v2/{invocation.name=invocations/*}"
75 // Declares the invocation with the given name as finished and immutable.
76 // This is an implicitly idempotent API.
78 // If an Invocation is not updated for 24 hours, some time after that
79 // this will be called automatically.
81 // An error will be reported in the following cases:
82 // - If the invocation does not exist.
83 rpc FinishInvocation(FinishInvocationRequest)
84 returns (FinishInvocationResponse) {
85 option (google.api.http) = {
86 post: "/v2/{name=invocations/*}:finish"
91 // Creates the given target under the given parent invocation. The given
92 // target ID is URL encoded, converted to the full resource name, and assigned
93 // to the target's name field. This is not an implicitly idempotent API, so a
94 // request id is required to make it idempotent.
96 // Returns an empty Target proto with only the name and ID fields populated.
98 // An error will be reported in the following cases:
99 // - If no target ID is provided.
100 // - If the parent invocation does not exist.
101 // - If the parent invocation is finished.
102 // - If a target with the same name already exists.
103 rpc CreateTarget(CreateTargetRequest) returns (Target) {
104 option (google.api.http) = {
105 post: "/v2/{parent=invocations/*}/targets"
110 // Applies a standard update to the target identified by the given proto's
111 // name. For all types of fields (primitive, message, or repeated), replaces
112 // them with the given proto fields if they are under the given field mask
113 // paths. Fields that match the mask but aren't populated in the given
114 // target are cleared. This is an implicitly idempotent API.
116 // Returns an empty Target proto with only the name and ID fields populated.
118 // An error will be reported in the following cases:
119 // - If the target does not exist.
120 // - If the target or parent invocation is finished.
121 // - If no field mask was given.
122 rpc UpdateTarget(UpdateTargetRequest) returns (Target) {
123 option (google.api.http) = {
124 patch: "/v2/{target.name=invocations/*/targets/*}"
129 // Declares the target with the given name as finished and immutable.
130 // This is an implicitly idempotent API.
132 // An error will be reported in the following cases:
133 // - If the target does not exist.
134 rpc FinishTarget(FinishTargetRequest) returns (FinishTargetResponse) {
135 option (google.api.http) = {
136 post: "/v2/{name=invocations/*/targets/*}:finish"
141 // Creates the given configured target under the given parent target.
142 // The given configured target ID is URL encoded, converted to the full
143 // resource name, and assigned to the configured target's name field.
144 // This is not an implicitly idempotent API, so a request id is required
145 // to make it idempotent.
147 // Returns an empty ConfiguredTarget proto with only the name and ID fields
150 // An error will be reported in the following cases:
151 // - If no config ID is provided.
152 // - If a configured target with the same ID already exists.
153 // - If the parent target does not exist.
154 // - If the parent target or invocation is finished.
155 rpc CreateConfiguredTarget(CreateConfiguredTargetRequest)
156 returns (ConfiguredTarget) {
157 option (google.api.http) = {
158 post: "/v2/{parent=invocations/*/targets/*}/configuredTargets"
159 body: "configured_target"
163 // Applies a standard update to the configured target identified by the given
164 // proto's name. For all types of fields (primitive, message, or repeated),
165 // replaces them with the given proto fields if they are under the given
166 // field mask paths. Fields that match the mask but aren't populated in the
167 // given configured target are cleared. This is an implicitly idempotent API.
169 // Returns an empty ConfiguredTarget proto with only the name and ID fields
172 // An error will be reported in the following cases:
173 // - If the configured target does not exist.
174 // - If the parent target or invocation is finished.
175 // - If no field mask was given.
176 rpc UpdateConfiguredTarget(UpdateConfiguredTargetRequest)
177 returns (ConfiguredTarget) {
178 option (google.api.http) = {
179 patch: "/v2/{configured_target.name=invocations/*/targets/*/configuredTargets/*}"
180 body: "configured_target"
184 // Declares the configured target with the given name as finished and
185 // immutable. This is an implicitly idempotent API.
187 // An error will be reported in the following cases:
188 // - If the configured target does not exist.
189 rpc FinishConfiguredTarget(FinishConfiguredTargetRequest)
190 returns (FinishConfiguredTargetResponse) {
191 option (google.api.http) = {
192 post: "/v2/{name=invocations/*/targets/*/configuredTargets/*}:finish"
197 // Creates the given action under the given configured target. The given
198 // action ID is URL encoded, converted to the full resource name, and
199 // assigned to the action's name field. This is not an implicitly
200 // idempotent API, so a request id is required to make it idempotent.
202 // Returns an empty Action proto with only the name and ID fields populated.
204 // An error will be reported in the following cases:
205 // - If no action ID provided.
206 // - If the parent configured target does not exist.
207 // - If the parent target or invocation is finished.
208 // - If an action with the same name already exists.
209 rpc CreateAction(CreateActionRequest) returns (Action) {
210 option (google.api.http) = {
211 post: "/v2/{parent=invocations/*/targets/*/configuredTargets/*}/actions"
216 // Applies a standard update to the action identified by the given
217 // proto's name. For all types of fields (primitive, message, or repeated),
218 // replaces them with the given proto fields if they are under the given
219 // field mask paths. Fields that match the mask but aren't populated in the
220 // given action are cleared. This is an implicitly idempotent API.
222 // Returns an empty Action proto with only the name and ID fields populated.
224 // An error will be reported in the following cases:
225 // - If the action does not exist.
226 // - If the parent target or invocation is finished.
227 // - If no field mask was given.
228 rpc UpdateAction(UpdateActionRequest) returns (Action) {
229 option (google.api.http) = {
230 patch: "/v2/{action.name=invocations/*/targets/*/configuredTargets/*/actions/*}"
235 // Creates the given configuration under the given parent invocation. The
236 // given configuration ID is URL encoded, converted to the full resource name,
237 // and assigned to the configuration's name field. The configuration ID of
238 // "default" should be preferred for the default configuration in a
239 // single-config invocation. This is not an implicitly idempotent API, so a
240 // request id is required to make it idempotent.
242 // Returns an empty Configuration proto with only the name and ID fields
245 // An error will be reported in the following cases:
246 // - If no configuration ID is provided.
247 // - If the parent invocation does not exist.
248 // - If the parent invocation is finished.
249 // - If a configuration with the same name already exists.
250 rpc CreateConfiguration(CreateConfigurationRequest) returns (Configuration) {
251 option (google.api.http) = {
252 post: "/v2/{parent=invocations/*}/configs"
253 body: "configuration"
257 // Applies a standard update to the configuration identified by the given
258 // proto's name. For all types of fields (primitive, message, or repeated),
259 // replaces them with the given proto fields if they are under the given field
260 // mask paths. Fields that match the mask but aren't populated in the given
261 // configuration are cleared. This is an implicitly idempotent API.
263 // Returns an empty Configuration proto with only the name and ID fields
266 // An error will be reported in the following cases:
267 // - If the configuration does not exist.
268 // - If the parent invocation is finished.
269 // - If no field mask was given.
270 // - If a given field mask path is not valid.
271 rpc UpdateConfiguration(UpdateConfigurationRequest) returns (Configuration) {
272 option (google.api.http) = {
273 patch: "/v2/{configuration.name=invocations/*/configs/*}"
274 body: "configuration"
278 // Creates the given file set under the given parent invocation. The given
279 // file set ID is URL encoded, converted to the full resource name, and
280 // assigned to the file set's name field. This is not an implicitly idempotent
281 // API, so a request id is required to make it idempotent.
283 // Returns an empty FileSet proto with only the name and ID fields populated.
285 // An error will be reported in the following cases:
286 // - If no file set ID is provided.
287 // - If a file set with the same name already exists.
288 // - If the parent invocation does not exist.
289 // - If the parent invocation is finished.
290 rpc CreateFileSet(CreateFileSetRequest) returns (FileSet) {
291 option (google.api.http) = {
292 post: "/v2/{parent=invocations/*}/fileSets"
297 // Applies a standard update to the file set identified by the given proto's
298 // name. For all types of fields (primitive, message, or repeated), replaces
299 // them with the given proto fields if they are under the given field mask
300 // paths. Fields that match the mask but aren't populated in the given
301 // configuration are cleared. This is an implicitly idempotent API.
303 // Returns an empty FileSet proto with only the name and ID fields populated.
305 // An error will be reported in the following cases:
306 // - If the file set does not exist.
307 // - If the parent invocation is finished.
308 // - If no field mask was given.
309 // - If a given field mask path is not valid.
310 rpc UpdateFileSet(UpdateFileSetRequest) returns (FileSet) {
311 option (google.api.http) = {
312 patch: "/v2/{file_set.name=invocations/*/fileSets/*}"
318 // Request passed into CreateInvocation
319 message CreateInvocationRequest {
320 // A unique identifier for this request. Must be set to a different value for
321 // each request that affects a given resource (eg. a random UUID). Required
322 // for the operation to be idempotent. This is achieved by ignoring this
323 // request if the last successful operation on the resource had the same
324 // request ID. If set, invocation_id must also be provided.
325 // Restricted to 36 utf-8 bytes.
326 string request_id = 1;
328 // The invocation ID. If left empty then a new unique ID will be
329 // assigned by the server. If populated, a RFC 4122-compliant v4 UUID is
330 // preferred, but v3 or v5 UUIDs are allowed too.
331 string invocation_id = 2;
333 // The invocation to create. Its name field will be ignored, since the name
334 // will be derived from the id field above and assigned by the server.
335 Invocation invocation = 3;
337 // This is a token to authorize upload access to this invocation. It must be
338 // set to a RFC 4122-compliant v3, v4, or v5 UUID. Once this is set in
339 // CreateInvocation, all other upload RPCs for that Invocation and any of its
340 // child resources must also include the exact same token, or they will be
341 // rejected. The generated token should be unique to this invocation, and it
342 // should be kept secret.
344 // The purpose of this field is to prevent other users and tools from
345 // clobbering your upload intentionally or accidentally. The standard way of
346 // using this token is to create a second v4 UUID when the invocation_id is
347 // created, and storing them together during the upload. Essentially, this is
348 // a "password" to the invocation.
349 string authorization_token = 4;
351 // By default, Invocations are auto-finished if they are not modified for 24
352 // hours. If you need auto-finish to happen sooner, set this field to the time
353 // you'd like auto-finish to occur.
354 google.protobuf.Timestamp auto_finish_time = 5;
357 // Request passed into UpdateInvocation
358 message UpdateInvocationRequest {
359 // Contains the name and the fields of the invocation to be updated. The
360 // name format must be: invocations/${INVOCATION_ID}
361 Invocation invocation = 3;
363 // Indicates which fields to update.
364 google.protobuf.FieldMask update_mask = 4;
366 // This is a token to authorize access to this invocation. It must be set to
367 // the same value that was provided in the CreateInvocationRequest.
368 string authorization_token = 5;
371 // Request passed into FinishInvocation
372 message FinishInvocationRequest {
373 // The name of the invocation. Its format must be:
374 // invocations/${INVOCATION_ID}
377 // This is a token to authorize access to this invocation. It must be set to
378 // the same value that was provided in the CreateInvocationRequest.
379 string authorization_token = 3;
382 // Response returned from FinishInvocation
383 message FinishInvocationResponse {
384 // The name of the invocation. Its format will be:
385 // invocations/${INVOCATION_ID}
388 // The resource ID components that identify the Invocation.
389 Invocation.Id id = 2;
392 // Request passed into CreateTarget
393 message CreateTargetRequest {
394 // A unique identifier for this request. Must be set to a different value for
395 // each request that affects a given resource (eg. a random UUID). Required
396 // for the operation to be idempotent. This is achieved by ignoring this
397 // request if the last successful operation on the resource had the same
398 // request ID. Restricted to 36 utf-8 bytes.
399 string request_id = 1;
401 // The name of the parent invocation in which the target is created.
402 // Its format must be invocations/${INVOCATION_ID}
405 // The target identifier. It can be any UTF-8 string up to 1024 bytes long
406 // except for the reserved id '-'.
407 string target_id = 3;
409 // The target to create. Its name field will be ignored, since the name will
410 // be derived from the id field above and assigned by the server.
413 // This is a token to authorize access to this invocation. It must be set to
414 // the same value that was provided in the CreateInvocationRequest.
415 string authorization_token = 5;
418 // Request passed into UpdateTarget
419 message UpdateTargetRequest {
420 // Contains the name and the fields of the target to be updated. The name
421 // format must be: invocations/${INVOCATION_ID}/targets/${TARGET_ID}
424 // Indicates which fields to update.
425 google.protobuf.FieldMask update_mask = 4;
427 // This is a token to authorize access to this invocation. It must be set to
428 // the same value that was provided in the CreateInvocationRequest.
429 string authorization_token = 5;
432 // Request passed into FinishTarget
433 message FinishTargetRequest {
434 // The name of the target. Its format must be:
435 // invocations/${INVOCATION_ID}/targets/${TARGET_ID}
438 // This is a token to authorize access to this invocation. It must be set to
439 // the same value that was provided in the CreateInvocationRequest.
440 string authorization_token = 3;
443 // Response returned from FinishTarget
444 message FinishTargetResponse {
445 // The name of the target. Its format will be:
446 // invocations/${INVOCATION_ID}/targets/${TARGET_ID}
449 // The resource ID components that identify the Target.
453 // Request passed into CreateConfiguredTarget
454 message CreateConfiguredTargetRequest {
455 // A unique identifier for this request. Must be set to a different value for
456 // each request that affects a given resource (eg. a random UUID). Required
457 // for the operation to be idempotent. This is achieved by ignoring this
458 // request if the last successful operation on the resource had the same
459 // request ID. Restricted to 36 utf-8 bytes.
460 string request_id = 1;
462 // The name of the parent target in which the configured target is created.
463 // Its format must be:
464 // invocations/${INVOCATION_ID}/targets/${TARGET_ID}
467 // The configuration identifier. This must match the ID of an existing
468 // Configuration under this Invocation. Cannot be the reserved id '-'.
469 string config_id = 3;
471 // The configured target to create. Its name field will be ignored, since the
472 // name will be derived from the id field above and assigned by the server.
473 ConfiguredTarget configured_target = 4;
475 // This is a token to authorize access to this invocation. It must be set to
476 // the same value that was provided in the CreateInvocationRequest.
477 string authorization_token = 5;
480 // Request passed into UpdateConfiguredTarget
481 message UpdateConfiguredTargetRequest {
482 // Contains the name and the fields of the configured target to be updated.
483 // The name format must be:
484 // invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
485 ConfiguredTarget configured_target = 3;
487 // Indicates which fields to update.
488 google.protobuf.FieldMask update_mask = 4;
490 // This is a token to authorize access to this invocation. It must be set to
491 // the same value that was provided in the CreateInvocationRequest.
492 string authorization_token = 5;
495 // Request passed into FinishConfiguredTarget
496 message FinishConfiguredTargetRequest {
497 // The name of the configured target. Its format must be:
498 // invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
501 // This is a token to authorize access to this invocation. It must be set to
502 // the same value that was provided in the CreateInvocationRequest.
503 string authorization_token = 3;
506 // Response returned from FinishConfiguredTarget
507 message FinishConfiguredTargetResponse {
508 // The name of the configured target. Its format must be:
509 // invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
512 // The resource ID components that identify the ConfiguredTarget.
513 ConfiguredTarget.Id id = 2;
516 // Request passed into CreateAction
517 message CreateActionRequest {
518 // A unique identifier for this request. Must be set to a different value for
519 // each request that affects a given resource (eg. a random UUID). Required
520 // for the operation to be idempotent. This is achieved by ignoring this
521 // request if the last successful operation on the resource had the same
522 // request ID. Restricted to 36 utf-8 bytes.
523 string request_id = 1;
525 // The name of the parent configured target in which the action is created.
526 // Its format must be:
527 // invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}
530 // The action identifier. It can be any UTF-8 string up to 512 bytes long,
531 // except for the reserved id '-'.
532 string action_id = 3;
534 // The action to create. Its name field will be ignored, since the
535 // name will be derived from the id field above and assigned by the server.
538 // This is a token to authorize access to this invocation. It must be set to
539 // the same value that was provided in the CreateInvocationRequest.
540 string authorization_token = 5;
543 // Request passed into UpdateAction
544 message UpdateActionRequest {
545 // Contains the name and the fields of the action to be updated. The
546 // name format must be:
547 // invocations/${INVOCATION_ID}/targets/${TARGET_ID}/configuredTargets/${CONFIG_ID}/actions/${ACTION_ID}
550 // Indicates which fields to update.
551 google.protobuf.FieldMask update_mask = 4;
553 // This is a token to authorize access to this invocation. It must be set to
554 // the same value that was provided in the CreateInvocationRequest.
555 string authorization_token = 5;
558 // Request passed into CreateConfiguration
559 message CreateConfigurationRequest {
560 // A unique identifier for this request. Must be set to a different value for
561 // each request that affects a given resource (eg. a random UUID). Required
562 // for the operation to be idempotent. This is achieved by ignoring this
563 // request if the last successful operation on the resource had the same
564 // request ID. Restricted to 36 utf-8 bytes.
565 string request_id = 1;
567 // The name of the parent invocation in which the configuration is created.
568 // Its format must be invocations/${INVOCATION_ID}
571 // The configuration identifier. It can be any UTF-8 string up to 256 bytes
572 // long. The configuration ID of "default" should be preferred for the default
573 // configuration in a single-config invocation. Cannot be the reserved id '-'.
574 string config_id = 3;
576 // The configuration to create. Its name field will be ignored, since the name
577 // will be derived from the id field above and assigned by the server.
578 Configuration configuration = 4;
580 // This is a token to authorize access to this invocation. It must be set to
581 // the same value that was provided in the CreateInvocationRequest.
582 string authorization_token = 5;
585 // Request passed into UpdateConfiguration
586 message UpdateConfigurationRequest {
587 // Contains the name and fields of the configuration to be updated. The name
588 // format must be: invocations/${INVOCATION_ID}/configs/${CONFIG_ID}
589 Configuration configuration = 3;
591 // Indicates which fields to update.
592 google.protobuf.FieldMask update_mask = 4;
594 // This is a token to authorize access to this invocation. It must be set to
595 // the same value that was provided in the CreateInvocationRequest.
596 string authorization_token = 5;
599 // Request passed into CreateFileSet
600 message CreateFileSetRequest {
601 // A unique identifier for this request. Must be set to a different value for
602 // each request that affects a given resource (eg. a random UUID). Required
603 // for the operation to be idempotent. This is achieved by ignoring this
604 // request if the last successful operation on the resource had the same
605 // request ID. Restricted to 36 utf-8 bytes.
606 string request_id = 1;
608 // The name of the parent invocation in which the file set is created.
609 // Its format must be invocations/${INVOCATION_ID}
612 // The file set identifier. It can be any UTF-8 string up to 256 bytes long.
613 string file_set_id = 3;
615 // The file set to create. Its name field will be ignored, since the name will
616 // be derived from the id field above and assigned by the server.
617 FileSet file_set = 4;
619 // This is a token to authorize access to this invocation. It must be set to
620 // the same value that was provided in the CreateInvocationRequest.
621 string authorization_token = 5;
624 // Request passed into UpdateFileSet
625 message UpdateFileSetRequest {
626 // Contains the name and fields of the file set to be updated. The name format
627 // must be: invocations/${INVOCATION_ID}/fileSets/${FILE_SET_ID}
628 FileSet file_set = 1;
630 // Indicates which fields to update.
631 google.protobuf.FieldMask update_mask = 2;
633 // This is a token to authorize access to this invocation. It must be set to
634 // the same value that was provided in the CreateInvocationRequest.
635 string authorization_token = 3;