@@ -19,16 +19,26 @@ package google.devtools.cloudbuild.v1;
1919import "google/api/annotations.proto" ;
2020import "google/api/client.proto" ;
2121import "google/api/field_behavior.proto" ;
22+ import "google/api/resource.proto" ;
2223import "google/longrunning/operations.proto" ;
2324import "google/protobuf/duration.proto" ;
2425import "google/protobuf/empty.proto" ;
26+ import "google/protobuf/field_mask.proto" ;
2527import "google/protobuf/timestamp.proto" ;
2628
2729option go_package = "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild" ;
2830option java_multiple_files = true ;
2931option java_package = "com.google.cloudbuild.v1" ;
3032option objc_class_prefix = "GCB" ;
3133option ruby_package = "Google::Cloud::Build::V1" ;
34+ option (google.api.resource_definition ) = {
35+ type : "compute.googleapis.com/Network"
36+ pattern : "projects/{project}/global/networks/{network}"
37+ };
38+ option (google.api.resource_definition ) = {
39+ type : "iam.googleapis.com/ServiceAccount"
40+ pattern : "projects/{project}/serviceAccounts/{service_account}"
41+ };
3242
3343// Creates and manages builds on Google Cloud Platform.
3444//
@@ -52,6 +62,10 @@ service CloudBuild {
5262 option (google.api.http ) = {
5363 post : "/v1/projects/{project_id}/builds"
5464 body : "build"
65+ additional_bindings {
66+ post : "/v1/{parent=projects/*/locations/*}/builds"
67+ body : "*"
68+ }
5569 };
5670 option (google.api.method_signature ) = "project_id,build" ;
5771 option (google.longrunning.operation_info ) = {
@@ -67,6 +81,7 @@ service CloudBuild {
6781 rpc GetBuild (GetBuildRequest ) returns (Build ) {
6882 option (google.api.http ) = {
6983 get : "/v1/projects/{project_id}/builds/{id}"
84+ additional_bindings { get : "/v1/{name=projects/*/locations/*/builds/*}" }
7085 };
7186 option (google.api.method_signature ) = "project_id,id" ;
7287 }
@@ -78,6 +93,7 @@ service CloudBuild {
7893 rpc ListBuilds (ListBuildsRequest ) returns (ListBuildsResponse ) {
7994 option (google.api.http ) = {
8095 get : "/v1/projects/{project_id}/builds"
96+ additional_bindings { get : "/v1/{parent=projects/*/locations/*}/builds" }
8197 };
8298 option (google.api.method_signature ) = "project_id,filter" ;
8399 }
@@ -87,6 +103,10 @@ service CloudBuild {
87103 option (google.api.http ) = {
88104 post : "/v1/projects/{project_id}/builds/{id}:cancel"
89105 body : "*"
106+ additional_bindings {
107+ post : "/v1/{name=projects/*/locations/*/builds/*}:cancel"
108+ body : "*"
109+ }
90110 };
91111 option (google.api.method_signature ) = "project_id,id" ;
92112 }
@@ -122,6 +142,10 @@ service CloudBuild {
122142 option (google.api.http ) = {
123143 post : "/v1/projects/{project_id}/builds/{id}:retry"
124144 body : "*"
145+ additional_bindings {
146+ post : "/v1/{name=projects/*/locations/*/builds/*}:retry"
147+ body : "*"
148+ }
125149 };
126150 option (google.api.method_signature ) = "project_id,id" ;
127151 option (google.longrunning.operation_info ) = {
@@ -228,6 +252,12 @@ service CloudBuild {
228252
229253// Specifies a build to retry.
230254message RetryBuildRequest {
255+ // The name of the `Build` to retry.
256+ // Format: `projects/{project}/locations/{location}/builds/{build}`
257+ string name = 3 [(google.api.resource_reference ) = {
258+ type : "cloudbuild.googleapis.com/Build"
259+ }];
260+
231261 // Required. ID of the project.
232262 string project_id = 1 [(google.api.field_behavior ) = REQUIRED ];
233263
@@ -416,7 +446,7 @@ message BuildStep {
416446
417447 // Output only. Stores timing information for pulling this build step's
418448 // builder image only.
419- TimeSpan pull_timing = 13 ;
449+ TimeSpan pull_timing = 13 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
420450
421451 // Time limit for executing this build step. If not defined, the step has no
422452 // time limit and will be allowed to continue to run until either it completes
@@ -426,7 +456,7 @@ message BuildStep {
426456 // Output only. Status of the build step. At this time, build step status is
427457 // only updated on build completion; step status is not updated in real-time
428458 // as the build progresses.
429- Build.Status status = 12 ;
459+ Build.Status status = 12 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
430460}
431461
432462// Volume describes a Docker container volume which is mounted into build steps
@@ -502,6 +532,12 @@ message ArtifactResult {
502532// resolved from the specified branch or tag.
503533// - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA.
504534message Build {
535+ option (google.api.resource ) = {
536+ type : "cloudbuild.googleapis.com/Build"
537+ pattern : "projects/{project}/builds/{build}"
538+ pattern : "projects/{project}/locations/{location}/builds/{build}"
539+ };
540+
505541 // Possible status of a build or build step.
506542 enum Status {
507543 // Status of the build is unknown.
@@ -532,17 +568,22 @@ message Build {
532568 EXPIRED = 9 ;
533569 }
534570
571+ // Output only. The 'Build' name with format:
572+ // `projects/{project}/locations/{location}/builds/{build}`, where {build}
573+ // is a unique identifier generated by the service.
574+ string name = 45 [(google.api.field_behavior ) = OUTPUT_ONLY ];
575+
535576 // Output only. Unique identifier of the build.
536577 string id = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
537578
538579 // Output only. ID of the project.
539580 string project_id = 16 [(google.api.field_behavior ) = OUTPUT_ONLY ];
540581
541582 // Output only. Status of the build.
542- Status status = 2 ;
583+ Status status = 2 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
543584
544585 // Output only. Customer-readable message about the current status.
545- string status_detail = 24 ;
586+ string status_detail = 24 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
546587
547588 // The location of the source files to build.
548589 Source source = 3 ;
@@ -572,6 +613,8 @@ message Build {
572613 // granularity. If this amount of time elapses, work on the build will cease
573614 // and the build status will be `TIMEOUT`.
574615 //
616+ // `timeout` starts ticking from `startTime`.
617+ //
575618 // Default time is ten minutes.
576619 google.protobuf.Duration timeout = 12 ;
577620
@@ -605,11 +648,12 @@ message Build {
605648 string logs_bucket = 19 ;
606649
607650 // Output only. A permanent fixed identifier for source.
608- SourceProvenance source_provenance = 21 ;
651+ SourceProvenance source_provenance = 21
652+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
609653
610654 // Output only. The ID of the `BuildTrigger` that triggered this build, if it
611655 // was triggered automatically.
612- string build_trigger_id = 22 ;
656+ string build_trigger_id = 22 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
613657
614658 // Special options for this build.
615659 BuildOptions options = 23 ;
@@ -636,6 +680,15 @@ message Build {
636680 // If the build does not specify source or images,
637681 // these keys will not be included.
638682 map <string , TimeSpan > timing = 33 [(google.api.field_behavior ) = OUTPUT_ONLY ];
683+
684+ // IAM service account whose credentials will be used at build runtime.
685+ // Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
686+ // ACCOUNT can be email address or uniqueId of the service account.
687+ //
688+ // This field is in alpha and is not publicly available.
689+ string service_account = 42 [(google.api.resource_reference ) = {
690+ type : "iam.googleapis.com/ServiceAccount"
691+ }];
639692}
640693
641694// Artifacts produced by a build that should be uploaded upon
@@ -656,7 +709,7 @@ message Artifacts {
656709 repeated string paths = 2 ;
657710
658711 // Output only. Stores timing information for pushing all artifact objects.
659- TimeSpan timing = 3 ;
712+ TimeSpan timing = 3 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
660713 }
661714
662715 // A list of images to be pushed upon the successful completion of all build
@@ -769,6 +822,12 @@ message Secret {
769822
770823// Request to create a new build.
771824message CreateBuildRequest {
825+ // The parent resource where this build will be created.
826+ // Format: `projects/{project}/locations/{location}`
827+ string parent = 4 [(google.api.resource_reference ) = {
828+ child_type : "cloudbuild.googleapis.com/Build"
829+ }];
830+
772831 // Required. ID of the project.
773832 string project_id = 1 [(google.api.field_behavior ) = REQUIRED ];
774833
@@ -778,6 +837,12 @@ message CreateBuildRequest {
778837
779838// Request to get a build.
780839message GetBuildRequest {
840+ // The name of the `Build` to retrieve.
841+ // Format: `projects/{project}/locations/{location}/builds/{build}`
842+ string name = 4 [(google.api.resource_reference ) = {
843+ type : "cloudbuild.googleapis.com/Build"
844+ }];
845+
781846 // Required. ID of the project.
782847 string project_id = 1 [(google.api.field_behavior ) = REQUIRED ];
783848
@@ -787,6 +852,12 @@ message GetBuildRequest {
787852
788853// Request to list builds.
789854message ListBuildsRequest {
855+ // The parent of the collection of `Builds`.
856+ // Format: `projects/{project}/locations/location`
857+ string parent = 9 [(google.api.resource_reference ) = {
858+ child_type : "cloudbuild.googleapis.com/Build"
859+ }];
860+
790861 // Required. ID of the project.
791862 string project_id = 1 [(google.api.field_behavior ) = REQUIRED ];
792863
@@ -811,6 +882,12 @@ message ListBuildsResponse {
811882
812883// Request to cancel an ongoing build.
813884message CancelBuildRequest {
885+ // The name of the `Build` to retrieve.
886+ // Format: `projects/{project}/locations/{location}/builds/{build}`
887+ string name = 4 [(google.api.resource_reference ) = {
888+ type : "cloudbuild.googleapis.com/Build"
889+ }];
890+
814891 // Required. ID of the project.
815892 string project_id = 1 [(google.api.field_behavior ) = REQUIRED ];
816893
@@ -821,6 +898,11 @@ message CancelBuildRequest {
821898// Configuration for an automated build in response to source repository
822899// changes.
823900message BuildTrigger {
901+ option (google.api.resource ) = {
902+ type : "cloudbuild.googleapis.com/BuildTrigger"
903+ pattern : "projects/{project}/triggers/{trigger}"
904+ };
905+
824906 // Output only. Unique identifier of the trigger.
825907 string id = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
826908
@@ -867,12 +949,11 @@ message BuildTrigger {
867949 google.protobuf.Timestamp create_time = 5
868950 [(google.api.field_behavior ) = OUTPUT_ONLY ];
869951
870- // If true, the trigger will never result in a build.
952+ // If true, the trigger will never automatically execute a build.
871953 bool disabled = 9 ;
872954
873955 // Substitutions for Build resource. The keys must match the following
874- // regular expression: `^_[A-Z0-9_]+$`.The keys cannot conflict with the
875- // keys in bindings.
956+ // regular expression: `^_[A-Z0-9_]+$`.
876957 map <string , string > substitutions = 11 ;
877958
878959 // ignored_files and included_files are file glob matches using
@@ -948,8 +1029,8 @@ message PullRequestFilter {
9481029 string branch = 2 ;
9491030 }
9501031
951- // Whether to block builds on a "/gcbrun" comment from a repository admin or
952- // collaborator .
1032+ // Configure builds to run whether a repository owner or collaborator need to
1033+ // comment `/gcbrun` .
9531034 CommentControl comment_control = 5 ;
9541035
9551036 // If true, branches that do NOT match the git_ref will trigger a build.
@@ -1050,7 +1131,9 @@ message BuildOptions {
10501131 VERIFIED = 1 ;
10511132 }
10521133
1053- // Supported VM sizes.
1134+ // Supported Compute Engine machine types.
1135+ // For more information, see [Machine
1136+ // types](https://cloud.google.com/compute/docs/machine-types).
10541137 enum MachineType {
10551138 // Standard machine type.
10561139 UNSPECIFIED = 0 ;
@@ -1091,11 +1174,23 @@ message BuildOptions {
10911174 // rely on the default logging behavior as it may change in the future.
10921175 LOGGING_UNSPECIFIED = 0 ;
10931176
1094- // Stackdriver logging and Cloud Storage logging are enabled.
1177+ // Cloud Logging and Cloud Storage logging are enabled.
10951178 LEGACY = 1 ;
10961179
10971180 // Only Cloud Storage logging is enabled.
10981181 GCS_ONLY = 2 ;
1182+
1183+ // This option is the same as CLOUD_LOGGING_ONLY.
1184+ STACKDRIVER_ONLY = 3 [deprecated = true ];
1185+
1186+ // Only Cloud Logging is enabled. Note that logs for both the Cloud Console
1187+ // UI and Cloud SDK are based on Cloud Storage logs, so neither will provide
1188+ // logs if this option is chosen.
1189+ CLOUD_LOGGING_ONLY = 5 ;
1190+
1191+ // Turn off all logging. No build logs will be captured.
1192+ // Next ID: 6
1193+ NONE = 4 ;
10991194 }
11001195
11011196 // Requested hash for SourceProvenance.
@@ -1117,8 +1212,18 @@ message BuildOptions {
11171212
11181213 // Option to specify behavior when there is an error in the substitution
11191214 // checks.
1215+ //
1216+ // NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot
1217+ // be overridden in the build configuration file.
11201218 SubstitutionOption substitution_option = 4 ;
11211219
1220+ // Option to specify whether or not to apply bash style string
1221+ // operations to the substitutions.
1222+ //
1223+ // NOTE: this is always enabled for triggered builds and cannot be
1224+ // overridden in the build configuration file.
1225+ bool dynamic_substitutions = 17 ;
1226+
11221227 // Option to define build log streaming behavior to Google Cloud
11231228 // Storage.
11241229 LogStreamingOption log_streaming_option = 5 ;
@@ -1129,8 +1234,8 @@ message BuildOptions {
11291234 // This field is experimental.
11301235 string worker_pool = 7 ;
11311236
1132- // Option to specify the logging mode, which determines where the logs are
1133- // stored.
1237+ // Option to specify the logging mode, which determines if and where build
1238+ // logs are stored.
11341239 LoggingMode logging = 11 ;
11351240
11361241 // A list of global environment variable definitions that will exist for all
0 commit comments