1// Copyright 2023 Google LLC 2// 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 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 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. 14 15syntax = "proto3"; 16 17package google.devtools.cloudbuild.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/httpbody.proto"; 23import "google/api/resource.proto"; 24import "google/api/routing.proto"; 25import "google/longrunning/operations.proto"; 26import "google/protobuf/duration.proto"; 27import "google/protobuf/empty.proto"; 28import "google/protobuf/field_mask.proto"; 29import "google/protobuf/timestamp.proto"; 30 31option csharp_namespace = "Google.Cloud.CloudBuild.V1"; 32option go_package = "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb;cloudbuildpb"; 33option java_multiple_files = true; 34option java_package = "com.google.cloudbuild.v1"; 35option objc_class_prefix = "GCB"; 36option php_namespace = "Google\\Cloud\\Build\\V1"; 37option ruby_package = "Google::Cloud::Build::V1"; 38option (google.api.resource_definition) = { 39 type: "compute.googleapis.com/Network" 40 pattern: "projects/{project}/global/networks/{network}" 41}; 42option (google.api.resource_definition) = { 43 type: "iam.googleapis.com/ServiceAccount" 44 pattern: "projects/{project}/serviceAccounts/{service_account}" 45}; 46option (google.api.resource_definition) = { 47 type: "secretmanager.googleapis.com/Secret" 48 pattern: "projects/{project}/secrets/{secret}" 49}; 50option (google.api.resource_definition) = { 51 type: "secretmanager.googleapis.com/SecretVersion" 52 pattern: "projects/{project}/secrets/{secret}/versions/{version}" 53}; 54option (google.api.resource_definition) = { 55 type: "gkehub.googleapis.com/Membership" 56 pattern: "projects/{project}/locations/{location}/memberships/{cluster_name}" 57}; 58option (google.api.resource_definition) = { 59 type: "cloudkms.googleapis.com/CryptoKey" 60 pattern: "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}" 61}; 62option (google.api.resource_definition) = { 63 type: "pubsub.googleapis.com/Subscription" 64 pattern: "projects/{project}/subscriptions/{subscription}" 65}; 66option (google.api.resource_definition) = { 67 type: "pubsub.googleapis.com/Topic" 68 pattern: "projects/{project}/topics/{topic}" 69}; 70option (google.api.resource_definition) = { 71 type: "cloudbuild.googleapis.com/Repository" 72 pattern: "projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}" 73}; 74 75// Creates and manages builds on Google Cloud Platform. 76// 77// The main concept used by this API is a `Build`, which describes the location 78// of the source to build, how to build the source, and where to store the 79// built artifacts, if any. 80// 81// A user can list previously-requested builds or get builds by their ID to 82// determine the status of the build. 83service CloudBuild { 84 option (google.api.default_host) = "cloudbuild.googleapis.com"; 85 option (google.api.oauth_scopes) = 86 "https://www.googleapis.com/auth/cloud-platform"; 87 88 // Starts a build with the specified configuration. 89 // 90 // This method returns a long-running `Operation`, which includes the build 91 // ID. Pass the build ID to `GetBuild` to determine the build status (such as 92 // `SUCCESS` or `FAILURE`). 93 rpc CreateBuild(CreateBuildRequest) returns (google.longrunning.Operation) { 94 option (google.api.http) = { 95 post: "/v1/projects/{project_id}/builds" 96 body: "build" 97 additional_bindings { 98 post: "/v1/{parent=projects/*/locations/*}/builds" 99 body: "build" 100 } 101 }; 102 option (google.api.routing) = { 103 routing_parameters { 104 field: "parent" 105 path_template: "projects/*/locations/{location=*}" 106 } 107 }; 108 option (google.api.method_signature) = "project_id,build"; 109 option (google.longrunning.operation_info) = { 110 response_type: "Build" 111 metadata_type: "BuildOperationMetadata" 112 }; 113 } 114 115 // Returns information about a previously requested build. 116 // 117 // The `Build` that is returned includes its status (such as `SUCCESS`, 118 // `FAILURE`, or `WORKING`), and timing information. 119 rpc GetBuild(GetBuildRequest) returns (Build) { 120 option (google.api.http) = { 121 get: "/v1/projects/{project_id}/builds/{id}" 122 additional_bindings { get: "/v1/{name=projects/*/locations/*/builds/*}" } 123 }; 124 option (google.api.routing) = { 125 routing_parameters { 126 field: "name" 127 path_template: "projects/*/locations/{location=*}/builds/*" 128 } 129 }; 130 option (google.api.method_signature) = "project_id,id"; 131 } 132 133 // Lists previously requested builds. 134 // 135 // Previously requested builds may still be in-progress, or may have finished 136 // successfully or unsuccessfully. 137 rpc ListBuilds(ListBuildsRequest) returns (ListBuildsResponse) { 138 option (google.api.http) = { 139 get: "/v1/projects/{project_id}/builds" 140 additional_bindings { get: "/v1/{parent=projects/*/locations/*}/builds" } 141 }; 142 option (google.api.routing) = { 143 routing_parameters { 144 field: "parent" 145 path_template: "projects/*/locations/{location=*}" 146 } 147 }; 148 option (google.api.method_signature) = "project_id,filter"; 149 } 150 151 // Cancels a build in progress. 152 rpc CancelBuild(CancelBuildRequest) returns (Build) { 153 option (google.api.http) = { 154 post: "/v1/projects/{project_id}/builds/{id}:cancel" 155 body: "*" 156 additional_bindings { 157 post: "/v1/{name=projects/*/locations/*/builds/*}:cancel" 158 body: "*" 159 } 160 }; 161 option (google.api.routing) = { 162 routing_parameters { 163 field: "name" 164 path_template: "projects/*/locations/{location=*}/builds/*" 165 } 166 }; 167 option (google.api.method_signature) = "project_id,id"; 168 } 169 170 // Creates a new build based on the specified build. 171 // 172 // This method creates a new build using the original build request, which may 173 // or may not result in an identical build. 174 // 175 // For triggered builds: 176 // 177 // * Triggered builds resolve to a precise revision; therefore a retry of a 178 // triggered build will result in a build that uses the same revision. 179 // 180 // For non-triggered builds that specify `RepoSource`: 181 // 182 // * If the original build built from the tip of a branch, the retried build 183 // will build from the tip of that branch, which may not be the same revision 184 // as the original build. 185 // * If the original build specified a commit sha or revision ID, the retried 186 // build will use the identical source. 187 // 188 // For builds that specify `StorageSource`: 189 // 190 // * If the original build pulled source from Cloud Storage without 191 // specifying the generation of the object, the new build will use the current 192 // object, which may be different from the original build source. 193 // * If the original build pulled source from Cloud Storage and specified the 194 // generation of the object, the new build will attempt to use the same 195 // object, which may or may not be available depending on the bucket's 196 // lifecycle management settings. 197 rpc RetryBuild(RetryBuildRequest) returns (google.longrunning.Operation) { 198 option (google.api.http) = { 199 post: "/v1/projects/{project_id}/builds/{id}:retry" 200 body: "*" 201 additional_bindings { 202 post: "/v1/{name=projects/*/locations/*/builds/*}:retry" 203 body: "*" 204 } 205 }; 206 option (google.api.routing) = { 207 routing_parameters { 208 field: "name" 209 path_template: "projects/*/locations/{location=*}/builds/*" 210 } 211 }; 212 option (google.api.method_signature) = "project_id,id"; 213 option (google.longrunning.operation_info) = { 214 response_type: "Build" 215 metadata_type: "BuildOperationMetadata" 216 }; 217 } 218 219 // Approves or rejects a pending build. 220 // 221 // If approved, the returned LRO will be analogous to the LRO returned from 222 // a CreateBuild call. 223 // 224 // If rejected, the returned LRO will be immediately done. 225 rpc ApproveBuild(ApproveBuildRequest) returns (google.longrunning.Operation) { 226 option (google.api.http) = { 227 post: "/v1/{name=projects/*/builds/*}:approve" 228 body: "*" 229 additional_bindings { 230 post: "/v1/{name=projects/*/locations/*/builds/*}:approve" 231 body: "*" 232 } 233 }; 234 option (google.api.routing) = { 235 routing_parameters { 236 field: "name" 237 path_template: "projects/*/locations/{location=*}/builds/*" 238 } 239 }; 240 option (google.api.method_signature) = "name,approval_result"; 241 option (google.longrunning.operation_info) = { 242 response_type: "Build" 243 metadata_type: "BuildOperationMetadata" 244 }; 245 } 246 247 // Creates a new `BuildTrigger`. 248 // 249 // This API is experimental. 250 rpc CreateBuildTrigger(CreateBuildTriggerRequest) returns (BuildTrigger) { 251 option (google.api.http) = { 252 post: "/v1/projects/{project_id}/triggers" 253 body: "trigger" 254 additional_bindings { 255 post: "/v1/{parent=projects/*/locations/*}/triggers" 256 body: "trigger" 257 } 258 }; 259 option (google.api.routing) = { 260 routing_parameters { 261 field: "parent" 262 path_template: "projects/*/locations/{location=*}" 263 } 264 }; 265 option (google.api.method_signature) = "project_id,trigger"; 266 } 267 268 // Returns information about a `BuildTrigger`. 269 // 270 // This API is experimental. 271 rpc GetBuildTrigger(GetBuildTriggerRequest) returns (BuildTrigger) { 272 option (google.api.http) = { 273 get: "/v1/projects/{project_id}/triggers/{trigger_id}" 274 additional_bindings { 275 get: "/v1/{name=projects/*/locations/*/triggers/*}" 276 } 277 }; 278 option (google.api.routing) = { 279 routing_parameters { 280 field: "name" 281 path_template: "projects/*/locations/{location=*}/triggers/*" 282 } 283 }; 284 option (google.api.method_signature) = "project_id,trigger_id"; 285 } 286 287 // Lists existing `BuildTrigger`s. 288 // 289 // This API is experimental. 290 rpc ListBuildTriggers(ListBuildTriggersRequest) 291 returns (ListBuildTriggersResponse) { 292 option (google.api.http) = { 293 get: "/v1/projects/{project_id}/triggers" 294 additional_bindings { 295 get: "/v1/{parent=projects/*/locations/*}/triggers" 296 } 297 }; 298 option (google.api.routing) = { 299 routing_parameters { 300 field: "parent" 301 path_template: "projects/*/locations/{location=*}" 302 } 303 }; 304 option (google.api.method_signature) = "project_id"; 305 } 306 307 // Deletes a `BuildTrigger` by its project ID and trigger ID. 308 // 309 // This API is experimental. 310 rpc DeleteBuildTrigger(DeleteBuildTriggerRequest) 311 returns (google.protobuf.Empty) { 312 option (google.api.http) = { 313 delete: "/v1/projects/{project_id}/triggers/{trigger_id}" 314 additional_bindings { 315 delete: "/v1/{name=projects/*/locations/*/triggers/*}" 316 } 317 }; 318 option (google.api.routing) = { 319 routing_parameters { 320 field: "name" 321 path_template: "projects/*/locations/{location=*}/triggers/*" 322 } 323 }; 324 option (google.api.method_signature) = "project_id,trigger_id"; 325 } 326 327 // Updates a `BuildTrigger` by its project ID and trigger ID. 328 // 329 // This API is experimental. 330 rpc UpdateBuildTrigger(UpdateBuildTriggerRequest) returns (BuildTrigger) { 331 option (google.api.http) = { 332 patch: "/v1/projects/{project_id}/triggers/{trigger_id}" 333 body: "trigger" 334 additional_bindings { 335 patch: "/v1/{trigger.resource_name=projects/*/locations/*/triggers/*}" 336 body: "trigger" 337 } 338 }; 339 option (google.api.routing) = { 340 routing_parameters { 341 field: "trigger.resource_name" 342 path_template: "projects/*/locations/{location=*}/triggers/*" 343 } 344 }; 345 option (google.api.method_signature) = "project_id,trigger_id,trigger"; 346 } 347 348 // Runs a `BuildTrigger` at a particular source revision. 349 // 350 // To run a regional or global trigger, use the POST request 351 // that includes the location endpoint in the path (ex. 352 // v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The 353 // POST request that does not include the location endpoint in the path can 354 // only be used when running global triggers. 355 rpc RunBuildTrigger(RunBuildTriggerRequest) 356 returns (google.longrunning.Operation) { 357 option (google.api.http) = { 358 post: "/v1/projects/{project_id}/triggers/{trigger_id}:run" 359 body: "source" 360 additional_bindings { 361 post: "/v1/{name=projects/*/locations/*/triggers/*}:run" 362 body: "*" 363 } 364 }; 365 option (google.api.routing) = { 366 routing_parameters { 367 field: "name" 368 path_template: "projects/*/locations/{location=*}/triggers/*" 369 } 370 }; 371 option (google.api.method_signature) = "project_id,trigger_id,source"; 372 option (google.longrunning.operation_info) = { 373 response_type: "Build" 374 metadata_type: "BuildOperationMetadata" 375 }; 376 } 377 378 // ReceiveTriggerWebhook [Experimental] is called when the API receives a 379 // webhook request targeted at a specific trigger. 380 rpc ReceiveTriggerWebhook(ReceiveTriggerWebhookRequest) 381 returns (ReceiveTriggerWebhookResponse) { 382 option (google.api.http) = { 383 post: "/v1/projects/{project_id}/triggers/{trigger}:webhook" 384 body: "body" 385 additional_bindings { 386 post: "/v1/{name=projects/*/locations/*/triggers/*}:webhook" 387 body: "body" 388 } 389 }; 390 } 391 392 // Creates a `WorkerPool`. 393 rpc CreateWorkerPool(CreateWorkerPoolRequest) 394 returns (google.longrunning.Operation) { 395 option (google.api.http) = { 396 post: "/v1/{parent=projects/*/locations/*}/workerPools" 397 body: "worker_pool" 398 }; 399 option (google.api.routing) = { 400 routing_parameters { 401 field: "parent" 402 path_template: "projects/*/locations/{location=*}" 403 } 404 }; 405 option (google.api.method_signature) = "parent,worker_pool,worker_pool_id"; 406 option (google.longrunning.operation_info) = { 407 response_type: "WorkerPool" 408 metadata_type: "CreateWorkerPoolOperationMetadata" 409 }; 410 } 411 412 // Returns details of a `WorkerPool`. 413 rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) { 414 option (google.api.http) = { 415 get: "/v1/{name=projects/*/locations/*/workerPools/*}" 416 }; 417 option (google.api.routing) = { 418 routing_parameters { 419 field: "name" 420 path_template: "projects/*/locations/{location=*}/workerPools/*" 421 } 422 }; 423 option (google.api.method_signature) = "name"; 424 } 425 426 // Deletes a `WorkerPool`. 427 rpc DeleteWorkerPool(DeleteWorkerPoolRequest) 428 returns (google.longrunning.Operation) { 429 option (google.api.http) = { 430 delete: "/v1/{name=projects/*/locations/*/workerPools/*}" 431 }; 432 option (google.api.routing) = { 433 routing_parameters { 434 field: "name" 435 path_template: "projects/*/locations/{location=*}/workerPools/*" 436 } 437 }; 438 option (google.api.method_signature) = "name"; 439 option (google.longrunning.operation_info) = { 440 response_type: "google.protobuf.Empty" 441 metadata_type: "DeleteWorkerPoolOperationMetadata" 442 }; 443 } 444 445 // Updates a `WorkerPool`. 446 rpc UpdateWorkerPool(UpdateWorkerPoolRequest) 447 returns (google.longrunning.Operation) { 448 option (google.api.http) = { 449 patch: "/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}" 450 body: "worker_pool" 451 }; 452 option (google.api.routing) = { 453 routing_parameters { 454 field: "worker_pool.name" 455 path_template: "projects/*/locations/{location=*}/workerPools/*" 456 } 457 }; 458 option (google.api.method_signature) = "worker_pool,update_mask"; 459 option (google.longrunning.operation_info) = { 460 response_type: "WorkerPool" 461 metadata_type: "UpdateWorkerPoolOperationMetadata" 462 }; 463 } 464 465 // Lists `WorkerPool`s. 466 rpc ListWorkerPools(ListWorkerPoolsRequest) 467 returns (ListWorkerPoolsResponse) { 468 option (google.api.http) = { 469 get: "/v1/{parent=projects/*/locations/*}/workerPools" 470 }; 471 option (google.api.routing) = { 472 routing_parameters { 473 field: "parent" 474 path_template: "projects/*/locations/{location=*}" 475 } 476 }; 477 option (google.api.method_signature) = "parent"; 478 } 479} 480 481// Specifies a build to retry. 482message RetryBuildRequest { 483 // The name of the `Build` to retry. 484 // Format: `projects/{project}/locations/{location}/builds/{build}` 485 string name = 3 [(google.api.resource_reference) = { 486 type: "cloudbuild.googleapis.com/Build" 487 }]; 488 489 // Required. ID of the project. 490 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 491 492 // Required. Build ID of the original build. 493 string id = 2 [(google.api.field_behavior) = REQUIRED]; 494} 495 496// Specifies a build trigger to run and the source to use. 497message RunBuildTriggerRequest { 498 // The name of the `Trigger` to run. 499 // Format: `projects/{project}/locations/{location}/triggers/{trigger}` 500 string name = 4 [(google.api.resource_reference) = { 501 type: "cloudbuild.googleapis.com/BuildTrigger" 502 }]; 503 504 // Required. ID of the project. 505 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 506 507 // Required. ID of the trigger. 508 string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; 509 510 // Source to build against this trigger. 511 // Branch and tag names cannot consist of regular expressions. 512 RepoSource source = 3; 513} 514 515// Location of the source in an archive file in Cloud Storage. 516message StorageSource { 517 // Cloud Storage bucket containing the source (see 518 // [Bucket Name 519 // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). 520 string bucket = 1; 521 522 // Cloud Storage object containing the source. 523 // 524 // This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) 525 // containing source to build. 526 string object = 2; 527 528 // Cloud Storage generation for the object. If the generation is 529 // omitted, the latest generation will be used. 530 int64 generation = 3; 531 532 // Specifies the tool to fetch the source file for the build. 533 enum SourceFetcher { 534 // Unspecified. Defaults to GSUTIL. 535 SOURCE_FETCHER_UNSPECIFIED = 0; 536 537 // Use the "gsutil" tool to download the source file. 538 GSUTIL = 1; 539 540 // Use the Cloud Storage Fetcher tool to download the source file. 541 GCS_FETCHER = 2; 542 } 543 544 // Option to specify the tool to fetch the source file for the build. 545 SourceFetcher source_fetcher = 5 [(google.api.field_behavior) = OPTIONAL]; 546} 547 548// Location of the source in any accessible Git repository. 549message GitSource { 550 // Location of the Git repo to build. 551 // 552 // This will be used as a `git remote`, see 553 // https://git-scm.com/docs/git-remote. 554 string url = 1; 555 556 // Directory, relative to the source root, in which to run the build. 557 // 558 // This must be a relative path. If a step's `dir` is specified and is an 559 // absolute path, this value is ignored for that step's execution. 560 string dir = 5; 561 562 // The revision to fetch from the Git repository such as a branch, a tag, a 563 // commit SHA, or any Git ref. 564 // 565 // Cloud Build uses `git fetch` to fetch the revision from the Git 566 // repository; therefore make sure that the string you provide for `revision` 567 // is parsable by the command. For information on string values accepted by 568 // `git fetch`, see 569 // https://git-scm.com/docs/gitrevisions#_specifying_revisions. For 570 // information on `git fetch`, see https://git-scm.com/docs/git-fetch. 571 string revision = 6; 572} 573 574// Location of the source in a Google Cloud Source Repository. 575message RepoSource { 576 // ID of the project that owns the Cloud Source Repository. If omitted, the 577 // project ID requesting the build is assumed. 578 string project_id = 1; 579 580 // Name of the Cloud Source Repository. 581 string repo_name = 2; 582 583 // A revision within the Cloud Source Repository must be specified in 584 // one of these ways. 585 oneof revision { 586 // Regex matching branches to build. 587 // 588 // The syntax of the regular expressions accepted is the syntax accepted by 589 // RE2 and described at https://github.com/google/re2/wiki/Syntax 590 string branch_name = 3; 591 592 // Regex matching tags to build. 593 // 594 // The syntax of the regular expressions accepted is the syntax accepted by 595 // RE2 and described at https://github.com/google/re2/wiki/Syntax 596 string tag_name = 4; 597 598 // Explicit commit SHA to build. 599 string commit_sha = 5; 600 } 601 602 // Directory, relative to the source root, in which to run the build. 603 // 604 // This must be a relative path. If a step's `dir` is specified and is an 605 // absolute path, this value is ignored for that step's execution. 606 string dir = 7; 607 608 // Only trigger a build if the revision regex does NOT match the revision 609 // regex. 610 bool invert_regex = 8; 611 612 // Substitutions to use in a triggered build. 613 // Should only be used with RunBuildTrigger 614 map<string, string> substitutions = 9; 615} 616 617// Location of the source manifest in Cloud Storage. 618// This feature is in Preview; see description 619// [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). 620message StorageSourceManifest { 621 // Cloud Storage bucket containing the source manifest (see [Bucket 622 // Name 623 // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). 624 string bucket = 1; 625 626 // Cloud Storage object containing the source manifest. 627 // 628 // This object must be a JSON file. 629 string object = 2; 630 631 // Cloud Storage generation for the object. If the generation is 632 // omitted, the latest generation will be used. 633 int64 generation = 3; 634} 635 636// Location of the source in a supported storage service. 637message Source { 638 // Location of source. 639 oneof source { 640 // If provided, get the source from this location in Cloud Storage. 641 StorageSource storage_source = 2; 642 643 // If provided, get the source from this location in a Cloud Source 644 // Repository. 645 RepoSource repo_source = 3; 646 647 // If provided, get the source from this Git repository. 648 GitSource git_source = 5; 649 650 // If provided, get the source from this manifest in Cloud Storage. 651 // This feature is in Preview; see description 652 // [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). 653 StorageSourceManifest storage_source_manifest = 8; 654 } 655} 656 657// An image built by the pipeline. 658message BuiltImage { 659 // Name used to push the container image to Google Container Registry, as 660 // presented to `docker push`. 661 string name = 1; 662 663 // Docker Registry 2.0 digest. 664 string digest = 3; 665 666 // Output only. Stores timing information for pushing the specified image. 667 TimeSpan push_timing = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 668} 669 670// Artifact uploaded using the PythonPackage directive. 671message UploadedPythonPackage { 672 // URI of the uploaded artifact. 673 string uri = 1; 674 675 // Hash types and values of the Python Artifact. 676 FileHashes file_hashes = 2; 677 678 // Output only. Stores timing information for pushing the specified artifact. 679 TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 680} 681 682// A Maven artifact uploaded using the MavenArtifact directive. 683message UploadedMavenArtifact { 684 // URI of the uploaded artifact. 685 string uri = 1; 686 687 // Hash types and values of the Maven Artifact. 688 FileHashes file_hashes = 2; 689 690 // Output only. Stores timing information for pushing the specified artifact. 691 TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 692} 693 694// An npm package uploaded to Artifact Registry using the NpmPackage 695// directive. 696message UploadedNpmPackage { 697 // URI of the uploaded npm package. 698 string uri = 1; 699 700 // Hash types and values of the npm package. 701 FileHashes file_hashes = 2; 702 703 // Output only. Stores timing information for pushing the specified artifact. 704 TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 705} 706 707// A step in the build pipeline. 708message BuildStep { 709 // Required. The name of the container image that will run this particular 710 // build step. 711 // 712 // If the image is available in the host's Docker daemon's cache, it 713 // will be run directly. If not, the host will attempt to pull the image 714 // first, using the builder service account's credentials if necessary. 715 // 716 // The Docker daemon's cache will already have the latest versions of all of 717 // the officially supported build steps 718 // ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). 719 // The Docker daemon will also have cached many of the layers for some popular 720 // images, like "ubuntu", "debian", but they will be refreshed at the time you 721 // attempt to use them. 722 // 723 // If you built an image in a previous build step, it will be stored in the 724 // host's Docker daemon's cache and is available to use as the name for a 725 // later build step. 726 string name = 1; 727 728 // A list of environment variable definitions to be used when running a step. 729 // 730 // The elements are of the form "KEY=VALUE" for the environment variable "KEY" 731 // being given the value "VALUE". 732 repeated string env = 2; 733 734 // A list of arguments that will be presented to the step when it is started. 735 // 736 // If the image used to run the step's container has an entrypoint, the `args` 737 // are used as arguments to that entrypoint. If the image does not define 738 // an entrypoint, the first element in args is used as the entrypoint, 739 // and the remainder will be used as arguments. 740 repeated string args = 3; 741 742 // Working directory to use when running this step's container. 743 // 744 // If this value is a relative path, it is relative to the build's working 745 // directory. If this value is absolute, it may be outside the build's working 746 // directory, in which case the contents of the path may not be persisted 747 // across build step executions, unless a `volume` for that path is specified. 748 // 749 // If the build specifies a `RepoSource` with `dir` and a step with a `dir`, 750 // which specifies an absolute path, the `RepoSource` `dir` is ignored for 751 // the step's execution. 752 string dir = 4; 753 754 // Unique identifier for this build step, used in `wait_for` to 755 // reference this build step as a dependency. 756 string id = 5; 757 758 // The ID(s) of the step(s) that this build step depends on. 759 // This build step will not start until all the build steps in `wait_for` 760 // have completed successfully. If `wait_for` is empty, this build step will 761 // start when all previous build steps in the `Build.Steps` list have 762 // completed successfully. 763 repeated string wait_for = 6; 764 765 // Entrypoint to be used instead of the build step image's default entrypoint. 766 // If unset, the image's default entrypoint is used. 767 string entrypoint = 7; 768 769 // A list of environment variables which are encrypted using a Cloud Key 770 // Management Service crypto key. These values must be specified in the 771 // build's `Secret`. 772 repeated string secret_env = 8; 773 774 // List of volumes to mount into the build step. 775 // 776 // Each volume is created as an empty volume prior to execution of the 777 // build step. Upon completion of the build, volumes and their contents are 778 // discarded. 779 // 780 // Using a named volume in only one step is not valid as it is indicative 781 // of a build request with an incorrect configuration. 782 repeated Volume volumes = 9; 783 784 // Output only. Stores timing information for executing this build step. 785 TimeSpan timing = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; 786 787 // Output only. Stores timing information for pulling this build step's 788 // builder image only. 789 TimeSpan pull_timing = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; 790 791 // Time limit for executing this build step. If not defined, the step has no 792 // time limit and will be allowed to continue to run until either it completes 793 // or the build itself times out. 794 google.protobuf.Duration timeout = 11; 795 796 // Output only. Status of the build step. At this time, build step status is 797 // only updated on build completion; step status is not updated in real-time 798 // as the build progresses. 799 Build.Status status = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; 800 801 // Allow this build step to fail without failing the entire build. 802 // 803 // If false, the entire build will fail if this step fails. Otherwise, the 804 // build will succeed, but this step will still have a failure status. 805 // Error information will be reported in the failure_detail field. 806 bool allow_failure = 14; 807 808 // Output only. Return code from running the step. 809 int32 exit_code = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; 810 811 // Allow this build step to fail without failing the entire build if and 812 // only if the exit code is one of the specified codes. If allow_failure 813 // is also specified, this field will take precedence. 814 repeated int32 allow_exit_codes = 18; 815 816 // A shell script to be executed in the step. 817 // 818 // When script is provided, the user cannot specify the entrypoint or args. 819 string script = 19; 820 821 // Option to include built-in and custom substitutions as env variables 822 // for this build step. This option will override the global option 823 // in BuildOption. 824 optional bool automap_substitutions = 20; 825} 826 827// Volume describes a Docker container volume which is mounted into build steps 828// in order to persist files across build step execution. 829message Volume { 830 // Name of the volume to mount. 831 // 832 // Volume names must be unique per build step and must be valid names for 833 // Docker volumes. Each named volume must be used by at least two build steps. 834 string name = 1; 835 836 // Path at which to mount the volume. 837 // 838 // Paths must be absolute and cannot conflict with other volume paths on the 839 // same build step or with certain reserved volume paths. 840 string path = 2; 841} 842 843// Artifacts created by the build pipeline. 844message Results { 845 // Container images that were built as a part of the build. 846 repeated BuiltImage images = 2; 847 848 // List of build step digests, in the order corresponding to build step 849 // indices. 850 repeated string build_step_images = 3; 851 852 // Path to the artifact manifest for non-container artifacts uploaded to Cloud 853 // Storage. Only populated when artifacts are uploaded to Cloud Storage. 854 string artifact_manifest = 4; 855 856 // Number of non-container artifacts uploaded to Cloud Storage. Only populated 857 // when artifacts are uploaded to Cloud Storage. 858 int64 num_artifacts = 5; 859 860 // List of build step outputs, produced by builder images, in the order 861 // corresponding to build step indices. 862 // 863 // [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) 864 // can produce this output by writing to `$BUILDER_OUTPUT/output`. 865 // Only the first 4KB of data is stored. 866 repeated bytes build_step_outputs = 6; 867 868 // Time to push all non-container artifacts to Cloud Storage. 869 TimeSpan artifact_timing = 7; 870 871 // Python artifacts uploaded to Artifact Registry at the end of the build. 872 repeated UploadedPythonPackage python_packages = 8; 873 874 // Maven artifacts uploaded to Artifact Registry at the end of the build. 875 repeated UploadedMavenArtifact maven_artifacts = 9; 876 877 // Npm packages uploaded to Artifact Registry at the end of the build. 878 repeated UploadedNpmPackage npm_packages = 12; 879} 880 881// An artifact that was uploaded during a build. This 882// is a single record in the artifact manifest JSON file. 883message ArtifactResult { 884 // The path of an artifact in a Cloud Storage bucket, with the 885 // generation number. For example, 886 // `gs://mybucket/path/to/output.jar#generation`. 887 string location = 1; 888 889 // The file hash of the artifact. 890 repeated FileHashes file_hash = 2; 891} 892 893// A build resource in the Cloud Build API. 894// 895// At a high level, a `Build` describes where to find source code, how to build 896// it (for example, the builder image to run on the source), and where to store 897// the built artifacts. 898// 899// Fields can include the following variables, which will be expanded when the 900// build is created: 901// 902// - $PROJECT_ID: the project ID of the build. 903// - $PROJECT_NUMBER: the project number of the build. 904// - $LOCATION: the location/region of the build. 905// - $BUILD_ID: the autogenerated ID of the build. 906// - $REPO_NAME: the source repository name specified by RepoSource. 907// - $BRANCH_NAME: the branch name specified by RepoSource. 908// - $TAG_NAME: the tag name specified by RepoSource. 909// - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or 910// resolved from the specified branch or tag. 911// - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA. 912message Build { 913 option (google.api.resource) = { 914 type: "cloudbuild.googleapis.com/Build" 915 pattern: "projects/{project}/builds/{build}" 916 pattern: "projects/{project}/locations/{location}/builds/{build}" 917 }; 918 919 // Possible status of a build or build step. 920 enum Status { 921 // Status of the build is unknown. 922 STATUS_UNKNOWN = 0; 923 924 // Build has been created and is pending execution and queuing. It has not 925 // been queued. 926 PENDING = 10; 927 928 // Build or step is queued; work has not yet begun. 929 QUEUED = 1; 930 931 // Build or step is being executed. 932 WORKING = 2; 933 934 // Build or step finished successfully. 935 SUCCESS = 3; 936 937 // Build or step failed to complete successfully. 938 FAILURE = 4; 939 940 // Build or step failed due to an internal cause. 941 INTERNAL_ERROR = 5; 942 943 // Build or step took longer than was allowed. 944 TIMEOUT = 6; 945 946 // Build or step was canceled by a user. 947 CANCELLED = 7; 948 949 // Build was enqueued for longer than the value of `queue_ttl`. 950 EXPIRED = 9; 951 } 952 953 // A non-fatal problem encountered during the execution of the build. 954 message Warning { 955 // The relative importance of this warning. 956 enum Priority { 957 // Should not be used. 958 PRIORITY_UNSPECIFIED = 0; 959 960 // e.g. deprecation warnings and alternative feature highlights. 961 INFO = 1; 962 963 // e.g. automated detection of possible issues with the build. 964 WARNING = 2; 965 966 // e.g. alerts that a feature used in the build is pending removal 967 ALERT = 3; 968 } 969 970 // Explanation of the warning generated. 971 string text = 1; 972 973 // The priority for this warning. 974 Priority priority = 2; 975 } 976 977 // A fatal problem encountered during the execution of the build. 978 message FailureInfo { 979 // The name of a fatal problem encountered during the execution of the 980 // build. 981 enum FailureType { 982 // Type unspecified 983 FAILURE_TYPE_UNSPECIFIED = 0; 984 985 // Unable to push the image to the repository. 986 PUSH_FAILED = 1; 987 988 // Final image not found. 989 PUSH_IMAGE_NOT_FOUND = 2; 990 991 // Unauthorized push of the final image. 992 PUSH_NOT_AUTHORIZED = 3; 993 994 // Backend logging failures. Should retry. 995 LOGGING_FAILURE = 4; 996 997 // A build step has failed. 998 USER_BUILD_STEP = 5; 999 1000 // The source fetching has failed. 1001 FETCH_SOURCE_FAILED = 6; 1002 } 1003 1004 // The name of the failure. 1005 FailureType type = 1; 1006 1007 // Explains the failure issue in more detail using hard-coded text. 1008 string detail = 2; 1009 } 1010 1011 // Output only. The 'Build' name with format: 1012 // `projects/{project}/locations/{location}/builds/{build}`, where {build} 1013 // is a unique identifier generated by the service. 1014 string name = 45 [(google.api.field_behavior) = OUTPUT_ONLY]; 1015 1016 // Output only. Unique identifier of the build. 1017 string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 1018 1019 // Output only. ID of the project. 1020 string project_id = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; 1021 1022 // Output only. Status of the build. 1023 Status status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 1024 1025 // Output only. Customer-readable message about the current status. 1026 string status_detail = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; 1027 1028 // The location of the source files to build. 1029 Source source = 3; 1030 1031 // Required. The operations to be performed on the workspace. 1032 repeated BuildStep steps = 11; 1033 1034 // Output only. Results of the build. 1035 Results results = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; 1036 1037 // Output only. Time at which the request to create the build was received. 1038 google.protobuf.Timestamp create_time = 6 1039 [(google.api.field_behavior) = OUTPUT_ONLY]; 1040 1041 // Output only. Time at which execution of the build was started. 1042 google.protobuf.Timestamp start_time = 7 1043 [(google.api.field_behavior) = OUTPUT_ONLY]; 1044 1045 // Output only. Time at which execution of the build was finished. 1046 // 1047 // The difference between finish_time and start_time is the duration of the 1048 // build's execution. 1049 google.protobuf.Timestamp finish_time = 8 1050 [(google.api.field_behavior) = OUTPUT_ONLY]; 1051 1052 // Amount of time that this build should be allowed to run, to second 1053 // granularity. If this amount of time elapses, work on the build will cease 1054 // and the build status will be `TIMEOUT`. 1055 // 1056 // `timeout` starts ticking from `startTime`. 1057 // 1058 // Default time is 60 minutes. 1059 google.protobuf.Duration timeout = 12; 1060 1061 // A list of images to be pushed upon the successful completion of all build 1062 // steps. 1063 // 1064 // The images are pushed using the builder service account's credentials. 1065 // 1066 // The digests of the pushed images will be stored in the `Build` resource's 1067 // results field. 1068 // 1069 // If any of the images fail to be pushed, the build status is marked 1070 // `FAILURE`. 1071 repeated string images = 13; 1072 1073 // TTL in queue for this build. If provided and the build is enqueued longer 1074 // than this value, the build will expire and the build status will be 1075 // `EXPIRED`. 1076 // 1077 // The TTL starts ticking from create_time. 1078 google.protobuf.Duration queue_ttl = 40; 1079 1080 // Artifacts produced by the build that should be uploaded upon 1081 // successful completion of all build steps. 1082 Artifacts artifacts = 37; 1083 1084 // Cloud Storage bucket where logs should be written (see 1085 // [Bucket Name 1086 // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). 1087 // Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. 1088 string logs_bucket = 19; 1089 1090 // Output only. A permanent fixed identifier for source. 1091 SourceProvenance source_provenance = 21 1092 [(google.api.field_behavior) = OUTPUT_ONLY]; 1093 1094 // Output only. The ID of the `BuildTrigger` that triggered this build, if it 1095 // was triggered automatically. 1096 string build_trigger_id = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; 1097 1098 // Special options for this build. 1099 BuildOptions options = 23; 1100 1101 // Output only. URL to logs for this build in Google Cloud Console. 1102 string log_url = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; 1103 1104 // Substitutions data for `Build` resource. 1105 map<string, string> substitutions = 29; 1106 1107 // Tags for annotation of a `Build`. These are not docker tags. 1108 repeated string tags = 31; 1109 1110 // Secrets to decrypt using Cloud Key Management Service. 1111 // Note: Secret Manager is the recommended technique 1112 // for managing sensitive data with Cloud Build. Use `available_secrets` to 1113 // configure builds to access secrets from Secret Manager. For instructions, 1114 // see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets 1115 repeated Secret secrets = 32; 1116 1117 // Output only. Stores timing information for phases of the build. Valid keys 1118 // are: 1119 // 1120 // * BUILD: time to execute all build steps. 1121 // * PUSH: time to push all artifacts including docker images and non docker 1122 // artifacts. 1123 // * FETCHSOURCE: time to fetch source. 1124 // * SETUPBUILD: time to set up build. 1125 // 1126 // If the build does not specify source or images, 1127 // these keys will not be included. 1128 map<string, TimeSpan> timing = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; 1129 1130 // Output only. Describes this build's approval configuration, status, 1131 // and result. 1132 BuildApproval approval = 44 [(google.api.field_behavior) = OUTPUT_ONLY]; 1133 1134 // IAM service account whose credentials will be used at build runtime. 1135 // Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. 1136 // ACCOUNT can be email address or uniqueId of the service account. 1137 // 1138 string service_account = 42 [(google.api.resource_reference) = { 1139 type: "iam.googleapis.com/ServiceAccount" 1140 }]; 1141 1142 // Secrets and secret environment variables. 1143 Secrets available_secrets = 47; 1144 1145 // Output only. Non-fatal problems encountered during the execution of the 1146 // build. 1147 repeated Warning warnings = 49 [(google.api.field_behavior) = OUTPUT_ONLY]; 1148 1149 // Output only. Contains information about the build when status=FAILURE. 1150 FailureInfo failure_info = 51 [(google.api.field_behavior) = OUTPUT_ONLY]; 1151} 1152 1153// Artifacts produced by a build that should be uploaded upon 1154// successful completion of all build steps. 1155message Artifacts { 1156 // Files in the workspace to upload to Cloud Storage upon successful 1157 // completion of all build steps. 1158 message ArtifactObjects { 1159 // Cloud Storage bucket and optional object path, in the form 1160 // "gs://bucket/path/to/somewhere/". (see [Bucket Name 1161 // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). 1162 // 1163 // Files in the workspace matching any path pattern will be uploaded to 1164 // Cloud Storage with this location as a prefix. 1165 string location = 1; 1166 1167 // Path globs used to match files in the build's workspace. 1168 repeated string paths = 2; 1169 1170 // Output only. Stores timing information for pushing all artifact objects. 1171 TimeSpan timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 1172 } 1173 1174 // A Maven artifact to upload to Artifact Registry upon successful completion 1175 // of all build steps. 1176 message MavenArtifact { 1177 // Artifact Registry repository, in the form 1178 // "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" 1179 // 1180 // Artifact in the workspace specified by path will be uploaded to 1181 // Artifact Registry with this location as a prefix. 1182 string repository = 1; 1183 1184 // Path to an artifact in the build's workspace to be uploaded to 1185 // Artifact Registry. 1186 // This can be either an absolute path, 1187 // e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar 1188 // or a relative path from /workspace, 1189 // e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. 1190 string path = 2; 1191 1192 // Maven `artifactId` value used when uploading the artifact to Artifact 1193 // Registry. 1194 string artifact_id = 3; 1195 1196 // Maven `groupId` value used when uploading the artifact to Artifact 1197 // Registry. 1198 string group_id = 4; 1199 1200 // Maven `version` value used when uploading the artifact to Artifact 1201 // Registry. 1202 string version = 5; 1203 } 1204 1205 // Python package to upload to Artifact Registry upon successful completion 1206 // of all build steps. A package can encapsulate multiple objects to be 1207 // uploaded to a single repository. 1208 message PythonPackage { 1209 // Artifact Registry repository, in the form 1210 // "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" 1211 // 1212 // Files in the workspace matching any path pattern will be uploaded to 1213 // Artifact Registry with this location as a prefix. 1214 string repository = 1; 1215 1216 // Path globs used to match files in the build's workspace. For Python/ 1217 // Twine, this is usually `dist/*`, and sometimes additionally an `.asc` 1218 // file. 1219 repeated string paths = 2; 1220 } 1221 1222 // Npm package to upload to Artifact Registry upon successful completion 1223 // of all build steps. 1224 message NpmPackage { 1225 // Artifact Registry repository, in the form 1226 // "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY" 1227 // 1228 // Npm package in the workspace specified by path will be zipped and 1229 // uploaded to Artifact Registry with this location as a prefix. 1230 string repository = 1; 1231 1232 // Path to the package.json. 1233 // e.g. workspace/path/to/package 1234 string package_path = 2; 1235 } 1236 1237 // A list of images to be pushed upon the successful completion of all build 1238 // steps. 1239 // 1240 // The images will be pushed using the builder service account's credentials. 1241 // 1242 // The digests of the pushed images will be stored in the Build resource's 1243 // results field. 1244 // 1245 // If any of the images fail to be pushed, the build is marked FAILURE. 1246 repeated string images = 1; 1247 1248 // A list of objects to be uploaded to Cloud Storage upon successful 1249 // completion of all build steps. 1250 // 1251 // Files in the workspace matching specified paths globs will be uploaded to 1252 // the specified Cloud Storage location using the builder service account's 1253 // credentials. 1254 // 1255 // The location and generation of the uploaded objects will be stored in the 1256 // Build resource's results field. 1257 // 1258 // If any objects fail to be pushed, the build is marked FAILURE. 1259 ArtifactObjects objects = 2; 1260 1261 // A list of Maven artifacts to be uploaded to Artifact Registry upon 1262 // successful completion of all build steps. 1263 // 1264 // Artifacts in the workspace matching specified paths globs will be uploaded 1265 // to the specified Artifact Registry repository using the builder service 1266 // account's credentials. 1267 // 1268 // If any artifacts fail to be pushed, the build is marked FAILURE. 1269 repeated MavenArtifact maven_artifacts = 3; 1270 1271 // A list of Python packages to be uploaded to Artifact Registry upon 1272 // successful completion of all build steps. 1273 // 1274 // The build service account credentials will be used to perform the upload. 1275 // 1276 // If any objects fail to be pushed, the build is marked FAILURE. 1277 repeated PythonPackage python_packages = 5; 1278 1279 // A list of npm packages to be uploaded to Artifact Registry upon 1280 // successful completion of all build steps. 1281 // 1282 // Npm packages in the specified paths will be uploaded 1283 // to the specified Artifact Registry repository using the builder service 1284 // account's credentials. 1285 // 1286 // If any packages fail to be pushed, the build is marked FAILURE. 1287 repeated NpmPackage npm_packages = 6; 1288} 1289 1290// Start and end times for a build execution phase. 1291message TimeSpan { 1292 // Start of time span. 1293 google.protobuf.Timestamp start_time = 1; 1294 1295 // End of time span. 1296 google.protobuf.Timestamp end_time = 2; 1297} 1298 1299// Metadata for build operations. 1300message BuildOperationMetadata { 1301 // The build that the operation is tracking. 1302 Build build = 1; 1303} 1304 1305// Provenance of the source. Ways to find the original source, or verify that 1306// some source was used for this build. 1307message SourceProvenance { 1308 // A copy of the build's `source.storage_source`, if exists, with any 1309 // generations resolved. 1310 StorageSource resolved_storage_source = 3; 1311 1312 // A copy of the build's `source.repo_source`, if exists, with any 1313 // revisions resolved. 1314 RepoSource resolved_repo_source = 6; 1315 1316 // A copy of the build's `source.storage_source_manifest`, if exists, with any 1317 // revisions resolved. 1318 // This feature is in Preview. 1319 StorageSourceManifest resolved_storage_source_manifest = 9; 1320 1321 // Output only. Hash(es) of the build source, which can be used to verify that 1322 // the original source integrity was maintained in the build. Note that 1323 // `FileHashes` will only be populated if `BuildOptions` has requested a 1324 // `SourceProvenanceHash`. 1325 // 1326 // The keys to this map are file paths used as build source and the values 1327 // contain the hash values for those files. 1328 // 1329 // If the build source came in a single package such as a gzipped tarfile 1330 // (`.tar.gz`), the `FileHash` will be for the single path to that file. 1331 map<string, FileHashes> file_hashes = 4 1332 [(google.api.field_behavior) = OUTPUT_ONLY]; 1333} 1334 1335// Container message for hashes of byte content of files, used in 1336// SourceProvenance messages to verify integrity of source input to the build. 1337message FileHashes { 1338 // Collection of file hashes. 1339 repeated Hash file_hash = 1; 1340} 1341 1342// Container message for hash values. 1343message Hash { 1344 // Specifies the hash algorithm, if any. 1345 enum HashType { 1346 // No hash requested. 1347 NONE = 0; 1348 1349 // Use a sha256 hash. 1350 SHA256 = 1; 1351 1352 // Use a md5 hash. 1353 MD5 = 2; 1354 1355 // Use a sha512 hash. 1356 SHA512 = 4; 1357 } 1358 1359 // The type of hash that was performed. 1360 HashType type = 1; 1361 1362 // The hash value. 1363 bytes value = 2; 1364} 1365 1366// Secrets and secret environment variables. 1367message Secrets { 1368 // Secrets in Secret Manager and associated secret environment variable. 1369 repeated SecretManagerSecret secret_manager = 1; 1370 1371 // Secrets encrypted with KMS key and the associated secret environment 1372 // variable. 1373 repeated InlineSecret inline = 2; 1374} 1375 1376// Pairs a set of secret environment variables mapped to encrypted 1377// values with the Cloud KMS key to use to decrypt the value. 1378message InlineSecret { 1379 // Resource name of Cloud KMS crypto key to decrypt the encrypted value. 1380 // In format: projects/*/locations/*/keyRings/*/cryptoKeys/* 1381 string kms_key_name = 1 [(google.api.resource_reference) = { 1382 type: "cloudkms.googleapis.com/CryptoKey" 1383 }]; 1384 1385 // Map of environment variable name to its encrypted value. 1386 // 1387 // Secret environment variables must be unique across all of a build's 1388 // secrets, and must be used by at least one build step. Values can be at most 1389 // 64 KB in size. There can be at most 100 secret values across all of a 1390 // build's secrets. 1391 map<string, bytes> env_map = 2; 1392} 1393 1394// Pairs a secret environment variable with a SecretVersion in Secret Manager. 1395message SecretManagerSecret { 1396 // Resource name of the SecretVersion. In format: 1397 // projects/*/secrets/*/versions/* 1398 string version_name = 1 [(google.api.resource_reference) = { 1399 type: "secretmanager.googleapis.com/SecretVersion" 1400 }]; 1401 1402 // Environment variable name to associate with the secret. 1403 // Secret environment variables must be unique across all of a build's 1404 // secrets, and must be used by at least one build step. 1405 string env = 2; 1406} 1407 1408// Pairs a set of secret environment variables containing encrypted 1409// values with the Cloud KMS key to use to decrypt the value. 1410// Note: Use `kmsKeyName` with `available_secrets` instead of using 1411// `kmsKeyName` with `secret`. For instructions see: 1412// https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials. 1413message Secret { 1414 // Cloud KMS key name to use to decrypt these envs. 1415 string kms_key_name = 1; 1416 1417 // Map of environment variable name to its encrypted value. 1418 // 1419 // Secret environment variables must be unique across all of a build's 1420 // secrets, and must be used by at least one build step. Values can be at most 1421 // 64 KB in size. There can be at most 100 secret values across all of a 1422 // build's secrets. 1423 map<string, bytes> secret_env = 3; 1424} 1425 1426// Request to create a new build. 1427message CreateBuildRequest { 1428 // The parent resource where this build will be created. 1429 // Format: `projects/{project}/locations/{location}` 1430 string parent = 4 [(google.api.resource_reference) = { 1431 child_type: "cloudbuild.googleapis.com/Build" 1432 }]; 1433 1434 // Required. ID of the project. 1435 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 1436 1437 // Required. Build resource to create. 1438 Build build = 2 [(google.api.field_behavior) = REQUIRED]; 1439} 1440 1441// Request to get a build. 1442message GetBuildRequest { 1443 // The name of the `Build` to retrieve. 1444 // Format: `projects/{project}/locations/{location}/builds/{build}` 1445 string name = 4 [(google.api.resource_reference) = { 1446 type: "cloudbuild.googleapis.com/Build" 1447 }]; 1448 1449 // Required. ID of the project. 1450 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 1451 1452 // Required. ID of the build. 1453 string id = 2 [(google.api.field_behavior) = REQUIRED]; 1454} 1455 1456// Request to list builds. 1457message ListBuildsRequest { 1458 // The parent of the collection of `Builds`. 1459 // Format: `projects/{project}/locations/{location}` 1460 string parent = 9 [(google.api.resource_reference) = { 1461 child_type: "cloudbuild.googleapis.com/Build" 1462 }]; 1463 1464 // Required. ID of the project. 1465 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 1466 1467 // Number of results to return in the list. 1468 int32 page_size = 2; 1469 1470 // The page token for the next page of Builds. 1471 // 1472 // If unspecified, the first page of results is returned. 1473 // 1474 // If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. 1475 // In this case, the token should be discarded, and pagination should be 1476 // restarted from the first page of results. 1477 // 1478 // See https://google.aip.dev/158 for more. 1479 string page_token = 3; 1480 1481 // The raw filter text to constrain the results. 1482 string filter = 8; 1483} 1484 1485// Response including listed builds. 1486message ListBuildsResponse { 1487 // Builds will be sorted by `create_time`, descending. 1488 repeated Build builds = 1; 1489 1490 // Token to receive the next page of results. 1491 // This will be absent if the end of the response list has been reached. 1492 string next_page_token = 2; 1493} 1494 1495// Request to cancel an ongoing build. 1496message CancelBuildRequest { 1497 // The name of the `Build` to cancel. 1498 // Format: `projects/{project}/locations/{location}/builds/{build}` 1499 string name = 4 [(google.api.resource_reference) = { 1500 type: "cloudbuild.googleapis.com/Build" 1501 }]; 1502 1503 // Required. ID of the project. 1504 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 1505 1506 // Required. ID of the build. 1507 string id = 2 [(google.api.field_behavior) = REQUIRED]; 1508} 1509 1510// Request to approve or reject a pending build. 1511message ApproveBuildRequest { 1512 // Required. Name of the target build. 1513 // For example: "projects/{$project_id}/builds/{$build_id}" 1514 string name = 1 [(google.api.field_behavior) = REQUIRED]; 1515 1516 // Approval decision and metadata. 1517 ApprovalResult approval_result = 2; 1518} 1519 1520// BuildApproval describes a build's approval configuration, state, and 1521// result. 1522message BuildApproval { 1523 // Specifies the current state of a build's approval. 1524 enum State { 1525 // Default enum type. This should not be used. 1526 STATE_UNSPECIFIED = 0; 1527 1528 // Build approval is pending. 1529 PENDING = 1; 1530 1531 // Build approval has been approved. 1532 APPROVED = 2; 1533 1534 // Build approval has been rejected. 1535 REJECTED = 3; 1536 1537 // Build was cancelled while it was still pending approval. 1538 CANCELLED = 5; 1539 } 1540 1541 // Output only. The state of this build's approval. 1542 State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 1543 1544 // Output only. Configuration for manual approval of this build. 1545 ApprovalConfig config = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 1546 1547 // Output only. Result of manual approval for this Build. 1548 ApprovalResult result = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 1549} 1550 1551// ApprovalConfig describes configuration for manual approval of a build. 1552message ApprovalConfig { 1553 // Whether or not approval is needed. If this is set on a build, it will 1554 // become pending when created, and will need to be explicitly approved 1555 // to start. 1556 bool approval_required = 1; 1557} 1558 1559// ApprovalResult describes the decision and associated metadata of a manual 1560// approval of a build. 1561message ApprovalResult { 1562 // Specifies whether or not this manual approval result is to approve 1563 // or reject a build. 1564 enum Decision { 1565 // Default enum type. This should not be used. 1566 DECISION_UNSPECIFIED = 0; 1567 1568 // Build is approved. 1569 APPROVED = 1; 1570 1571 // Build is rejected. 1572 REJECTED = 2; 1573 } 1574 1575 // Output only. Email of the user that called the ApproveBuild API to 1576 // approve or reject a build at the time that the API was called. 1577 string approver_account = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 1578 1579 // Output only. The time when the approval decision was made. 1580 google.protobuf.Timestamp approval_time = 3 1581 [(google.api.field_behavior) = OUTPUT_ONLY]; 1582 1583 // Required. The decision of this manual approval. 1584 Decision decision = 4 [(google.api.field_behavior) = REQUIRED]; 1585 1586 // Optional. An optional comment for this manual approval result. 1587 string comment = 5 [(google.api.field_behavior) = OPTIONAL]; 1588 1589 // Optional. An optional URL tied to this manual approval result. This field 1590 // is essentially the same as comment, except that it will be rendered by the 1591 // UI differently. An example use case is a link to an external job that 1592 // approved this Build. 1593 string url = 6 [(google.api.field_behavior) = OPTIONAL]; 1594} 1595 1596// GitRepoSource describes a repo and ref of a code repository. 1597message GitRepoSource { 1598 // The URI of the repo (e.g. https://github.com/user/repo.git). 1599 // Either `uri` or `repository` can be specified and is required. 1600 string uri = 1; 1601 1602 // The source of the SCM repo. 1603 oneof source { 1604 // The connected repository resource name, in the format 1605 // `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or 1606 // `repository` can be specified and is required. 1607 string repository = 6 [(google.api.resource_reference) = { 1608 type: "cloudbuild.googleapis.com/Repository" 1609 }]; 1610 } 1611 1612 // The branch or tag to use. Must start with "refs/" (required). 1613 string ref = 2; 1614 1615 // See RepoType below. 1616 GitFileSource.RepoType repo_type = 3; 1617 1618 // The resource name of the enterprise config that should be applied 1619 // to this source. 1620 oneof enterprise_config { 1621 // The full resource name of the github enterprise config. 1622 // Format: 1623 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. 1624 // `projects/{project}/githubEnterpriseConfigs/{id}`. 1625 string github_enterprise_config = 4 [(google.api.resource_reference) = { 1626 type: "cloudbuild.googleapis.com/GithubEnterpriseConfig" 1627 }]; 1628 } 1629} 1630 1631// GitFileSource describes a file within a (possibly remote) code repository. 1632message GitFileSource { 1633 // The type of the repo, since it may not be explicit from the `repo` field 1634 // (e.g from a URL). 1635 enum RepoType { 1636 // The default, unknown repo type. Don't use it, instead use one of 1637 // the other repo types. 1638 UNKNOWN = 0; 1639 1640 // A Google Cloud Source Repositories-hosted repo. 1641 CLOUD_SOURCE_REPOSITORIES = 1; 1642 1643 // A GitHub-hosted repo not necessarily on "github.com" (i.e. GitHub 1644 // Enterprise). 1645 GITHUB = 2; 1646 1647 // A Bitbucket Server-hosted repo. 1648 BITBUCKET_SERVER = 3; 1649 1650 // A GitLab-hosted repo. 1651 GITLAB = 4; 1652 } 1653 1654 // The path of the file, with the repo root as the root of the path. 1655 string path = 1; 1656 1657 // The URI of the repo. 1658 // Either uri or repository can be specified. 1659 // If unspecified, the repo from which the trigger invocation originated is 1660 // assumed to be the repo from which to read the specified path. 1661 string uri = 2; 1662 1663 // The source of the SCM repo. 1664 oneof source { 1665 // The fully qualified resource name of the Repos API repository. 1666 // Either URI or repository can be specified. 1667 // If unspecified, the repo from which the trigger invocation originated is 1668 // assumed to be the repo from which to read the specified path. 1669 string repository = 7 [(google.api.resource_reference) = { 1670 type: "cloudbuild.googleapis.com/Repository" 1671 }]; 1672 } 1673 1674 // See RepoType above. 1675 RepoType repo_type = 3; 1676 1677 // The branch, tag, arbitrary ref, or SHA version of the repo to use when 1678 // resolving the filename (optional). 1679 // This field respects the same syntax/resolution as described here: 1680 // https://git-scm.com/docs/gitrevisions 1681 // If unspecified, the revision from which the trigger invocation originated 1682 // is assumed to be the revision from which to read the specified path. 1683 string revision = 4; 1684 1685 // The resource name of the enterprise config that should be applied 1686 // to this source. 1687 oneof enterprise_config { 1688 // The full resource name of the github enterprise config. 1689 // Format: 1690 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. 1691 // `projects/{project}/githubEnterpriseConfigs/{id}`. 1692 string github_enterprise_config = 5 [(google.api.resource_reference) = { 1693 type: "cloudbuild.googleapis.com/GithubEnterpriseConfig" 1694 }]; 1695 } 1696} 1697 1698// Configuration for an automated build in response to source repository 1699// changes. 1700message BuildTrigger { 1701 option (google.api.resource) = { 1702 type: "cloudbuild.googleapis.com/BuildTrigger" 1703 pattern: "projects/{project}/triggers/{trigger}" 1704 pattern: "projects/{project}/locations/{location}/triggers/{trigger}" 1705 plural: "triggers" 1706 singular: "trigger" 1707 }; 1708 1709 // The `Trigger` name with format: 1710 // `projects/{project}/locations/{location}/triggers/{trigger}`, where 1711 // {trigger} is a unique identifier generated by the service. 1712 string resource_name = 34; 1713 1714 // Output only. Unique identifier of the trigger. 1715 string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 1716 1717 // Human-readable description of this trigger. 1718 string description = 10; 1719 1720 // User-assigned name of the trigger. Must be unique within the project. 1721 // Trigger names must meet the following requirements: 1722 // 1723 // + They must contain only alphanumeric characters and dashes. 1724 // + They can be 1-64 characters long. 1725 // + They must begin and end with an alphanumeric character. 1726 string name = 21; 1727 1728 // Tags for annotation of a `BuildTrigger` 1729 repeated string tags = 19; 1730 1731 // Template describing the types of source changes to trigger a build. 1732 // 1733 // Branch and tag names in trigger templates are interpreted as regular 1734 // expressions. Any branch or tag change that matches that regular expression 1735 // will trigger a build. 1736 // 1737 // Mutually exclusive with `github`. 1738 RepoSource trigger_template = 7; 1739 1740 // GitHubEventsConfig describes the configuration of a trigger that creates 1741 // a build whenever a GitHub event is received. 1742 // 1743 // Mutually exclusive with `trigger_template`. 1744 GitHubEventsConfig github = 13; 1745 1746 // PubsubConfig describes the configuration of a trigger that 1747 // creates a build whenever a Pub/Sub message is published. 1748 PubsubConfig pubsub_config = 29; 1749 1750 // WebhookConfig describes the configuration of a trigger that 1751 // creates a build whenever a webhook is sent to a trigger's webhook URL. 1752 WebhookConfig webhook_config = 31; 1753 1754 // Template describing the Build request to make when the trigger is matched. 1755 // At least one of the template fields must be provided. 1756 oneof build_template { 1757 // Autodetect build configuration. The following precedence is used (case 1758 // insensitive): 1759 // 1760 // 1. cloudbuild.yaml 1761 // 2. cloudbuild.yml 1762 // 3. cloudbuild.json 1763 // 4. Dockerfile 1764 // 1765 // Currently only available for GitHub App Triggers. 1766 bool autodetect = 18; 1767 1768 // Contents of the build template. 1769 Build build = 4; 1770 1771 // Path, from the source root, to the build configuration file 1772 // (i.e. cloudbuild.yaml). 1773 string filename = 8; 1774 1775 // The file source describing the local or remote Build template. 1776 GitFileSource git_file_source = 24; 1777 } 1778 1779 // Output only. Time when the trigger was created. 1780 google.protobuf.Timestamp create_time = 5 1781 [(google.api.field_behavior) = OUTPUT_ONLY]; 1782 1783 // If true, the trigger will never automatically execute a build. 1784 bool disabled = 9; 1785 1786 // Substitutions for Build resource. The keys must match the following 1787 // regular expression: `^_[A-Z0-9_]+$`. 1788 map<string, string> substitutions = 11; 1789 1790 // ignored_files and included_files are file glob matches using 1791 // https://golang.org/pkg/path/filepath/#Match extended with support for "**". 1792 // 1793 // If ignored_files and changed files are both empty, then they are 1794 // not used to determine whether or not to trigger a build. 1795 // 1796 // If ignored_files is not empty, then we ignore any files that match 1797 // any of the ignored_file globs. If the change has no files that are 1798 // outside of the ignored_files globs, then we do not trigger a build. 1799 repeated string ignored_files = 15; 1800 1801 // If any of the files altered in the commit pass the ignored_files 1802 // filter and included_files is empty, then as far as this filter is 1803 // concerned, we should trigger the build. 1804 // 1805 // If any of the files altered in the commit pass the ignored_files 1806 // filter and included_files is not empty, then we make sure that at 1807 // least one of those files matches a included_files glob. If not, 1808 // then we do not trigger a build. 1809 repeated string included_files = 16; 1810 1811 // Optional. A Common Expression Language string. 1812 string filter = 30 [(google.api.field_behavior) = OPTIONAL]; 1813 1814 // The repo and ref of the repository from which to build. This field 1815 // is used only for those triggers that do not respond to SCM events. 1816 // Triggers that respond to such events build source at whatever commit 1817 // caused the event. 1818 // This field is currently only used by Webhook, Pub/Sub, Manual, and Cron 1819 // triggers. 1820 GitRepoSource source_to_build = 26; 1821 1822 // The service account used for all user-controlled operations including 1823 // UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. 1824 // If no service account is set, then the standard Cloud Build service account 1825 // ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. 1826 // Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` 1827 string service_account = 33 [(google.api.resource_reference) = { 1828 type: "iam.googleapis.com/ServiceAccount" 1829 }]; 1830 1831 // The configuration of a trigger that creates a build whenever an event from 1832 // Repo API is received. 1833 RepositoryEventConfig repository_event_config = 39; 1834} 1835 1836// The configuration of a trigger that creates a build whenever an event from 1837// Repo API is received. 1838message RepositoryEventConfig { 1839 // All possible SCM repo types from Repo API. 1840 enum RepositoryType { 1841 // If unspecified, RepositoryType defaults to GITHUB. 1842 REPOSITORY_TYPE_UNSPECIFIED = 0; 1843 1844 // The SCM repo is GITHUB. 1845 GITHUB = 1; 1846 1847 // The SCM repo is GITHUB Enterprise. 1848 GITHUB_ENTERPRISE = 2; 1849 1850 // The SCM repo is GITLAB Enterprise. 1851 GITLAB_ENTERPRISE = 3; 1852 } 1853 1854 // The resource name of the Repo API resource. 1855 string repository = 1 [(google.api.resource_reference) = { 1856 type: "cloudbuild.googleapis.com/Repository" 1857 }]; 1858 1859 // Output only. The type of the SCM vendor the repository points to. 1860 RepositoryType repository_type = 2 1861 [(google.api.field_behavior) = OUTPUT_ONLY]; 1862 1863 // The types of filter to trigger a build. 1864 oneof filter { 1865 // Filter to match changes in pull requests. 1866 PullRequestFilter pull_request = 3; 1867 1868 // Filter to match changes in refs like branches, tags. 1869 PushFilter push = 4; 1870 } 1871} 1872 1873// GitHubEventsConfig describes the configuration of a trigger that creates a 1874// build whenever a GitHub event is received. 1875message GitHubEventsConfig { 1876 // The installationID that emits the GitHub event. 1877 int64 installation_id = 1 [deprecated = true]; 1878 1879 // Owner of the repository. For example: The owner for 1880 // https://github.com/googlecloudplatform/cloud-builders is 1881 // "googlecloudplatform". 1882 string owner = 6; 1883 1884 // Name of the repository. For example: The name for 1885 // https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". 1886 string name = 7; 1887 1888 // Filter describing the types of events to trigger a build. 1889 // Currently supported event types: push, pull_request. 1890 oneof event { 1891 // filter to match changes in pull requests. 1892 PullRequestFilter pull_request = 4; 1893 1894 // filter to match changes in refs like branches, tags. 1895 PushFilter push = 5; 1896 } 1897} 1898 1899// PubsubConfig describes the configuration of a trigger that 1900// creates a build whenever a Pub/Sub message is published. 1901message PubsubConfig { 1902 // Enumerates potential issues with the underlying Pub/Sub subscription 1903 // configuration. 1904 enum State { 1905 // The subscription configuration has not been checked. 1906 STATE_UNSPECIFIED = 0; 1907 1908 // The Pub/Sub subscription is properly configured. 1909 OK = 1; 1910 1911 // The subscription has been deleted. 1912 SUBSCRIPTION_DELETED = 2; 1913 1914 // The topic has been deleted. 1915 TOPIC_DELETED = 3; 1916 1917 // Some of the subscription's field are misconfigured. 1918 SUBSCRIPTION_MISCONFIGURED = 4; 1919 } 1920 1921 // Output only. Name of the subscription. Format is 1922 // `projects/{project}/subscriptions/{subscription}`. 1923 string subscription = 1 [ 1924 (google.api.field_behavior) = OUTPUT_ONLY, 1925 (google.api.resource_reference) = { 1926 type: "pubsub.googleapis.com/Subscription" 1927 } 1928 ]; 1929 1930 // The name of the topic from which this subscription is receiving messages. 1931 // Format is `projects/{project}/topics/{topic}`. 1932 string topic = 2 [ 1933 (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } 1934 ]; 1935 1936 // Service account that will make the push request. 1937 string service_account_email = 3 [(google.api.resource_reference) = { 1938 type: "iam.googleapis.com/ServiceAccount" 1939 }]; 1940 1941 // Potential issues with the underlying Pub/Sub subscription configuration. 1942 // Only populated on get requests. 1943 State state = 4; 1944} 1945 1946// WebhookConfig describes the configuration of a trigger that 1947// creates a build whenever a webhook is sent to a trigger's webhook URL. 1948message WebhookConfig { 1949 // Enumerates potential issues with the Secret Manager secret provided by the 1950 // user. 1951 enum State { 1952 // The webhook auth configuration not been checked. 1953 STATE_UNSPECIFIED = 0; 1954 1955 // The auth configuration is properly setup. 1956 OK = 1; 1957 1958 // The secret provided in auth_method has been deleted. 1959 SECRET_DELETED = 2; 1960 } 1961 1962 // Auth method specifies how the webhook authenticates with GCP. 1963 oneof auth_method { 1964 // Required. Resource name for the secret required as a URL parameter. 1965 string secret = 3 [ 1966 (google.api.field_behavior) = REQUIRED, 1967 (google.api.resource_reference) = { 1968 type: "secretmanager.googleapis.com/SecretVersion" 1969 } 1970 ]; 1971 } 1972 1973 // Potential issues with the underlying Pub/Sub subscription configuration. 1974 // Only populated on get requests. 1975 State state = 4; 1976} 1977 1978// PullRequestFilter contains filter properties for matching GitHub Pull 1979// Requests. 1980message PullRequestFilter { 1981 // Controls behavior of Pull Request comments. 1982 enum CommentControl { 1983 // Do not require comments on Pull Requests before builds are triggered. 1984 COMMENTS_DISABLED = 0; 1985 1986 // Enforce that repository owners or collaborators must comment on Pull 1987 // Requests before builds are triggered. 1988 COMMENTS_ENABLED = 1; 1989 1990 // Enforce that repository owners or collaborators must comment on external 1991 // contributors' Pull Requests before builds are triggered. 1992 COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2; 1993 } 1994 1995 // Target refs to match. 1996 // A target ref is the git reference where the pull request will be applied. 1997 oneof git_ref { 1998 // Regex of branches to match. 1999 // 2000 // The syntax of the regular expressions accepted is the syntax accepted by 2001 // RE2 and described at https://github.com/google/re2/wiki/Syntax 2002 string branch = 2; 2003 } 2004 2005 // Configure builds to run whether a repository owner or collaborator need to 2006 // comment `/gcbrun`. 2007 CommentControl comment_control = 5; 2008 2009 // If true, branches that do NOT match the git_ref will trigger a build. 2010 bool invert_regex = 6; 2011} 2012 2013// Push contains filter properties for matching GitHub git pushes. 2014message PushFilter { 2015 // Modified refs to match. 2016 // A modified refs are the refs modified by a git push operation. 2017 oneof git_ref { 2018 // Regexes matching branches to build. 2019 // 2020 // The syntax of the regular expressions accepted is the syntax accepted by 2021 // RE2 and described at https://github.com/google/re2/wiki/Syntax 2022 string branch = 2; 2023 2024 // Regexes matching tags to build. 2025 // 2026 // The syntax of the regular expressions accepted is the syntax accepted by 2027 // RE2 and described at https://github.com/google/re2/wiki/Syntax 2028 string tag = 3; 2029 } 2030 2031 // When true, only trigger a build if the revision regex does NOT match the 2032 // git_ref regex. 2033 bool invert_regex = 4; 2034} 2035 2036// Request to create a new `BuildTrigger`. 2037message CreateBuildTriggerRequest { 2038 // The parent resource where this trigger will be created. 2039 // Format: `projects/{project}/locations/{location}` 2040 string parent = 3 [(google.api.resource_reference) = { 2041 child_type: "cloudbuild.googleapis.com/BuildTrigger" 2042 }]; 2043 2044 // Required. ID of the project for which to configure automatic builds. 2045 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 2046 2047 // Required. `BuildTrigger` to create. 2048 BuildTrigger trigger = 2 [(google.api.field_behavior) = REQUIRED]; 2049} 2050 2051// Returns the `BuildTrigger` with the specified ID. 2052message GetBuildTriggerRequest { 2053 // The name of the `Trigger` to retrieve. 2054 // Format: `projects/{project}/locations/{location}/triggers/{trigger}` 2055 string name = 3 [(google.api.resource_reference) = { 2056 type: "cloudbuild.googleapis.com/BuildTrigger" 2057 }]; 2058 2059 // Required. ID of the project that owns the trigger. 2060 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 2061 2062 // Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. 2063 string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; 2064} 2065 2066// Request to list existing `BuildTriggers`. 2067message ListBuildTriggersRequest { 2068 // The parent of the collection of `Triggers`. 2069 // Format: `projects/{project}/locations/{location}` 2070 string parent = 4 [(google.api.resource_reference) = { 2071 child_type: "cloudbuild.googleapis.com/BuildTrigger" 2072 }]; 2073 2074 // Required. ID of the project for which to list BuildTriggers. 2075 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 2076 2077 // Number of results to return in the list. 2078 int32 page_size = 2; 2079 2080 // Token to provide to skip to a particular spot in the list. 2081 string page_token = 3; 2082} 2083 2084// Response containing existing `BuildTriggers`. 2085message ListBuildTriggersResponse { 2086 // `BuildTriggers` for the project, sorted by `create_time` descending. 2087 repeated BuildTrigger triggers = 1; 2088 2089 // Token to receive the next page of results. 2090 string next_page_token = 2; 2091} 2092 2093// Request to delete a `BuildTrigger`. 2094message DeleteBuildTriggerRequest { 2095 // The name of the `Trigger` to delete. 2096 // Format: `projects/{project}/locations/{location}/triggers/{trigger}` 2097 string name = 3 [(google.api.resource_reference) = { 2098 type: "cloudbuild.googleapis.com/BuildTrigger" 2099 }]; 2100 2101 // Required. ID of the project that owns the trigger. 2102 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 2103 2104 // Required. ID of the `BuildTrigger` to delete. 2105 string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; 2106} 2107 2108// Request to update an existing `BuildTrigger`. 2109message UpdateBuildTriggerRequest { 2110 // Required. ID of the project that owns the trigger. 2111 string project_id = 1 [(google.api.field_behavior) = REQUIRED]; 2112 2113 // Required. ID of the `BuildTrigger` to update. 2114 string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; 2115 2116 // Required. `BuildTrigger` to update. 2117 BuildTrigger trigger = 3 [(google.api.field_behavior) = REQUIRED]; 2118 2119 // Update mask for the resource. If this is set, 2120 // the server will only update the fields specified in the field mask. 2121 // Otherwise, a full update of the mutable resource fields will be performed. 2122 google.protobuf.FieldMask update_mask = 5; 2123} 2124 2125// Optional arguments to enable specific features of builds. 2126message BuildOptions { 2127 // Specifies the manner in which the build should be verified, if at all. 2128 // 2129 // If a verified build is requested, and any part of the process to generate 2130 // and upload provenance fails, the build will also fail. 2131 // 2132 // If the build does not request verification then that process may occur, but 2133 // is not guaranteed to. If it does occur and fails, the build will not fail. 2134 // 2135 // For more information, see [Viewing Build 2136 // Provenance](https://cloud.google.com/build/docs/securing-builds/view-build-provenance). 2137 enum VerifyOption { 2138 // Not a verifiable build (the default). 2139 NOT_VERIFIED = 0; 2140 2141 // Build must be verified. 2142 VERIFIED = 1; 2143 } 2144 2145 // Supported Compute Engine machine types. 2146 // For more information, see [Machine 2147 // types](https://cloud.google.com/compute/docs/machine-types). 2148 enum MachineType { 2149 // Standard machine type. 2150 UNSPECIFIED = 0; 2151 2152 // Highcpu machine with 8 CPUs. 2153 N1_HIGHCPU_8 = 1; 2154 2155 // Highcpu machine with 32 CPUs. 2156 N1_HIGHCPU_32 = 2; 2157 2158 // Highcpu e2 machine with 8 CPUs. 2159 E2_HIGHCPU_8 = 5; 2160 2161 // Highcpu e2 machine with 32 CPUs. 2162 E2_HIGHCPU_32 = 6; 2163 2164 // E2 machine with 1 CPU. 2165 E2_MEDIUM = 7; 2166 } 2167 2168 // Specifies the behavior when there is an error in the substitution checks. 2169 enum SubstitutionOption { 2170 // Fails the build if error in substitutions checks, like missing 2171 // a substitution in the template or in the map. 2172 MUST_MATCH = 0; 2173 2174 // Do not fail the build if error in substitutions checks. 2175 ALLOW_LOOSE = 1; 2176 } 2177 2178 // Specifies the behavior when writing build logs to Cloud Storage. 2179 enum LogStreamingOption { 2180 // Service may automatically determine build log streaming behavior. 2181 STREAM_DEFAULT = 0; 2182 2183 // Build logs should be streamed to Cloud Storage. 2184 STREAM_ON = 1; 2185 2186 // Build logs should not be streamed to Cloud Storage; they will be 2187 // written when the build is completed. 2188 STREAM_OFF = 2; 2189 } 2190 2191 // Details about how a build should be executed on a `WorkerPool`. 2192 // 2193 // See [running builds in a private 2194 // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) 2195 // for more information. 2196 message PoolOption { 2197 // The `WorkerPool` resource to execute the build on. 2198 // You must have `cloudbuild.workerpools.use` on the project hosting the 2199 // WorkerPool. 2200 // 2201 // Format projects/{project}/locations/{location}/workerPools/{workerPoolId} 2202 string name = 1 [(google.api.resource_reference) = { 2203 type: "cloudbuild.googleapis.com/WorkerPool" 2204 }]; 2205 } 2206 2207 // Specifies the logging mode. 2208 enum LoggingMode { 2209 // The service determines the logging mode. The default is `LEGACY`. Do not 2210 // rely on the default logging behavior as it may change in the future. 2211 LOGGING_UNSPECIFIED = 0; 2212 2213 // Build logs are stored in Cloud Logging and Cloud Storage. 2214 LEGACY = 1; 2215 2216 // Build logs are stored in Cloud Storage. 2217 GCS_ONLY = 2; 2218 2219 // This option is the same as CLOUD_LOGGING_ONLY. 2220 STACKDRIVER_ONLY = 3 [deprecated = true]; 2221 2222 // Build logs are stored in Cloud Logging. Selecting this option will not 2223 // allow [logs 2224 // streaming](https://cloud.google.com/sdk/gcloud/reference/builds/log). 2225 CLOUD_LOGGING_ONLY = 5; 2226 2227 // Turn off all logging. No build logs will be captured. 2228 NONE = 4; 2229 } 2230 2231 // Default GCS log bucket behavior options. 2232 enum DefaultLogsBucketBehavior { 2233 // Unspecified. 2234 DEFAULT_LOGS_BUCKET_BEHAVIOR_UNSPECIFIED = 0; 2235 2236 // Bucket is located in user-owned project in the same region as the 2237 // build. The builder service account must have access to create and write 2238 // to GCS buckets in the build project. 2239 REGIONAL_USER_OWNED_BUCKET = 1; 2240 } 2241 2242 // Requested hash for SourceProvenance. 2243 repeated Hash.HashType source_provenance_hash = 1; 2244 2245 // Requested verifiability options. 2246 VerifyOption requested_verify_option = 2; 2247 2248 // Compute Engine machine type on which to run the build. 2249 MachineType machine_type = 3; 2250 2251 // Requested disk size for the VM that runs the build. Note that this is *NOT* 2252 // "disk free"; some of the space will be used by the operating system and 2253 // build utilities. Also note that this is the minimum disk size that will be 2254 // allocated for the build -- the build may run with a larger disk than 2255 // requested. At present, the maximum disk size is 2000GB; builds that request 2256 // more than the maximum are rejected with an error. 2257 int64 disk_size_gb = 6; 2258 2259 // Option to specify behavior when there is an error in the substitution 2260 // checks. 2261 // 2262 // NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot 2263 // be overridden in the build configuration file. 2264 SubstitutionOption substitution_option = 4; 2265 2266 // Option to specify whether or not to apply bash style string 2267 // operations to the substitutions. 2268 // 2269 // NOTE: this is always enabled for triggered builds and cannot be 2270 // overridden in the build configuration file. 2271 bool dynamic_substitutions = 17; 2272 2273 // Option to include built-in and custom substitutions as env variables 2274 // for all build steps. 2275 bool automap_substitutions = 22; 2276 2277 // Option to define build log streaming behavior to Cloud 2278 // Storage. 2279 LogStreamingOption log_streaming_option = 5; 2280 2281 // This field deprecated; please use `pool.name` instead. 2282 string worker_pool = 7 [deprecated = true]; 2283 2284 // Optional. Specification for execution on a `WorkerPool`. 2285 // 2286 // See [running builds in a private 2287 // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) 2288 // for more information. 2289 PoolOption pool = 19 [(google.api.field_behavior) = OPTIONAL]; 2290 2291 // Option to specify the logging mode, which determines if and where build 2292 // logs are stored. 2293 LoggingMode logging = 11; 2294 2295 // A list of global environment variable definitions that will exist for all 2296 // build steps in this build. If a variable is defined in both globally and in 2297 // a build step, the variable will use the build step value. 2298 // 2299 // The elements are of the form "KEY=VALUE" for the environment variable "KEY" 2300 // being given the value "VALUE". 2301 repeated string env = 12; 2302 2303 // A list of global environment variables, which are encrypted using a Cloud 2304 // Key Management Service crypto key. These values must be specified in the 2305 // build's `Secret`. These variables will be available to all build steps 2306 // in this build. 2307 repeated string secret_env = 13; 2308 2309 // Global list of volumes to mount for ALL build steps 2310 // 2311 // Each volume is created as an empty volume prior to starting the build 2312 // process. Upon completion of the build, volumes and their contents are 2313 // discarded. Global volume names and paths cannot conflict with the volumes 2314 // defined a build step. 2315 // 2316 // Using a global volume in a build with only one step is not valid as 2317 // it is indicative of a build request with an incorrect configuration. 2318 repeated Volume volumes = 14; 2319 2320 // Optional. Option to specify how default logs buckets are setup. 2321 DefaultLogsBucketBehavior default_logs_bucket_behavior = 21 2322 [(google.api.field_behavior) = OPTIONAL]; 2323} 2324 2325// ReceiveTriggerWebhookRequest [Experimental] is the request object accepted by 2326// the ReceiveTriggerWebhook method. 2327message ReceiveTriggerWebhookRequest { 2328 // The name of the `ReceiveTriggerWebhook` to retrieve. 2329 // Format: `projects/{project}/locations/{location}/triggers/{trigger}` 2330 string name = 5; 2331 2332 // HTTP request body. 2333 google.api.HttpBody body = 1; 2334 2335 // Project in which the specified trigger lives 2336 string project_id = 2; 2337 2338 // Name of the trigger to run the payload against 2339 string trigger = 3; 2340 2341 // Secret token used for authorization if an OAuth token isn't provided. 2342 string secret = 4; 2343} 2344 2345// ReceiveTriggerWebhookResponse [Experimental] is the response object for the 2346// ReceiveTriggerWebhook method. 2347message ReceiveTriggerWebhookResponse {} 2348 2349message GitHubEnterpriseConfig { 2350 option (google.api.resource) = { 2351 type: "cloudbuild.googleapis.com/GithubEnterpriseConfig" 2352 pattern: "projects/{project}/githubEnterpriseConfigs/{config}" 2353 pattern: "projects/{project}/locations/{location}/githubEnterpriseConfigs/{config}" 2354 }; 2355 2356 // Optional. The full resource name for the GitHubEnterpriseConfig 2357 // For example: 2358 // "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}" 2359 string name = 7 [(google.api.field_behavior) = OPTIONAL]; 2360 2361 // The URL of the github enterprise host the configuration is for. 2362 string host_url = 3; 2363 2364 // Required. The GitHub app id of the Cloud Build app on the GitHub Enterprise 2365 // server. 2366 int64 app_id = 4 [(google.api.field_behavior) = REQUIRED]; 2367 2368 // Output only. Time when the installation was associated with the project. 2369 google.protobuf.Timestamp create_time = 6 2370 [(google.api.field_behavior) = OUTPUT_ONLY]; 2371 2372 // The key that should be attached to webhook calls to the ReceiveWebhook 2373 // endpoint. 2374 string webhook_key = 8; 2375 2376 // Optional. The network to be used when reaching out to the GitHub 2377 // Enterprise server. The VPC network must be enabled for private 2378 // service connection. This should be set if the GitHub Enterprise server is 2379 // hosted on-premises and not reachable by public internet. 2380 // If this field is left empty, no network peering will occur and calls to 2381 // the GitHub Enterprise server will be made over the public internet. 2382 // Must be in the format 2383 // `projects/{project}/global/networks/{network}`, where {project} 2384 // is a project number or id and {network} is the name of a 2385 // VPC network in the project. 2386 string peered_network = 9 [ 2387 (google.api.field_behavior) = OPTIONAL, 2388 (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } 2389 ]; 2390 2391 // Names of secrets in Secret Manager. 2392 GitHubEnterpriseSecrets secrets = 10; 2393 2394 // Name to display for this config. 2395 string display_name = 11; 2396 2397 // Optional. SSL certificate to use for requests to GitHub Enterprise. 2398 string ssl_ca = 12 [(google.api.field_behavior) = OPTIONAL]; 2399} 2400 2401// GitHubEnterpriseSecrets represents the names of all necessary secrets in 2402// Secret Manager for a GitHub Enterprise server. 2403// Format is: projects/<project number>/secrets/<secret name>. 2404message GitHubEnterpriseSecrets { 2405 // The resource name for the private key secret version. 2406 string private_key_version_name = 5 [(google.api.resource_reference) = { 2407 type: "secretmanager.googleapis.com/SecretVersion" 2408 }]; 2409 2410 // The resource name for the webhook secret secret version in Secret Manager. 2411 string webhook_secret_version_name = 6 [(google.api.resource_reference) = { 2412 type: "secretmanager.googleapis.com/SecretVersion" 2413 }]; 2414 2415 // The resource name for the OAuth secret secret version in Secret Manager. 2416 string oauth_secret_version_name = 7 [(google.api.resource_reference) = { 2417 type: "secretmanager.googleapis.com/SecretVersion" 2418 }]; 2419 2420 // The resource name for the OAuth client ID secret version in Secret Manager. 2421 string oauth_client_id_version_name = 8 [(google.api.resource_reference) = { 2422 type: "secretmanager.googleapis.com/SecretVersion" 2423 }]; 2424} 2425 2426// Configuration for a `WorkerPool`. 2427// 2428// Cloud Build owns and maintains a pool of workers for general use and have no 2429// access to a project's private network. By default, builds submitted to 2430// Cloud Build will use a worker from this pool. 2431// 2432// If your build needs access to resources on a private network, 2433// create and use a `WorkerPool` to run your builds. Private `WorkerPool`s give 2434// your builds access to any single VPC network that you 2435// administer, including any on-prem resources connected to that VPC 2436// network. For an overview of private pools, see 2437// [Private pools 2438// overview](https://cloud.google.com/build/docs/private-pools/private-pools-overview). 2439message WorkerPool { 2440 option (google.api.resource) = { 2441 type: "cloudbuild.googleapis.com/WorkerPool" 2442 pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" 2443 plural: "workerPools" 2444 singular: "workerPool" 2445 style: DECLARATIVE_FRIENDLY 2446 }; 2447 2448 // State of the `WorkerPool`. 2449 enum State { 2450 // State of the `WorkerPool` is unknown. 2451 STATE_UNSPECIFIED = 0; 2452 2453 // `WorkerPool` is being created. 2454 CREATING = 1; 2455 2456 // `WorkerPool` is running. 2457 RUNNING = 2; 2458 2459 // `WorkerPool` is being deleted: cancelling builds and draining workers. 2460 DELETING = 3; 2461 2462 // `WorkerPool` is deleted. 2463 DELETED = 4; 2464 2465 // `WorkerPool` is being updated; new builds cannot be run. 2466 UPDATING = 5; 2467 } 2468 2469 // Output only. The resource name of the `WorkerPool`, with format 2470 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 2471 // The value of `{worker_pool}` is provided by `worker_pool_id` in 2472 // `CreateWorkerPool` request and the value of `{location}` is determined by 2473 // the endpoint accessed. 2474 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 2475 2476 // A user-specified, human-readable name for the `WorkerPool`. If provided, 2477 // this value must be 1-63 characters. 2478 string display_name = 2; 2479 2480 // Output only. A unique identifier for the `WorkerPool`. 2481 string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 2482 2483 // User specified annotations. See https://google.aip.dev/128#annotations 2484 // for more details such as format and size limitations. 2485 map<string, string> annotations = 4; 2486 2487 // Output only. Time at which the request to create the `WorkerPool` was 2488 // received. 2489 google.protobuf.Timestamp create_time = 5 2490 [(google.api.field_behavior) = OUTPUT_ONLY]; 2491 2492 // Output only. Time at which the request to update the `WorkerPool` was 2493 // received. 2494 google.protobuf.Timestamp update_time = 6 2495 [(google.api.field_behavior) = OUTPUT_ONLY]; 2496 2497 // Output only. Time at which the request to delete the `WorkerPool` was 2498 // received. 2499 google.protobuf.Timestamp delete_time = 7 2500 [(google.api.field_behavior) = OUTPUT_ONLY]; 2501 2502 // Output only. `WorkerPool` state. 2503 State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; 2504 2505 // Configuration for the `WorkerPool`. 2506 oneof config { 2507 // Legacy Private Pool configuration. 2508 PrivatePoolV1Config private_pool_v1_config = 12; 2509 } 2510 2511 // Output only. Checksum computed by the server. May be sent on update and 2512 // delete requests to ensure that the client has an up-to-date value before 2513 // proceeding. 2514 string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; 2515} 2516 2517// Configuration for a V1 `PrivatePool`. 2518message PrivatePoolV1Config { 2519 // Defines the configuration to be used for creating workers in 2520 // the pool. 2521 message WorkerConfig { 2522 // Machine type of a worker, such as `e2-medium`. 2523 // See [Worker pool config 2524 // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). 2525 // If left blank, Cloud Build will use a sensible default. 2526 string machine_type = 1; 2527 2528 // Size of the disk attached to the worker, in GB. 2529 // See [Worker pool config 2530 // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). 2531 // Specify a value of up to 2000. If `0` is specified, Cloud Build will use 2532 // a standard disk size. 2533 int64 disk_size_gb = 2; 2534 } 2535 2536 // Defines the network configuration for the pool. 2537 message NetworkConfig { 2538 // Defines the egress option for the pool. 2539 enum EgressOption { 2540 // If set, defaults to PUBLIC_EGRESS. 2541 EGRESS_OPTION_UNSPECIFIED = 0; 2542 2543 // If set, workers are created without any public address, which prevents 2544 // network egress to public IPs unless a network proxy is configured. 2545 NO_PUBLIC_EGRESS = 1; 2546 2547 // If set, workers are created with a public address which allows for 2548 // public internet egress. 2549 PUBLIC_EGRESS = 2; 2550 } 2551 2552 // Required. Immutable. The network definition that the workers are peered 2553 // to. If this section is left empty, the workers will be peered to 2554 // `WorkerPool.project_id` on the service producer network. Must be in the 2555 // format `projects/{project}/global/networks/{network}`, where `{project}` 2556 // is a project number, such as `12345`, and `{network}` is the name of a 2557 // VPC network in the project. See 2558 // [Understanding network configuration 2559 // options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) 2560 string peered_network = 1 [ 2561 (google.api.field_behavior) = IMMUTABLE, 2562 (google.api.field_behavior) = REQUIRED, 2563 (google.api.resource_reference) = { 2564 type: "compute.googleapis.com/Network" 2565 } 2566 ]; 2567 2568 // Option to configure network egress for the workers. 2569 EgressOption egress_option = 2; 2570 2571 // Immutable. Subnet IP range within the peered network. This is specified 2572 // in CIDR notation with a slash and the subnet prefix size. You can 2573 // optionally specify an IP address before the subnet prefix value. e.g. 2574 // `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a 2575 // prefix size of 29 bits. 2576 // `/16` would specify a prefix size of 16 bits, with an automatically 2577 // determined IP within the peered VPC. 2578 // If unspecified, a value of `/24` will be used. 2579 string peered_network_ip_range = 3 2580 [(google.api.field_behavior) = IMMUTABLE]; 2581 } 2582 2583 // Machine configuration for the workers in the pool. 2584 WorkerConfig worker_config = 1; 2585 2586 // Network configuration for the pool. 2587 NetworkConfig network_config = 2; 2588} 2589 2590// Request to create a new `WorkerPool`. 2591message CreateWorkerPoolRequest { 2592 // Required. The parent resource where this worker pool will be created. 2593 // Format: `projects/{project}/locations/{location}`. 2594 string parent = 1 [ 2595 (google.api.field_behavior) = REQUIRED, 2596 (google.api.resource_reference) = { 2597 type: "locations.googleapis.com/Location" 2598 } 2599 ]; 2600 2601 // Required. `WorkerPool` resource to create. 2602 WorkerPool worker_pool = 2 [(google.api.field_behavior) = REQUIRED]; 2603 2604 // Required. Immutable. The ID to use for the `WorkerPool`, which will become 2605 // the final component of the resource name. 2606 // 2607 // This value should be 1-63 characters, and valid characters 2608 // are /[a-z][0-9]-/. 2609 string worker_pool_id = 3 [ 2610 (google.api.field_behavior) = IMMUTABLE, 2611 (google.api.field_behavior) = REQUIRED 2612 ]; 2613 2614 // If set, validate the request and preview the response, but do not actually 2615 // post it. 2616 bool validate_only = 4; 2617} 2618 2619// Request to get a `WorkerPool` with the specified name. 2620message GetWorkerPoolRequest { 2621 // Required. The name of the `WorkerPool` to retrieve. 2622 // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. 2623 string name = 1 [ 2624 (google.api.field_behavior) = REQUIRED, 2625 (google.api.resource_reference) = { 2626 type: "cloudbuild.googleapis.com/WorkerPool" 2627 } 2628 ]; 2629} 2630 2631// Request to delete a `WorkerPool`. 2632message DeleteWorkerPoolRequest { 2633 // Required. The name of the `WorkerPool` to delete. 2634 // Format: 2635 // `projects/{project}/locations/{location}/workerPools/{workerPool}`. 2636 string name = 1 [ 2637 (google.api.field_behavior) = REQUIRED, 2638 (google.api.resource_reference) = { 2639 type: "cloudbuild.googleapis.com/WorkerPool" 2640 } 2641 ]; 2642 2643 // Optional. If provided, it must match the server's etag on the workerpool 2644 // for the request to be processed. 2645 string etag = 2 [(google.api.field_behavior) = OPTIONAL]; 2646 2647 // If set to true, and the `WorkerPool` is not found, the request will succeed 2648 // but no action will be taken on the server. 2649 bool allow_missing = 3; 2650 2651 // If set, validate the request and preview the response, but do not actually 2652 // post it. 2653 bool validate_only = 4; 2654} 2655 2656// Request to update a `WorkerPool`. 2657message UpdateWorkerPoolRequest { 2658 // Required. The `WorkerPool` to update. 2659 // 2660 // The `name` field is used to identify the `WorkerPool` to update. 2661 // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. 2662 WorkerPool worker_pool = 1 [(google.api.field_behavior) = REQUIRED]; 2663 2664 // A mask specifying which fields in `worker_pool` to update. 2665 google.protobuf.FieldMask update_mask = 2; 2666 2667 // If set, validate the request and preview the response, but do not actually 2668 // post it. 2669 bool validate_only = 4; 2670} 2671 2672// Request to list `WorkerPool`s. 2673message ListWorkerPoolsRequest { 2674 // Required. The parent of the collection of `WorkerPools`. 2675 // Format: `projects/{project}/locations/{location}`. 2676 string parent = 1 [ 2677 (google.api.field_behavior) = REQUIRED, 2678 (google.api.resource_reference) = { 2679 type: "locations.googleapis.com/Location" 2680 } 2681 ]; 2682 2683 // The maximum number of `WorkerPool`s to return. The service may return 2684 // fewer than this value. If omitted, the server will use a sensible default. 2685 int32 page_size = 2; 2686 2687 // A page token, received from a previous `ListWorkerPools` call. Provide this 2688 // to retrieve the subsequent page. 2689 string page_token = 3; 2690} 2691 2692// Response containing existing `WorkerPools`. 2693message ListWorkerPoolsResponse { 2694 // `WorkerPools` for the specified project. 2695 repeated WorkerPool worker_pools = 1; 2696 2697 // Continuation token used to page through large result sets. Provide this 2698 // value in a subsequent ListWorkerPoolsRequest to return the next page of 2699 // results. 2700 string next_page_token = 2; 2701} 2702 2703// Metadata for the `CreateWorkerPool` operation. 2704message CreateWorkerPoolOperationMetadata { 2705 // The resource name of the `WorkerPool` to create. 2706 // Format: 2707 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 2708 string worker_pool = 1 [(google.api.resource_reference) = { 2709 type: "cloudbuild.googleapis.com/WorkerPool" 2710 }]; 2711 2712 // Time the operation was created. 2713 google.protobuf.Timestamp create_time = 2; 2714 2715 // Time the operation was completed. 2716 google.protobuf.Timestamp complete_time = 3; 2717} 2718 2719// Metadata for the `UpdateWorkerPool` operation. 2720message UpdateWorkerPoolOperationMetadata { 2721 // The resource name of the `WorkerPool` being updated. 2722 // Format: 2723 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 2724 string worker_pool = 1 [(google.api.resource_reference) = { 2725 type: "cloudbuild.googleapis.com/WorkerPool" 2726 }]; 2727 2728 // Time the operation was created. 2729 google.protobuf.Timestamp create_time = 2; 2730 2731 // Time the operation was completed. 2732 google.protobuf.Timestamp complete_time = 3; 2733} 2734 2735// Metadata for the `DeleteWorkerPool` operation. 2736message DeleteWorkerPoolOperationMetadata { 2737 // The resource name of the `WorkerPool` being deleted. 2738 // Format: 2739 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 2740 string worker_pool = 1 [(google.api.resource_reference) = { 2741 type: "cloudbuild.googleapis.com/WorkerPool" 2742 }]; 2743 2744 // Time the operation was created. 2745 google.protobuf.Timestamp create_time = 2; 2746 2747 // Time the operation was completed. 2748 google.protobuf.Timestamp complete_time = 3; 2749} 2750