cloudbuild.proto 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012
  1. // Copyright 2021 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. syntax = "proto3";
  15. package google.devtools.cloudbuild.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/httpbody.proto";
  20. import "google/api/resource.proto";
  21. import "google/longrunning/operations.proto";
  22. import "google/protobuf/duration.proto";
  23. import "google/protobuf/empty.proto";
  24. import "google/protobuf/field_mask.proto";
  25. import "google/protobuf/timestamp.proto";
  26. option csharp_namespace = "Google.Cloud.CloudBuild.V1";
  27. option go_package = "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild";
  28. option java_multiple_files = true;
  29. option java_package = "com.google.cloudbuild.v1";
  30. option objc_class_prefix = "GCB";
  31. option ruby_package = "Google::Cloud::Build::V1";
  32. option (google.api.resource_definition) = {
  33. type: "compute.googleapis.com/Network"
  34. pattern: "projects/{project}/global/networks/{network}"
  35. };
  36. option (google.api.resource_definition) = {
  37. type: "iam.googleapis.com/ServiceAccount"
  38. pattern: "projects/{project}/serviceAccounts/{service_account}"
  39. };
  40. option (google.api.resource_definition) = {
  41. type: "secretmanager.googleapis.com/Secret"
  42. pattern: "projects/{project}/secrets/{secret}"
  43. };
  44. option (google.api.resource_definition) = {
  45. type: "secretmanager.googleapis.com/SecretVersion"
  46. pattern: "projects/{project}/secrets/{secret}/versions/{version}"
  47. };
  48. option (google.api.resource_definition) = {
  49. type: "cloudkms.googleapis.com/CryptoKey"
  50. pattern: "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}"
  51. };
  52. option (google.api.resource_definition) = {
  53. type: "pubsub.googleapis.com/Subscription"
  54. pattern: "projects/{project}/subscriptions/{subscription}"
  55. };
  56. option (google.api.resource_definition) = {
  57. type: "pubsub.googleapis.com/Topic"
  58. pattern: "projects/{project}/topics/{topic}"
  59. };
  60. // Creates and manages builds on Google Cloud Platform.
  61. //
  62. // The main concept used by this API is a `Build`, which describes the location
  63. // of the source to build, how to build the source, and where to store the
  64. // built artifacts, if any.
  65. //
  66. // A user can list previously-requested builds or get builds by their ID to
  67. // determine the status of the build.
  68. service CloudBuild {
  69. option (google.api.default_host) = "cloudbuild.googleapis.com";
  70. option (google.api.oauth_scopes) =
  71. "https://www.googleapis.com/auth/cloud-platform";
  72. // Starts a build with the specified configuration.
  73. //
  74. // This method returns a long-running `Operation`, which includes the build
  75. // ID. Pass the build ID to `GetBuild` to determine the build status (such as
  76. // `SUCCESS` or `FAILURE`).
  77. rpc CreateBuild(CreateBuildRequest) returns (google.longrunning.Operation) {
  78. option (google.api.http) = {
  79. post: "/v1/projects/{project_id}/builds"
  80. body: "build"
  81. additional_bindings {
  82. post: "/v1/{parent=projects/*/locations/*}/builds"
  83. body: "build"
  84. }
  85. };
  86. option (google.api.method_signature) = "project_id,build";
  87. option (google.longrunning.operation_info) = {
  88. response_type: "Build"
  89. metadata_type: "BuildOperationMetadata"
  90. };
  91. }
  92. // Returns information about a previously requested build.
  93. //
  94. // The `Build` that is returned includes its status (such as `SUCCESS`,
  95. // `FAILURE`, or `WORKING`), and timing information.
  96. rpc GetBuild(GetBuildRequest) returns (Build) {
  97. option (google.api.http) = {
  98. get: "/v1/projects/{project_id}/builds/{id}"
  99. additional_bindings { get: "/v1/{name=projects/*/locations/*/builds/*}" }
  100. };
  101. option (google.api.method_signature) = "project_id,id";
  102. }
  103. // Lists previously requested builds.
  104. //
  105. // Previously requested builds may still be in-progress, or may have finished
  106. // successfully or unsuccessfully.
  107. rpc ListBuilds(ListBuildsRequest) returns (ListBuildsResponse) {
  108. option (google.api.http) = {
  109. get: "/v1/projects/{project_id}/builds"
  110. additional_bindings { get: "/v1/{parent=projects/*/locations/*}/builds" }
  111. };
  112. option (google.api.method_signature) = "project_id,filter";
  113. }
  114. // Cancels a build in progress.
  115. rpc CancelBuild(CancelBuildRequest) returns (Build) {
  116. option (google.api.http) = {
  117. post: "/v1/projects/{project_id}/builds/{id}:cancel"
  118. body: "*"
  119. additional_bindings {
  120. post: "/v1/{name=projects/*/locations/*/builds/*}:cancel"
  121. body: "*"
  122. }
  123. };
  124. option (google.api.method_signature) = "project_id,id";
  125. }
  126. // Creates a new build based on the specified build.
  127. //
  128. // This method creates a new build using the original build request, which may
  129. // or may not result in an identical build.
  130. //
  131. // For triggered builds:
  132. //
  133. // * Triggered builds resolve to a precise revision; therefore a retry of a
  134. // triggered build will result in a build that uses the same revision.
  135. //
  136. // For non-triggered builds that specify `RepoSource`:
  137. //
  138. // * If the original build built from the tip of a branch, the retried build
  139. // will build from the tip of that branch, which may not be the same revision
  140. // as the original build.
  141. // * If the original build specified a commit sha or revision ID, the retried
  142. // build will use the identical source.
  143. //
  144. // For builds that specify `StorageSource`:
  145. //
  146. // * If the original build pulled source from Google Cloud Storage without
  147. // specifying the generation of the object, the new build will use the current
  148. // object, which may be different from the original build source.
  149. // * If the original build pulled source from Cloud Storage and specified the
  150. // generation of the object, the new build will attempt to use the same
  151. // object, which may or may not be available depending on the bucket's
  152. // lifecycle management settings.
  153. rpc RetryBuild(RetryBuildRequest) returns (google.longrunning.Operation) {
  154. option (google.api.http) = {
  155. post: "/v1/projects/{project_id}/builds/{id}:retry"
  156. body: "*"
  157. additional_bindings {
  158. post: "/v1/{name=projects/*/locations/*/builds/*}:retry"
  159. body: "*"
  160. }
  161. };
  162. option (google.api.method_signature) = "project_id,id";
  163. option (google.longrunning.operation_info) = {
  164. response_type: "Build"
  165. metadata_type: "BuildOperationMetadata"
  166. };
  167. }
  168. // Creates a new `BuildTrigger`.
  169. //
  170. // This API is experimental.
  171. rpc CreateBuildTrigger(CreateBuildTriggerRequest) returns (BuildTrigger) {
  172. option (google.api.http) = {
  173. post: "/v1/projects/{project_id}/triggers"
  174. body: "trigger"
  175. additional_bindings {
  176. post: "/v1/{parent=projects/*/locations/*}/triggers"
  177. body: "trigger"
  178. }
  179. };
  180. option (google.api.method_signature) = "project_id,trigger";
  181. }
  182. // Returns information about a `BuildTrigger`.
  183. //
  184. // This API is experimental.
  185. rpc GetBuildTrigger(GetBuildTriggerRequest) returns (BuildTrigger) {
  186. option (google.api.http) = {
  187. get: "/v1/projects/{project_id}/triggers/{trigger_id}"
  188. additional_bindings {
  189. get: "/v1/{name=projects/*/locations/*/triggers/*}"
  190. }
  191. };
  192. option (google.api.method_signature) = "project_id,trigger_id";
  193. }
  194. // Lists existing `BuildTrigger`s.
  195. //
  196. // This API is experimental.
  197. rpc ListBuildTriggers(ListBuildTriggersRequest)
  198. returns (ListBuildTriggersResponse) {
  199. option (google.api.http) = {
  200. get: "/v1/projects/{project_id}/triggers"
  201. additional_bindings {
  202. get: "/v1/{parent=projects/*/locations/*}/triggers"
  203. }
  204. };
  205. option (google.api.method_signature) = "project_id";
  206. }
  207. // Deletes a `BuildTrigger` by its project ID and trigger ID.
  208. //
  209. // This API is experimental.
  210. rpc DeleteBuildTrigger(DeleteBuildTriggerRequest)
  211. returns (google.protobuf.Empty) {
  212. option (google.api.http) = {
  213. delete: "/v1/projects/{project_id}/triggers/{trigger_id}"
  214. additional_bindings {
  215. delete: "/v1/{name=projects/*/locations/*/triggers/*}"
  216. }
  217. };
  218. option (google.api.method_signature) = "project_id,trigger_id";
  219. }
  220. // Updates a `BuildTrigger` by its project ID and trigger ID.
  221. //
  222. // This API is experimental.
  223. rpc UpdateBuildTrigger(UpdateBuildTriggerRequest) returns (BuildTrigger) {
  224. option (google.api.http) = {
  225. patch: "/v1/projects/{project_id}/triggers/{trigger_id}"
  226. body: "trigger"
  227. additional_bindings {
  228. patch: "/v1/{trigger.resource_name=projects/*/locations/*/triggers/*}"
  229. body: "trigger"
  230. }
  231. };
  232. option (google.api.method_signature) = "project_id,trigger_id,trigger";
  233. }
  234. // Runs a `BuildTrigger` at a particular source revision.
  235. rpc RunBuildTrigger(RunBuildTriggerRequest)
  236. returns (google.longrunning.Operation) {
  237. option (google.api.http) = {
  238. post: "/v1/projects/{project_id}/triggers/{trigger_id}:run"
  239. body: "source"
  240. additional_bindings {
  241. post: "/v1/{name=projects/*/locations/*/triggers/*}:run"
  242. body: "*"
  243. }
  244. };
  245. option (google.api.method_signature) = "project_id,trigger_id,source";
  246. option (google.longrunning.operation_info) = {
  247. response_type: "Build"
  248. metadata_type: "BuildOperationMetadata"
  249. };
  250. }
  251. // ReceiveTriggerWebhook [Experimental] is called when the API receives a
  252. // webhook request targeted at a specific trigger.
  253. rpc ReceiveTriggerWebhook(ReceiveTriggerWebhookRequest)
  254. returns (ReceiveTriggerWebhookResponse) {
  255. option (google.api.http) = {
  256. post: "/v1/projects/{project_id}/triggers/{trigger}:webhook"
  257. body: "body"
  258. additional_bindings {
  259. post: "/v1/{name=projects/*/locations/*/triggers/*}:webhook"
  260. body: "body"
  261. }
  262. };
  263. }
  264. // Creates a `WorkerPool`.
  265. rpc CreateWorkerPool(CreateWorkerPoolRequest)
  266. returns (google.longrunning.Operation) {
  267. option (google.api.http) = {
  268. post: "/v1/{parent=projects/*/locations/*}/workerPools"
  269. body: "worker_pool"
  270. };
  271. option (google.api.method_signature) = "parent,worker_pool,worker_pool_id";
  272. option (google.longrunning.operation_info) = {
  273. response_type: "WorkerPool"
  274. metadata_type: "CreateWorkerPoolOperationMetadata"
  275. };
  276. }
  277. // Returns details of a `WorkerPool`.
  278. rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) {
  279. option (google.api.http) = {
  280. get: "/v1/{name=projects/*/locations/*/workerPools/*}"
  281. };
  282. option (google.api.method_signature) = "name";
  283. }
  284. // Deletes a `WorkerPool`.
  285. rpc DeleteWorkerPool(DeleteWorkerPoolRequest)
  286. returns (google.longrunning.Operation) {
  287. option (google.api.http) = {
  288. delete: "/v1/{name=projects/*/locations/*/workerPools/*}"
  289. };
  290. option (google.api.method_signature) = "name";
  291. option (google.longrunning.operation_info) = {
  292. response_type: "google.protobuf.Empty"
  293. metadata_type: "DeleteWorkerPoolOperationMetadata"
  294. };
  295. }
  296. // Updates a `WorkerPool`.
  297. rpc UpdateWorkerPool(UpdateWorkerPoolRequest)
  298. returns (google.longrunning.Operation) {
  299. option (google.api.http) = {
  300. patch: "/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}"
  301. body: "worker_pool"
  302. };
  303. option (google.api.method_signature) = "worker_pool,update_mask";
  304. option (google.longrunning.operation_info) = {
  305. response_type: "WorkerPool"
  306. metadata_type: "UpdateWorkerPoolOperationMetadata"
  307. };
  308. }
  309. // Lists `WorkerPool`s.
  310. rpc ListWorkerPools(ListWorkerPoolsRequest)
  311. returns (ListWorkerPoolsResponse) {
  312. option (google.api.http) = {
  313. get: "/v1/{parent=projects/*/locations/*}/workerPools"
  314. };
  315. option (google.api.method_signature) = "parent";
  316. }
  317. }
  318. // Specifies a build to retry.
  319. message RetryBuildRequest {
  320. // The name of the `Build` to retry.
  321. // Format: `projects/{project}/locations/{location}/builds/{build}`
  322. string name = 3 [(google.api.resource_reference) = {
  323. type: "cloudbuild.googleapis.com/Build"
  324. }];
  325. // Required. ID of the project.
  326. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  327. // Required. Build ID of the original build.
  328. string id = 2 [(google.api.field_behavior) = REQUIRED];
  329. }
  330. // Specifies a build trigger to run and the source to use.
  331. message RunBuildTriggerRequest {
  332. // The name of the `Trigger` to run.
  333. // Format: `projects/{project}/locations/{location}/triggers/{trigger}`
  334. string name = 4 [(google.api.resource_reference) = {
  335. type: "cloudbuild.googleapis.com/BuildTrigger"
  336. }];
  337. // Required. ID of the project.
  338. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  339. // Required. ID of the trigger.
  340. string trigger_id = 2 [(google.api.field_behavior) = REQUIRED];
  341. // Source to build against this trigger.
  342. RepoSource source = 3;
  343. }
  344. // Location of the source in an archive file in Google Cloud Storage.
  345. message StorageSource {
  346. // Google Cloud Storage bucket containing the source (see
  347. // [Bucket Name
  348. // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
  349. string bucket = 1;
  350. // Google Cloud Storage object containing the source.
  351. //
  352. // This object must be a gzipped archive file (`.tar.gz`) containing source to
  353. // build.
  354. string object = 2;
  355. // Google Cloud Storage generation for the object. If the generation is
  356. // omitted, the latest generation will be used.
  357. int64 generation = 3;
  358. }
  359. // Location of the source in a Google Cloud Source Repository.
  360. message RepoSource {
  361. // ID of the project that owns the Cloud Source Repository. If omitted, the
  362. // project ID requesting the build is assumed.
  363. string project_id = 1;
  364. // Name of the Cloud Source Repository.
  365. string repo_name = 2;
  366. // A revision within the Cloud Source Repository must be specified in
  367. // one of these ways.
  368. oneof revision {
  369. // Regex matching branches to build.
  370. //
  371. // The syntax of the regular expressions accepted is the syntax accepted by
  372. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  373. string branch_name = 3;
  374. // Regex matching tags to build.
  375. //
  376. // The syntax of the regular expressions accepted is the syntax accepted by
  377. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  378. string tag_name = 4;
  379. // Explicit commit SHA to build.
  380. string commit_sha = 5;
  381. }
  382. // Directory, relative to the source root, in which to run the build.
  383. //
  384. // This must be a relative path. If a step's `dir` is specified and is an
  385. // absolute path, this value is ignored for that step's execution.
  386. string dir = 7;
  387. // Only trigger a build if the revision regex does NOT match the revision
  388. // regex.
  389. bool invert_regex = 8;
  390. // Substitutions to use in a triggered build.
  391. // Should only be used with RunBuildTrigger
  392. map<string, string> substitutions = 9;
  393. }
  394. // Location of the source manifest in Google Cloud Storage.
  395. // This feature is in Preview; see description
  396. // [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher).
  397. message StorageSourceManifest {
  398. // Google Cloud Storage bucket containing the source manifest (see [Bucket
  399. // Name
  400. // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
  401. string bucket = 1;
  402. // Google Cloud Storage object containing the source manifest.
  403. //
  404. // This object must be a JSON file.
  405. string object = 2;
  406. // Google Cloud Storage generation for the object. If the generation is
  407. // omitted, the latest generation will be used.
  408. int64 generation = 3;
  409. }
  410. // Location of the source in a supported storage service.
  411. message Source {
  412. // Location of source.
  413. oneof source {
  414. // If provided, get the source from this location in Google Cloud Storage.
  415. StorageSource storage_source = 2;
  416. // If provided, get the source from this location in a Cloud Source
  417. // Repository.
  418. RepoSource repo_source = 3;
  419. // If provided, get the source from this manifest in Google Cloud Storage.
  420. // This feature is in Preview; see description
  421. // [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher).
  422. StorageSourceManifest storage_source_manifest = 8;
  423. }
  424. }
  425. // An image built by the pipeline.
  426. message BuiltImage {
  427. // Name used to push the container image to Google Container Registry, as
  428. // presented to `docker push`.
  429. string name = 1;
  430. // Docker Registry 2.0 digest.
  431. string digest = 3;
  432. // Output only. Stores timing information for pushing the specified image.
  433. TimeSpan push_timing = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  434. }
  435. // A step in the build pipeline.
  436. message BuildStep {
  437. // Required. The name of the container image that will run this particular
  438. // build step.
  439. //
  440. // If the image is available in the host's Docker daemon's cache, it
  441. // will be run directly. If not, the host will attempt to pull the image
  442. // first, using the builder service account's credentials if necessary.
  443. //
  444. // The Docker daemon's cache will already have the latest versions of all of
  445. // the officially supported build steps
  446. // ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)).
  447. // The Docker daemon will also have cached many of the layers for some popular
  448. // images, like "ubuntu", "debian", but they will be refreshed at the time you
  449. // attempt to use them.
  450. //
  451. // If you built an image in a previous build step, it will be stored in the
  452. // host's Docker daemon's cache and is available to use as the name for a
  453. // later build step.
  454. string name = 1;
  455. // A list of environment variable definitions to be used when running a step.
  456. //
  457. // The elements are of the form "KEY=VALUE" for the environment variable "KEY"
  458. // being given the value "VALUE".
  459. repeated string env = 2;
  460. // A list of arguments that will be presented to the step when it is started.
  461. //
  462. // If the image used to run the step's container has an entrypoint, the `args`
  463. // are used as arguments to that entrypoint. If the image does not define
  464. // an entrypoint, the first element in args is used as the entrypoint,
  465. // and the remainder will be used as arguments.
  466. repeated string args = 3;
  467. // Working directory to use when running this step's container.
  468. //
  469. // If this value is a relative path, it is relative to the build's working
  470. // directory. If this value is absolute, it may be outside the build's working
  471. // directory, in which case the contents of the path may not be persisted
  472. // across build step executions, unless a `volume` for that path is specified.
  473. //
  474. // If the build specifies a `RepoSource` with `dir` and a step with a `dir`,
  475. // which specifies an absolute path, the `RepoSource` `dir` is ignored for
  476. // the step's execution.
  477. string dir = 4;
  478. // Unique identifier for this build step, used in `wait_for` to
  479. // reference this build step as a dependency.
  480. string id = 5;
  481. // The ID(s) of the step(s) that this build step depends on.
  482. // This build step will not start until all the build steps in `wait_for`
  483. // have completed successfully. If `wait_for` is empty, this build step will
  484. // start when all previous build steps in the `Build.Steps` list have
  485. // completed successfully.
  486. repeated string wait_for = 6;
  487. // Entrypoint to be used instead of the build step image's default entrypoint.
  488. // If unset, the image's default entrypoint is used.
  489. string entrypoint = 7;
  490. // A list of environment variables which are encrypted using a Cloud Key
  491. // Management Service crypto key. These values must be specified in the
  492. // build's `Secret`.
  493. repeated string secret_env = 8;
  494. // List of volumes to mount into the build step.
  495. //
  496. // Each volume is created as an empty volume prior to execution of the
  497. // build step. Upon completion of the build, volumes and their contents are
  498. // discarded.
  499. //
  500. // Using a named volume in only one step is not valid as it is indicative
  501. // of a build request with an incorrect configuration.
  502. repeated Volume volumes = 9;
  503. // Output only. Stores timing information for executing this build step.
  504. TimeSpan timing = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  505. // Output only. Stores timing information for pulling this build step's
  506. // builder image only.
  507. TimeSpan pull_timing = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  508. // Time limit for executing this build step. If not defined, the step has no
  509. // time limit and will be allowed to continue to run until either it completes
  510. // or the build itself times out.
  511. google.protobuf.Duration timeout = 11;
  512. // Output only. Status of the build step. At this time, build step status is
  513. // only updated on build completion; step status is not updated in real-time
  514. // as the build progresses.
  515. Build.Status status = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  516. }
  517. // Volume describes a Docker container volume which is mounted into build steps
  518. // in order to persist files across build step execution.
  519. message Volume {
  520. // Name of the volume to mount.
  521. //
  522. // Volume names must be unique per build step and must be valid names for
  523. // Docker volumes. Each named volume must be used by at least two build steps.
  524. string name = 1;
  525. // Path at which to mount the volume.
  526. //
  527. // Paths must be absolute and cannot conflict with other volume paths on the
  528. // same build step or with certain reserved volume paths.
  529. string path = 2;
  530. }
  531. // Artifacts created by the build pipeline.
  532. message Results {
  533. // Container images that were built as a part of the build.
  534. repeated BuiltImage images = 2;
  535. // List of build step digests, in the order corresponding to build step
  536. // indices.
  537. repeated string build_step_images = 3;
  538. // Path to the artifact manifest. Only populated when artifacts are uploaded.
  539. string artifact_manifest = 4;
  540. // Number of artifacts uploaded. Only populated when artifacts are uploaded.
  541. int64 num_artifacts = 5;
  542. // List of build step outputs, produced by builder images, in the order
  543. // corresponding to build step indices.
  544. //
  545. // [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders)
  546. // can produce this output by writing to `$BUILDER_OUTPUT/output`.
  547. // Only the first 4KB of data is stored.
  548. repeated bytes build_step_outputs = 6;
  549. // Time to push all non-container artifacts.
  550. TimeSpan artifact_timing = 7;
  551. }
  552. // An artifact that was uploaded during a build. This
  553. // is a single record in the artifact manifest JSON file.
  554. message ArtifactResult {
  555. // The path of an artifact in a Google Cloud Storage bucket, with the
  556. // generation number. For example,
  557. // `gs://mybucket/path/to/output.jar#generation`.
  558. string location = 1;
  559. // The file hash of the artifact.
  560. repeated FileHashes file_hash = 2;
  561. }
  562. // A build resource in the Cloud Build API.
  563. //
  564. // At a high level, a `Build` describes where to find source code, how to build
  565. // it (for example, the builder image to run on the source), and where to store
  566. // the built artifacts.
  567. //
  568. // Fields can include the following variables, which will be expanded when the
  569. // build is created:
  570. //
  571. // - $PROJECT_ID: the project ID of the build.
  572. // - $PROJECT_NUMBER: the project number of the build.
  573. // - $BUILD_ID: the autogenerated ID of the build.
  574. // - $REPO_NAME: the source repository name specified by RepoSource.
  575. // - $BRANCH_NAME: the branch name specified by RepoSource.
  576. // - $TAG_NAME: the tag name specified by RepoSource.
  577. // - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or
  578. // resolved from the specified branch or tag.
  579. // - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA.
  580. message Build {
  581. option (google.api.resource) = {
  582. type: "cloudbuild.googleapis.com/Build"
  583. pattern: "projects/{project}/builds/{build}"
  584. pattern: "projects/{project}/locations/{location}/builds/{build}"
  585. };
  586. // A non-fatal problem encountered during the execution of the build.
  587. message Warning {
  588. // The relative importance of this warning.
  589. enum Priority {
  590. // Should not be used.
  591. PRIORITY_UNSPECIFIED = 0;
  592. // e.g. deprecation warnings and alternative feature highlights.
  593. INFO = 1;
  594. // e.g. automated detection of possible issues with the build.
  595. WARNING = 2;
  596. // e.g. alerts that a feature used in the build is pending removal
  597. ALERT = 3;
  598. }
  599. // Explanation of the warning generated.
  600. string text = 1;
  601. // The priority for this warning.
  602. Priority priority = 2;
  603. }
  604. // A fatal problem encountered during the execution of the build.
  605. message FailureInfo {
  606. // The name of a fatal problem encountered during the execution of the
  607. // build.
  608. enum FailureType {
  609. // Type unspecified
  610. FAILURE_TYPE_UNSPECIFIED = 0;
  611. // Unable to push the image to the repository.
  612. PUSH_FAILED = 1;
  613. // Final image not found.
  614. PUSH_IMAGE_NOT_FOUND = 2;
  615. // Unauthorized push of the final image.
  616. PUSH_NOT_AUTHORIZED = 3;
  617. // Backend logging failures. Should retry.
  618. LOGGING_FAILURE = 4;
  619. // A build step has failed.
  620. USER_BUILD_STEP = 5;
  621. // The source fetching has failed.
  622. FETCH_SOURCE_FAILED = 6;
  623. }
  624. // The name of the failure.
  625. FailureType type = 1;
  626. // Explains the failure issue in more detail using hard-coded text.
  627. string detail = 2;
  628. }
  629. // Possible status of a build or build step.
  630. enum Status {
  631. // Status of the build is unknown.
  632. STATUS_UNKNOWN = 0;
  633. // Build or step is queued; work has not yet begun.
  634. QUEUED = 1;
  635. // Build or step is being executed.
  636. WORKING = 2;
  637. // Build or step finished successfully.
  638. SUCCESS = 3;
  639. // Build or step failed to complete successfully.
  640. FAILURE = 4;
  641. // Build or step failed due to an internal cause.
  642. INTERNAL_ERROR = 5;
  643. // Build or step took longer than was allowed.
  644. TIMEOUT = 6;
  645. // Build or step was canceled by a user.
  646. CANCELLED = 7;
  647. // Build was enqueued for longer than the value of `queue_ttl`.
  648. EXPIRED = 9;
  649. }
  650. // Output only. The 'Build' name with format:
  651. // `projects/{project}/locations/{location}/builds/{build}`, where {build}
  652. // is a unique identifier generated by the service.
  653. string name = 45 [(google.api.field_behavior) = OUTPUT_ONLY];
  654. // Output only. Unique identifier of the build.
  655. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  656. // Output only. ID of the project.
  657. string project_id = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  658. // Output only. Status of the build.
  659. Status status = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  660. // Output only. Customer-readable message about the current status.
  661. string status_detail = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
  662. // The location of the source files to build.
  663. Source source = 3;
  664. // Required. The operations to be performed on the workspace.
  665. repeated BuildStep steps = 11;
  666. // Output only. Results of the build.
  667. Results results = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  668. // Output only. Time at which the request to create the build was received.
  669. google.protobuf.Timestamp create_time = 6
  670. [(google.api.field_behavior) = OUTPUT_ONLY];
  671. // Output only. Time at which execution of the build was started.
  672. google.protobuf.Timestamp start_time = 7
  673. [(google.api.field_behavior) = OUTPUT_ONLY];
  674. // Output only. Time at which execution of the build was finished.
  675. //
  676. // The difference between finish_time and start_time is the duration of the
  677. // build's execution.
  678. google.protobuf.Timestamp finish_time = 8
  679. [(google.api.field_behavior) = OUTPUT_ONLY];
  680. // Amount of time that this build should be allowed to run, to second
  681. // granularity. If this amount of time elapses, work on the build will cease
  682. // and the build status will be `TIMEOUT`.
  683. //
  684. // `timeout` starts ticking from `startTime`.
  685. //
  686. // Default time is ten minutes.
  687. google.protobuf.Duration timeout = 12;
  688. // A list of images to be pushed upon the successful completion of all build
  689. // steps.
  690. //
  691. // The images are pushed using the builder service account's credentials.
  692. //
  693. // The digests of the pushed images will be stored in the `Build` resource's
  694. // results field.
  695. //
  696. // If any of the images fail to be pushed, the build status is marked
  697. // `FAILURE`.
  698. repeated string images = 13;
  699. // TTL in queue for this build. If provided and the build is enqueued longer
  700. // than this value, the build will expire and the build status will be
  701. // `EXPIRED`.
  702. //
  703. // The TTL starts ticking from create_time.
  704. google.protobuf.Duration queue_ttl = 40;
  705. // Artifacts produced by the build that should be uploaded upon
  706. // successful completion of all build steps.
  707. Artifacts artifacts = 37;
  708. // Google Cloud Storage bucket where logs should be written (see
  709. // [Bucket Name
  710. // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
  711. // Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`.
  712. string logs_bucket = 19;
  713. // Output only. A permanent fixed identifier for source.
  714. SourceProvenance source_provenance = 21
  715. [(google.api.field_behavior) = OUTPUT_ONLY];
  716. // Output only. The ID of the `BuildTrigger` that triggered this build, if it
  717. // was triggered automatically.
  718. string build_trigger_id = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
  719. // Special options for this build.
  720. BuildOptions options = 23;
  721. // Output only. URL to logs for this build in Google Cloud Console.
  722. string log_url = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
  723. // Substitutions data for `Build` resource.
  724. map<string, string> substitutions = 29;
  725. // Tags for annotation of a `Build`. These are not docker tags.
  726. repeated string tags = 31;
  727. // Secrets to decrypt using Cloud Key Management Service.
  728. // Note: Secret Manager is the recommended technique
  729. // for managing sensitive data with Cloud Build. Use `available_secrets` to
  730. // configure builds to access secrets from Secret Manager. For instructions,
  731. // see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets
  732. repeated Secret secrets = 32;
  733. // Output only. Stores timing information for phases of the build. Valid keys
  734. // are:
  735. //
  736. // * BUILD: time to execute all build steps.
  737. // * PUSH: time to push all specified images.
  738. // * FETCHSOURCE: time to fetch source.
  739. // * SETUPBUILD: time to set up build.
  740. //
  741. // If the build does not specify source or images,
  742. // these keys will not be included.
  743. map<string, TimeSpan> timing = 33 [(google.api.field_behavior) = OUTPUT_ONLY];
  744. // IAM service account whose credentials will be used at build runtime.
  745. // Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  746. // ACCOUNT can be email address or uniqueId of the service account.
  747. //
  748. string service_account = 42 [(google.api.resource_reference) = {
  749. type: "iam.googleapis.com/ServiceAccount"
  750. }];
  751. // Secrets and secret environment variables.
  752. Secrets available_secrets = 47;
  753. // Output only. Non-fatal problems encountered during the execution of the
  754. // build.
  755. repeated Warning warnings = 49 [(google.api.field_behavior) = OUTPUT_ONLY];
  756. // Output only. Contains information about the build when status=FAILURE.
  757. FailureInfo failure_info = 51 [(google.api.field_behavior) = OUTPUT_ONLY];
  758. }
  759. // Artifacts produced by a build that should be uploaded upon
  760. // successful completion of all build steps.
  761. message Artifacts {
  762. // Files in the workspace to upload to Cloud Storage upon successful
  763. // completion of all build steps.
  764. message ArtifactObjects {
  765. // Cloud Storage bucket and optional object path, in the form
  766. // "gs://bucket/path/to/somewhere/". (see [Bucket Name
  767. // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
  768. //
  769. // Files in the workspace matching any path pattern will be uploaded to
  770. // Cloud Storage with this location as a prefix.
  771. string location = 1;
  772. // Path globs used to match files in the build's workspace.
  773. repeated string paths = 2;
  774. // Output only. Stores timing information for pushing all artifact objects.
  775. TimeSpan timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  776. }
  777. // A list of images to be pushed upon the successful completion of all build
  778. // steps.
  779. //
  780. // The images will be pushed using the builder service account's credentials.
  781. //
  782. // The digests of the pushed images will be stored in the Build resource's
  783. // results field.
  784. //
  785. // If any of the images fail to be pushed, the build is marked FAILURE.
  786. repeated string images = 1;
  787. // A list of objects to be uploaded to Cloud Storage upon successful
  788. // completion of all build steps.
  789. //
  790. // Files in the workspace matching specified paths globs will be uploaded to
  791. // the specified Cloud Storage location using the builder service account's
  792. // credentials.
  793. //
  794. // The location and generation of the uploaded objects will be stored in the
  795. // Build resource's results field.
  796. //
  797. // If any objects fail to be pushed, the build is marked FAILURE.
  798. ArtifactObjects objects = 2;
  799. }
  800. // Start and end times for a build execution phase.
  801. message TimeSpan {
  802. // Start of time span.
  803. google.protobuf.Timestamp start_time = 1;
  804. // End of time span.
  805. google.protobuf.Timestamp end_time = 2;
  806. }
  807. // Metadata for build operations.
  808. message BuildOperationMetadata {
  809. // The build that the operation is tracking.
  810. Build build = 1;
  811. }
  812. // Provenance of the source. Ways to find the original source, or verify that
  813. // some source was used for this build.
  814. message SourceProvenance {
  815. // A copy of the build's `source.storage_source`, if exists, with any
  816. // generations resolved.
  817. StorageSource resolved_storage_source = 3;
  818. // A copy of the build's `source.repo_source`, if exists, with any
  819. // revisions resolved.
  820. RepoSource resolved_repo_source = 6;
  821. // A copy of the build's `source.storage_source_manifest`, if exists, with any
  822. // revisions resolved.
  823. // This feature is in Preview.
  824. StorageSourceManifest resolved_storage_source_manifest = 9;
  825. // Output only. Hash(es) of the build source, which can be used to verify that
  826. // the original source integrity was maintained in the build. Note that
  827. // `FileHashes` will only be populated if `BuildOptions` has requested a
  828. // `SourceProvenanceHash`.
  829. //
  830. // The keys to this map are file paths used as build source and the values
  831. // contain the hash values for those files.
  832. //
  833. // If the build source came in a single package such as a gzipped tarfile
  834. // (`.tar.gz`), the `FileHash` will be for the single path to that file.
  835. map<string, FileHashes> file_hashes = 4
  836. [(google.api.field_behavior) = OUTPUT_ONLY];
  837. }
  838. // Container message for hashes of byte content of files, used in
  839. // SourceProvenance messages to verify integrity of source input to the build.
  840. message FileHashes {
  841. // Collection of file hashes.
  842. repeated Hash file_hash = 1;
  843. }
  844. // Container message for hash values.
  845. message Hash {
  846. // Specifies the hash algorithm, if any.
  847. enum HashType {
  848. // No hash requested.
  849. NONE = 0;
  850. // Use a sha256 hash.
  851. SHA256 = 1;
  852. // Use a md5 hash.
  853. MD5 = 2;
  854. }
  855. // The type of hash that was performed.
  856. HashType type = 1;
  857. // The hash value.
  858. bytes value = 2;
  859. }
  860. // Secrets and secret environment variables.
  861. message Secrets {
  862. // Secrets in Secret Manager and associated secret environment variable.
  863. repeated SecretManagerSecret secret_manager = 1;
  864. // Secrets encrypted with KMS key and the associated secret environment
  865. // variable.
  866. repeated InlineSecret inline = 2;
  867. }
  868. // Pairs a set of secret environment variables mapped to encrypted
  869. // values with the Cloud KMS key to use to decrypt the value.
  870. message InlineSecret {
  871. // Resource name of Cloud KMS crypto key to decrypt the encrypted value.
  872. // In format: projects/*/locations/*/keyRings/*/cryptoKeys/*
  873. string kms_key_name = 1 [(google.api.resource_reference) = {
  874. type: "cloudkms.googleapis.com/CryptoKey"
  875. }];
  876. // Map of environment variable name to its encrypted value.
  877. //
  878. // Secret environment variables must be unique across all of a build's
  879. // secrets, and must be used by at least one build step. Values can be at most
  880. // 64 KB in size. There can be at most 100 secret values across all of a
  881. // build's secrets.
  882. map<string, bytes> env_map = 2;
  883. }
  884. // Pairs a secret environment variable with a SecretVersion in Secret Manager.
  885. message SecretManagerSecret {
  886. // Resource name of the SecretVersion. In format:
  887. // projects/*/secrets/*/versions/*
  888. string version_name = 1 [(google.api.resource_reference) = {
  889. type: "secretmanager.googleapis.com/SecretVersion"
  890. }];
  891. // Environment variable name to associate with the secret.
  892. // Secret environment variables must be unique across all of a build's
  893. // secrets, and must be used by at least one build step.
  894. string env = 2;
  895. }
  896. // Pairs a set of secret environment variables containing encrypted
  897. // values with the Cloud KMS key to use to decrypt the value.
  898. // Note: Use `kmsKeyName` with `available_secrets` instead of using
  899. // `kmsKeyName` with `secret`. For instructions see:
  900. // https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials.
  901. message Secret {
  902. // Cloud KMS key name to use to decrypt these envs.
  903. string kms_key_name = 1;
  904. // Map of environment variable name to its encrypted value.
  905. //
  906. // Secret environment variables must be unique across all of a build's
  907. // secrets, and must be used by at least one build step. Values can be at most
  908. // 64 KB in size. There can be at most 100 secret values across all of a
  909. // build's secrets.
  910. map<string, bytes> secret_env = 3;
  911. }
  912. // Request to create a new build.
  913. message CreateBuildRequest {
  914. // The parent resource where this build will be created.
  915. // Format: `projects/{project}/locations/{location}`
  916. string parent = 4 [(google.api.resource_reference) = {
  917. child_type: "cloudbuild.googleapis.com/Build"
  918. }];
  919. // Required. ID of the project.
  920. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  921. // Required. Build resource to create.
  922. Build build = 2 [(google.api.field_behavior) = REQUIRED];
  923. }
  924. // Request to get a build.
  925. message GetBuildRequest {
  926. // The name of the `Build` to retrieve.
  927. // Format: `projects/{project}/locations/{location}/builds/{build}`
  928. string name = 4 [(google.api.resource_reference) = {
  929. type: "cloudbuild.googleapis.com/Build"
  930. }];
  931. // Required. ID of the project.
  932. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  933. // Required. ID of the build.
  934. string id = 2 [(google.api.field_behavior) = REQUIRED];
  935. }
  936. // Request to list builds.
  937. message ListBuildsRequest {
  938. // The parent of the collection of `Builds`.
  939. // Format: `projects/{project}/locations/location`
  940. string parent = 9 [(google.api.resource_reference) = {
  941. child_type: "cloudbuild.googleapis.com/Build"
  942. }];
  943. // Required. ID of the project.
  944. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  945. // Number of results to return in the list.
  946. int32 page_size = 2;
  947. // The page token for the next page of Builds.
  948. //
  949. // If unspecified, the first page of results is returned.
  950. //
  951. // If the token is rejected for any reason, INVALID_ARGUMENT will be thrown.
  952. // In this case, the token should be discarded, and pagination should be
  953. // restarted from the first page of results.
  954. //
  955. // See https://google.aip.dev/158 for more.
  956. string page_token = 3;
  957. // The raw filter text to constrain the results.
  958. string filter = 8;
  959. }
  960. // Response including listed builds.
  961. message ListBuildsResponse {
  962. // Builds will be sorted by `create_time`, descending.
  963. repeated Build builds = 1;
  964. // Token to receive the next page of results.
  965. // This will be absent if the end of the response list has been reached.
  966. string next_page_token = 2;
  967. }
  968. // Request to cancel an ongoing build.
  969. message CancelBuildRequest {
  970. // The name of the `Build` to cancel.
  971. // Format: `projects/{project}/locations/{location}/builds/{build}`
  972. string name = 4 [(google.api.resource_reference) = {
  973. type: "cloudbuild.googleapis.com/Build"
  974. }];
  975. // Required. ID of the project.
  976. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  977. // Required. ID of the build.
  978. string id = 2 [(google.api.field_behavior) = REQUIRED];
  979. }
  980. // Configuration for an automated build in response to source repository
  981. // changes.
  982. message BuildTrigger {
  983. option (google.api.resource) = {
  984. type: "cloudbuild.googleapis.com/BuildTrigger"
  985. plural: "triggers"
  986. singular: "trigger"
  987. pattern: "projects/{project}/triggers/{trigger}"
  988. pattern: "projects/{project}/locations/{location}/triggers/{trigger}"
  989. };
  990. // The `Trigger` name with format:
  991. // `projects/{project}/locations/{location}/triggers/{trigger}`, where
  992. // {trigger} is a unique identifier generated by the service.
  993. string resource_name = 34;
  994. // Output only. Unique identifier of the trigger.
  995. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  996. // Human-readable description of this trigger.
  997. string description = 10;
  998. // User-assigned name of the trigger. Must be unique within the project.
  999. // Trigger names must meet the following requirements:
  1000. //
  1001. // + They must contain only alphanumeric characters and dashes.
  1002. // + They can be 1-64 characters long.
  1003. // + They must begin and end with an alphanumeric character.
  1004. string name = 21;
  1005. // Tags for annotation of a `BuildTrigger`
  1006. repeated string tags = 19;
  1007. // Template describing the types of source changes to trigger a build.
  1008. //
  1009. // Branch and tag names in trigger templates are interpreted as regular
  1010. // expressions. Any branch or tag change that matches that regular expression
  1011. // will trigger a build.
  1012. //
  1013. // Mutually exclusive with `github`.
  1014. RepoSource trigger_template = 7;
  1015. // GitHubEventsConfig describes the configuration of a trigger that creates
  1016. // a build whenever a GitHub event is received.
  1017. //
  1018. // Mutually exclusive with `trigger_template`.
  1019. GitHubEventsConfig github = 13;
  1020. // PubsubConfig describes the configuration of a trigger that
  1021. // creates a build whenever a Pub/Sub message is published.
  1022. PubsubConfig pubsub_config = 29;
  1023. // WebhookConfig describes the configuration of a trigger that
  1024. // creates a build whenever a webhook is sent to a trigger's webhook URL.
  1025. WebhookConfig webhook_config = 31;
  1026. // Template describing the Build request to make when the trigger is matched.
  1027. oneof build_template {
  1028. // Autodetect build configuration. The following precedence is used (case
  1029. // insensitive):
  1030. //
  1031. // 1. cloudbuild.yaml
  1032. // 2. cloudbuild.yml
  1033. // 3. cloudbuild.json
  1034. // 4. Dockerfile
  1035. //
  1036. // Currently only available for GitHub App Triggers.
  1037. bool autodetect = 18;
  1038. // Contents of the build template.
  1039. Build build = 4;
  1040. // Path, from the source root, to the build configuration file
  1041. // (i.e. cloudbuild.yaml).
  1042. string filename = 8;
  1043. }
  1044. // Output only. Time when the trigger was created.
  1045. google.protobuf.Timestamp create_time = 5
  1046. [(google.api.field_behavior) = OUTPUT_ONLY];
  1047. // If true, the trigger will never automatically execute a build.
  1048. bool disabled = 9;
  1049. // Substitutions for Build resource. The keys must match the following
  1050. // regular expression: `^_[A-Z0-9_]+$`.
  1051. map<string, string> substitutions = 11;
  1052. // ignored_files and included_files are file glob matches using
  1053. // https://golang.org/pkg/path/filepath/#Match extended with support for "**".
  1054. //
  1055. // If ignored_files and changed files are both empty, then they are
  1056. // not used to determine whether or not to trigger a build.
  1057. //
  1058. // If ignored_files is not empty, then we ignore any files that match
  1059. // any of the ignored_file globs. If the change has no files that are
  1060. // outside of the ignored_files globs, then we do not trigger a build.
  1061. repeated string ignored_files = 15;
  1062. // If any of the files altered in the commit pass the ignored_files
  1063. // filter and included_files is empty, then as far as this filter is
  1064. // concerned, we should trigger the build.
  1065. //
  1066. // If any of the files altered in the commit pass the ignored_files
  1067. // filter and included_files is not empty, then we make sure that at
  1068. // least one of those files matches a included_files glob. If not,
  1069. // then we do not trigger a build.
  1070. repeated string included_files = 16;
  1071. // Optional. A Common Expression Language string.
  1072. string filter = 30 [(google.api.field_behavior) = OPTIONAL];
  1073. }
  1074. // GitHubEventsConfig describes the configuration of a trigger that creates a
  1075. // build whenever a GitHub event is received.
  1076. //
  1077. // This message is experimental.
  1078. message GitHubEventsConfig {
  1079. // The installationID that emits the GitHub event.
  1080. int64 installation_id = 1 [deprecated = true];
  1081. // Owner of the repository. For example: The owner for
  1082. // https://github.com/googlecloudplatform/cloud-builders is
  1083. // "googlecloudplatform".
  1084. string owner = 6;
  1085. // Name of the repository. For example: The name for
  1086. // https://github.com/googlecloudplatform/cloud-builders is "cloud-builders".
  1087. string name = 7;
  1088. // Filter describing the types of events to trigger a build.
  1089. // Currently supported event types: push, pull_request.
  1090. oneof event {
  1091. // filter to match changes in pull requests.
  1092. PullRequestFilter pull_request = 4;
  1093. // filter to match changes in refs like branches, tags.
  1094. PushFilter push = 5;
  1095. }
  1096. }
  1097. // PubsubConfig describes the configuration of a trigger that
  1098. // creates a build whenever a Pub/Sub message is published.
  1099. message PubsubConfig {
  1100. // Enumerates potential issues with the underlying Pub/Sub subscription
  1101. // configuration.
  1102. enum State {
  1103. // The subscription configuration has not been checked.
  1104. STATE_UNSPECIFIED = 0;
  1105. // The Pub/Sub subscription is properly configured.
  1106. OK = 1;
  1107. // The subscription has been deleted.
  1108. SUBSCRIPTION_DELETED = 2;
  1109. // The topic has been deleted.
  1110. TOPIC_DELETED = 3;
  1111. // Some of the subscription's field are misconfigured.
  1112. SUBSCRIPTION_MISCONFIGURED = 4;
  1113. }
  1114. // Output only. Name of the subscription. Format is
  1115. // `projects/{project}/subscriptions/{subscription}`.
  1116. string subscription = 1 [
  1117. (google.api.field_behavior) = OUTPUT_ONLY,
  1118. (google.api.resource_reference) = {
  1119. type: "pubsub.googleapis.com/Subscription"
  1120. }
  1121. ];
  1122. // The name of the topic from which this subscription is receiving messages.
  1123. // Format is `projects/{project}/topics/{topic}`.
  1124. string topic = 2 [
  1125. (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
  1126. ];
  1127. // Service account that will make the push request.
  1128. string service_account_email = 3 [(google.api.resource_reference) = {
  1129. type: "iam.googleapis.com/ServiceAccount"
  1130. }];
  1131. // Potential issues with the underlying Pub/Sub subscription configuration.
  1132. // Only populated on get requests.
  1133. State state = 4;
  1134. }
  1135. // WebhookConfig describes the configuration of a trigger that
  1136. // creates a build whenever a webhook is sent to a trigger's webhook URL.
  1137. message WebhookConfig {
  1138. // Enumerates potential issues with the Secret Manager secret provided by the
  1139. // user.
  1140. enum State {
  1141. // The webhook auth configuration not been checked.
  1142. STATE_UNSPECIFIED = 0;
  1143. // The auth configuration is properly setup.
  1144. OK = 1;
  1145. // The secret provided in auth_method has been deleted.
  1146. SECRET_DELETED = 2;
  1147. }
  1148. // Auth method specifies how the webhook authenticates with GCP.
  1149. oneof auth_method {
  1150. // Required. Resource name for the secret required as a URL parameter.
  1151. string secret = 3 [
  1152. (google.api.field_behavior) = REQUIRED,
  1153. (google.api.resource_reference) = {
  1154. type: "secretmanager.googleapis.com/SecretVersion"
  1155. }
  1156. ];
  1157. }
  1158. // Potential issues with the underlying Pub/Sub subscription configuration.
  1159. // Only populated on get requests.
  1160. State state = 4;
  1161. }
  1162. // PullRequestFilter contains filter properties for matching GitHub Pull
  1163. // Requests.
  1164. message PullRequestFilter {
  1165. // Controls behavior of Pull Request comments.
  1166. enum CommentControl {
  1167. // Do not require comments on Pull Requests before builds are triggered.
  1168. COMMENTS_DISABLED = 0;
  1169. // Enforce that repository owners or collaborators must comment on Pull
  1170. // Requests before builds are triggered.
  1171. COMMENTS_ENABLED = 1;
  1172. // Enforce that repository owners or collaborators must comment on external
  1173. // contributors' Pull Requests before builds are triggered.
  1174. COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2;
  1175. }
  1176. // Target refs to match.
  1177. // A target ref is the git reference where the pull request will be applied.
  1178. oneof git_ref {
  1179. // Regex of branches to match.
  1180. //
  1181. // The syntax of the regular expressions accepted is the syntax accepted by
  1182. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  1183. string branch = 2;
  1184. }
  1185. // Configure builds to run whether a repository owner or collaborator need to
  1186. // comment `/gcbrun`.
  1187. CommentControl comment_control = 5;
  1188. // If true, branches that do NOT match the git_ref will trigger a build.
  1189. bool invert_regex = 6;
  1190. }
  1191. // Push contains filter properties for matching GitHub git pushes.
  1192. message PushFilter {
  1193. // Modified refs to match.
  1194. // A modified refs are the refs modified by a git push operation.
  1195. oneof git_ref {
  1196. // Regexes matching branches to build.
  1197. //
  1198. // The syntax of the regular expressions accepted is the syntax accepted by
  1199. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  1200. string branch = 2;
  1201. // Regexes matching tags to build.
  1202. //
  1203. // The syntax of the regular expressions accepted is the syntax accepted by
  1204. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  1205. string tag = 3;
  1206. }
  1207. // When true, only trigger a build if the revision regex does NOT match the
  1208. // git_ref regex.
  1209. bool invert_regex = 4;
  1210. }
  1211. // Request to create a new `BuildTrigger`.
  1212. message CreateBuildTriggerRequest {
  1213. // The parent resource where this trigger will be created.
  1214. // Format: `projects/{project}/locations/{location}`
  1215. string parent = 3 [(google.api.resource_reference) = {
  1216. child_type: "cloudbuild.googleapis.com/BuildTrigger"
  1217. }];
  1218. // Required. ID of the project for which to configure automatic builds.
  1219. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1220. // Required. `BuildTrigger` to create.
  1221. BuildTrigger trigger = 2 [(google.api.field_behavior) = REQUIRED];
  1222. }
  1223. // Returns the `BuildTrigger` with the specified ID.
  1224. message GetBuildTriggerRequest {
  1225. // The name of the `Trigger` to retrieve.
  1226. // Format: `projects/{project}/locations/{location}/triggers/{trigger}`
  1227. string name = 3 [(google.api.resource_reference) = {
  1228. type: "cloudbuild.googleapis.com/BuildTrigger"
  1229. }];
  1230. // Required. ID of the project that owns the trigger.
  1231. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1232. // Required. Identifier (`id` or `name`) of the `BuildTrigger` to get.
  1233. string trigger_id = 2 [(google.api.field_behavior) = REQUIRED];
  1234. }
  1235. // Request to list existing `BuildTriggers`.
  1236. message ListBuildTriggersRequest {
  1237. // The parent of the collection of `Triggers`.
  1238. // Format: `projects/{project}/locations/{location}`
  1239. string parent = 4 [(google.api.resource_reference) = {
  1240. child_type: "cloudbuild.googleapis.com/BuildTrigger"
  1241. }];
  1242. // Required. ID of the project for which to list BuildTriggers.
  1243. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1244. // Number of results to return in the list.
  1245. int32 page_size = 2;
  1246. // Token to provide to skip to a particular spot in the list.
  1247. string page_token = 3;
  1248. }
  1249. // Response containing existing `BuildTriggers`.
  1250. message ListBuildTriggersResponse {
  1251. // `BuildTriggers` for the project, sorted by `create_time` descending.
  1252. repeated BuildTrigger triggers = 1;
  1253. // Token to receive the next page of results.
  1254. string next_page_token = 2;
  1255. }
  1256. // Request to delete a `BuildTrigger`.
  1257. message DeleteBuildTriggerRequest {
  1258. // The name of the `Trigger` to delete.
  1259. // Format: `projects/{project}/locations/{location}/triggers/{trigger}`
  1260. string name = 3 [(google.api.resource_reference) = {
  1261. type: "cloudbuild.googleapis.com/BuildTrigger"
  1262. }];
  1263. // Required. ID of the project that owns the trigger.
  1264. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1265. // Required. ID of the `BuildTrigger` to delete.
  1266. string trigger_id = 2 [(google.api.field_behavior) = REQUIRED];
  1267. }
  1268. // Request to update an existing `BuildTrigger`.
  1269. message UpdateBuildTriggerRequest {
  1270. // Required. ID of the project that owns the trigger.
  1271. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1272. // Required. ID of the `BuildTrigger` to update.
  1273. string trigger_id = 2 [(google.api.field_behavior) = REQUIRED];
  1274. // Required. `BuildTrigger` to update.
  1275. BuildTrigger trigger = 3 [(google.api.field_behavior) = REQUIRED];
  1276. }
  1277. // Optional arguments to enable specific features of builds.
  1278. message BuildOptions {
  1279. // Details about how a build should be executed on a `WorkerPool`.
  1280. //
  1281. // See [running builds in a private
  1282. // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool)
  1283. // for more information.
  1284. message PoolOption {
  1285. // The `WorkerPool` resource to execute the build on.
  1286. // You must have `cloudbuild.workerpools.use` on the project hosting the
  1287. // WorkerPool.
  1288. //
  1289. // Format projects/{project}/locations/{location}/workerPools/{workerPoolId}
  1290. string name = 1 [(google.api.resource_reference) = {
  1291. type: "cloudbuild.googleapis.com/WorkerPool"
  1292. }];
  1293. }
  1294. // Specifies the manner in which the build should be verified, if at all.
  1295. enum VerifyOption {
  1296. // Not a verifiable build. (default)
  1297. NOT_VERIFIED = 0;
  1298. // Verified build.
  1299. VERIFIED = 1;
  1300. }
  1301. // Supported Compute Engine machine types.
  1302. // For more information, see [Machine
  1303. // types](https://cloud.google.com/compute/docs/machine-types).
  1304. enum MachineType {
  1305. // Standard machine type.
  1306. UNSPECIFIED = 0;
  1307. // Highcpu machine with 8 CPUs.
  1308. N1_HIGHCPU_8 = 1;
  1309. // Highcpu machine with 32 CPUs.
  1310. N1_HIGHCPU_32 = 2;
  1311. // Highcpu e2 machine with 8 CPUs.
  1312. E2_HIGHCPU_8 = 5;
  1313. // Highcpu e2 machine with 32 CPUs.
  1314. E2_HIGHCPU_32 = 6;
  1315. }
  1316. // Specifies the behavior when there is an error in the substitution checks.
  1317. enum SubstitutionOption {
  1318. // Fails the build if error in substitutions checks, like missing
  1319. // a substitution in the template or in the map.
  1320. MUST_MATCH = 0;
  1321. // Do not fail the build if error in substitutions checks.
  1322. ALLOW_LOOSE = 1;
  1323. }
  1324. // Specifies the behavior when writing build logs to Google Cloud Storage.
  1325. enum LogStreamingOption {
  1326. // Service may automatically determine build log streaming behavior.
  1327. STREAM_DEFAULT = 0;
  1328. // Build logs should be streamed to Google Cloud Storage.
  1329. STREAM_ON = 1;
  1330. // Build logs should not be streamed to Google Cloud Storage; they will be
  1331. // written when the build is completed.
  1332. STREAM_OFF = 2;
  1333. }
  1334. // Specifies the logging mode.
  1335. enum LoggingMode {
  1336. // The service determines the logging mode. The default is `LEGACY`. Do not
  1337. // rely on the default logging behavior as it may change in the future.
  1338. LOGGING_UNSPECIFIED = 0;
  1339. // Cloud Logging and Cloud Storage logging are enabled.
  1340. LEGACY = 1;
  1341. // Only Cloud Storage logging is enabled.
  1342. GCS_ONLY = 2;
  1343. // This option is the same as CLOUD_LOGGING_ONLY.
  1344. STACKDRIVER_ONLY = 3 [deprecated = true];
  1345. // Only Cloud Logging is enabled. Note that logs for both the Cloud Console
  1346. // UI and Cloud SDK are based on Cloud Storage logs, so neither will provide
  1347. // logs if this option is chosen.
  1348. CLOUD_LOGGING_ONLY = 5;
  1349. // Turn off all logging. No build logs will be captured.
  1350. NONE = 4;
  1351. }
  1352. // Requested hash for SourceProvenance.
  1353. repeated Hash.HashType source_provenance_hash = 1;
  1354. // Requested verifiability options.
  1355. VerifyOption requested_verify_option = 2;
  1356. // Compute Engine machine type on which to run the build.
  1357. MachineType machine_type = 3;
  1358. // Requested disk size for the VM that runs the build. Note that this is *NOT*
  1359. // "disk free"; some of the space will be used by the operating system and
  1360. // build utilities. Also note that this is the minimum disk size that will be
  1361. // allocated for the build -- the build may run with a larger disk than
  1362. // requested. At present, the maximum disk size is 1000GB; builds that request
  1363. // more than the maximum are rejected with an error.
  1364. int64 disk_size_gb = 6;
  1365. // Option to specify behavior when there is an error in the substitution
  1366. // checks.
  1367. //
  1368. // NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot
  1369. // be overridden in the build configuration file.
  1370. SubstitutionOption substitution_option = 4;
  1371. // Option to specify whether or not to apply bash style string
  1372. // operations to the substitutions.
  1373. //
  1374. // NOTE: this is always enabled for triggered builds and cannot be
  1375. // overridden in the build configuration file.
  1376. bool dynamic_substitutions = 17;
  1377. // Option to define build log streaming behavior to Google Cloud
  1378. // Storage.
  1379. LogStreamingOption log_streaming_option = 5;
  1380. // This field deprecated; please use `pool.name` instead.
  1381. string worker_pool = 7 [deprecated = true];
  1382. // Optional. Specification for execution on a `WorkerPool`.
  1383. //
  1384. // See [running builds in a private
  1385. // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool)
  1386. // for more information.
  1387. PoolOption pool = 19 [(google.api.field_behavior) = OPTIONAL];
  1388. // Option to specify the logging mode, which determines if and where build
  1389. // logs are stored.
  1390. LoggingMode logging = 11;
  1391. // A list of global environment variable definitions that will exist for all
  1392. // build steps in this build. If a variable is defined in both globally and in
  1393. // a build step, the variable will use the build step value.
  1394. //
  1395. // The elements are of the form "KEY=VALUE" for the environment variable "KEY"
  1396. // being given the value "VALUE".
  1397. repeated string env = 12;
  1398. // A list of global environment variables, which are encrypted using a Cloud
  1399. // Key Management Service crypto key. These values must be specified in the
  1400. // build's `Secret`. These variables will be available to all build steps
  1401. // in this build.
  1402. repeated string secret_env = 13;
  1403. // Global list of volumes to mount for ALL build steps
  1404. //
  1405. // Each volume is created as an empty volume prior to starting the build
  1406. // process. Upon completion of the build, volumes and their contents are
  1407. // discarded. Global volume names and paths cannot conflict with the volumes
  1408. // defined a build step.
  1409. //
  1410. // Using a global volume in a build with only one step is not valid as
  1411. // it is indicative of a build request with an incorrect configuration.
  1412. repeated Volume volumes = 14;
  1413. }
  1414. // ReceiveTriggerWebhookRequest [Experimental] is the request object accepted by
  1415. // the ReceiveTriggerWebhook method.
  1416. message ReceiveTriggerWebhookRequest {
  1417. // The name of the `ReceiveTriggerWebhook` to retrieve.
  1418. // Format: `projects/{project}/locations/{location}/triggers/{trigger}`
  1419. string name = 5;
  1420. // HTTP request body.
  1421. google.api.HttpBody body = 1;
  1422. // Project in which the specified trigger lives
  1423. string project_id = 2;
  1424. // Name of the trigger to run the payload against
  1425. string trigger = 3;
  1426. // Secret token used for authorization if an OAuth token isn't provided.
  1427. string secret = 4;
  1428. }
  1429. // ReceiveTriggerWebhookResponse [Experimental] is the response object for the
  1430. // ReceiveTriggerWebhook method.
  1431. message ReceiveTriggerWebhookResponse {}
  1432. // Configuration for a `WorkerPool`.
  1433. //
  1434. // Cloud Build owns and maintains a pool of workers for general use and have no
  1435. // access to a project's private network. By default, builds submitted to
  1436. // Cloud Build will use a worker from this pool.
  1437. //
  1438. // If your build needs access to resources on a private network,
  1439. // create and use a `WorkerPool` to run your builds. Private `WorkerPool`s give
  1440. // your builds access to any single VPC network that you
  1441. // administer, including any on-prem resources connected to that VPC
  1442. // network. For an overview of private pools, see
  1443. // [Private pools
  1444. // overview](https://cloud.google.com/build/docs/private-pools/private-pools-overview).
  1445. message WorkerPool {
  1446. option (google.api.resource) = {
  1447. type: "cloudbuild.googleapis.com/WorkerPool"
  1448. pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}"
  1449. plural: "workerPools"
  1450. singular: "workerPool"
  1451. style: DECLARATIVE_FRIENDLY
  1452. };
  1453. // State of the `WorkerPool`.
  1454. enum State {
  1455. // State of the `WorkerPool` is unknown.
  1456. STATE_UNSPECIFIED = 0;
  1457. // `WorkerPool` is being created.
  1458. CREATING = 1;
  1459. // `WorkerPool` is running.
  1460. RUNNING = 2;
  1461. // `WorkerPool` is being deleted: cancelling builds and draining workers.
  1462. DELETING = 3;
  1463. // `WorkerPool` is deleted.
  1464. DELETED = 4;
  1465. }
  1466. // Output only. The resource name of the `WorkerPool`, with format
  1467. // `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
  1468. // The value of `{worker_pool}` is provided by `worker_pool_id` in
  1469. // `CreateWorkerPool` request and the value of `{location}` is determined by
  1470. // the endpoint accessed.
  1471. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  1472. // A user-specified, human-readable name for the `WorkerPool`. If provided,
  1473. // this value must be 1-63 characters.
  1474. string display_name = 2;
  1475. // Output only. A unique identifier for the `WorkerPool`.
  1476. string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  1477. // User specified annotations. See https://google.aip.dev/128#annotations
  1478. // for more details such as format and size limitations.
  1479. map<string, string> annotations = 4;
  1480. // Output only. Time at which the request to create the `WorkerPool` was
  1481. // received.
  1482. google.protobuf.Timestamp create_time = 5
  1483. [(google.api.field_behavior) = OUTPUT_ONLY];
  1484. // Output only. Time at which the request to update the `WorkerPool` was
  1485. // received.
  1486. google.protobuf.Timestamp update_time = 6
  1487. [(google.api.field_behavior) = OUTPUT_ONLY];
  1488. // Output only. Time at which the request to delete the `WorkerPool` was
  1489. // received.
  1490. google.protobuf.Timestamp delete_time = 7
  1491. [(google.api.field_behavior) = OUTPUT_ONLY];
  1492. // Output only. `WorkerPool` state.
  1493. State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  1494. // Private Pool configuration for the `WorkerPool`.
  1495. oneof config {
  1496. // Private Pool using a v1 configuration.
  1497. PrivatePoolV1Config private_pool_v1_config = 12;
  1498. }
  1499. // Output only. Checksum computed by the server. May be sent on update and
  1500. // delete requests to ensure that the client has an up-to-date value before
  1501. // proceeding.
  1502. string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  1503. }
  1504. // Configuration for a V1 `PrivatePool`.
  1505. message PrivatePoolV1Config {
  1506. // Defines the configuration to be used for creating workers in
  1507. // the pool.
  1508. message WorkerConfig {
  1509. // Machine type of a worker, such as `e2-medium`.
  1510. // See [Worker pool config
  1511. // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema).
  1512. // If left blank, Cloud Build will use a sensible default.
  1513. string machine_type = 1;
  1514. // Size of the disk attached to the worker, in GB.
  1515. // See [Worker pool config
  1516. // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema).
  1517. // Specify a value of up to 1000. If `0` is specified, Cloud Build will use
  1518. // a standard disk size.
  1519. int64 disk_size_gb = 2;
  1520. }
  1521. // Defines the network configuration for the pool.
  1522. message NetworkConfig {
  1523. // Defines the egress option for the pool.
  1524. enum EgressOption {
  1525. // If set, defaults to PUBLIC_EGRESS.
  1526. EGRESS_OPTION_UNSPECIFIED = 0;
  1527. // If set, workers are created without any public address, which prevents
  1528. // network egress to public IPs unless a network proxy is configured.
  1529. NO_PUBLIC_EGRESS = 1;
  1530. // If set, workers are created with a public address which allows for
  1531. // public internet egress.
  1532. PUBLIC_EGRESS = 2;
  1533. }
  1534. // Required. Immutable. The network definition that the workers are peered
  1535. // to. If this section is left empty, the workers will be peered to
  1536. // `WorkerPool.project_id` on the service producer network. Must be in the
  1537. // format `projects/{project}/global/networks/{network}`, where `{project}`
  1538. // is a project number, such as `12345`, and `{network}` is the name of a
  1539. // VPC network in the project. See
  1540. // [Understanding network configuration
  1541. // options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment)
  1542. string peered_network = 1 [
  1543. (google.api.field_behavior) = IMMUTABLE,
  1544. (google.api.field_behavior) = REQUIRED,
  1545. (google.api.resource_reference) = {
  1546. type: "compute.googleapis.com/Network"
  1547. }
  1548. ];
  1549. // Option to configure network egress for the workers.
  1550. EgressOption egress_option = 2;
  1551. }
  1552. // Machine configuration for the workers in the pool.
  1553. WorkerConfig worker_config = 1;
  1554. // Network configuration for the pool.
  1555. NetworkConfig network_config = 2;
  1556. }
  1557. // Request to create a new `WorkerPool`.
  1558. message CreateWorkerPoolRequest {
  1559. // Required. The parent resource where this worker pool will be created.
  1560. // Format: `projects/{project}/locations/{location}`.
  1561. string parent = 1 [
  1562. (google.api.field_behavior) = REQUIRED,
  1563. (google.api.resource_reference) = {
  1564. type: "locations.googleapis.com/Location"
  1565. }
  1566. ];
  1567. // Required. `WorkerPool` resource to create.
  1568. WorkerPool worker_pool = 2 [(google.api.field_behavior) = REQUIRED];
  1569. // Required. Immutable. The ID to use for the `WorkerPool`, which will become
  1570. // the final component of the resource name.
  1571. //
  1572. // This value should be 1-63 characters, and valid characters
  1573. // are /[a-z][0-9]-/.
  1574. string worker_pool_id = 3 [
  1575. (google.api.field_behavior) = IMMUTABLE,
  1576. (google.api.field_behavior) = REQUIRED
  1577. ];
  1578. // If set, validate the request and preview the response, but do not actually
  1579. // post it.
  1580. bool validate_only = 4;
  1581. }
  1582. // Request to get a `WorkerPool` with the specified name.
  1583. message GetWorkerPoolRequest {
  1584. // Required. The name of the `WorkerPool` to retrieve.
  1585. // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`.
  1586. string name = 1 [
  1587. (google.api.field_behavior) = REQUIRED,
  1588. (google.api.resource_reference) = {
  1589. type: "cloudbuild.googleapis.com/WorkerPool"
  1590. }
  1591. ];
  1592. }
  1593. // Request to delete a `WorkerPool`.
  1594. message DeleteWorkerPoolRequest {
  1595. // Required. The name of the `WorkerPool` to delete.
  1596. // Format:
  1597. // `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`.
  1598. string name = 1 [
  1599. (google.api.field_behavior) = REQUIRED,
  1600. (google.api.resource_reference) = {
  1601. type: "cloudbuild.googleapis.com/WorkerPool"
  1602. }
  1603. ];
  1604. // Optional. If this is provided, it must match the server's etag on the
  1605. // workerpool for the request to be processed.
  1606. string etag = 2;
  1607. // If set to true, and the `WorkerPool` is not found, the request will succeed
  1608. // but no action will be taken on the server.
  1609. bool allow_missing = 3;
  1610. // If set, validate the request and preview the response, but do not actually
  1611. // post it.
  1612. bool validate_only = 4;
  1613. }
  1614. // Request to update a `WorkerPool`.
  1615. message UpdateWorkerPoolRequest {
  1616. // Required. The `WorkerPool` to update.
  1617. //
  1618. // The `name` field is used to identify the `WorkerPool` to update.
  1619. // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`.
  1620. WorkerPool worker_pool = 1 [(google.api.field_behavior) = REQUIRED];
  1621. // A mask specifying which fields in `worker_pool` to update.
  1622. google.protobuf.FieldMask update_mask = 2;
  1623. // If set, validate the request and preview the response, but do not actually
  1624. // post it.
  1625. bool validate_only = 4;
  1626. }
  1627. // Request to list `WorkerPool`s.
  1628. message ListWorkerPoolsRequest {
  1629. // Required. The parent of the collection of `WorkerPools`.
  1630. // Format: `projects/{project}/locations/{location}`.
  1631. string parent = 1 [
  1632. (google.api.field_behavior) = REQUIRED,
  1633. (google.api.resource_reference) = {
  1634. type: "locations.googleapis.com/Location"
  1635. }
  1636. ];
  1637. // The maximum number of `WorkerPool`s to return. The service may return
  1638. // fewer than this value. If omitted, the server will use a sensible default.
  1639. int32 page_size = 2;
  1640. // A page token, received from a previous `ListWorkerPools` call. Provide this
  1641. // to retrieve the subsequent page.
  1642. string page_token = 3;
  1643. }
  1644. // Response containing existing `WorkerPools`.
  1645. message ListWorkerPoolsResponse {
  1646. // `WorkerPools` for the specified project.
  1647. repeated WorkerPool worker_pools = 1;
  1648. // Continuation token used to page through large result sets. Provide this
  1649. // value in a subsequent ListWorkerPoolsRequest to return the next page of
  1650. // results.
  1651. string next_page_token = 2;
  1652. }
  1653. // Metadata for the `CreateWorkerPool` operation.
  1654. message CreateWorkerPoolOperationMetadata {
  1655. // The resource name of the `WorkerPool` to create.
  1656. // Format:
  1657. // `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
  1658. string worker_pool = 1 [(google.api.resource_reference) = {
  1659. type: "cloudbuild.googleapis.com/WorkerPool"
  1660. }];
  1661. // Time the operation was created.
  1662. google.protobuf.Timestamp create_time = 2;
  1663. // Time the operation was completed.
  1664. google.protobuf.Timestamp complete_time = 3;
  1665. }
  1666. // Metadata for the `UpdateWorkerPool` operation.
  1667. message UpdateWorkerPoolOperationMetadata {
  1668. // The resource name of the `WorkerPool` being updated.
  1669. // Format:
  1670. // `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
  1671. string worker_pool = 1 [(google.api.resource_reference) = {
  1672. type: "cloudbuild.googleapis.com/WorkerPool"
  1673. }];
  1674. // Time the operation was created.
  1675. google.protobuf.Timestamp create_time = 2;
  1676. // Time the operation was completed.
  1677. google.protobuf.Timestamp complete_time = 3;
  1678. }
  1679. // Metadata for the `DeleteWorkerPool` operation.
  1680. message DeleteWorkerPoolOperationMetadata {
  1681. // The resource name of the `WorkerPool` being deleted.
  1682. // Format:
  1683. // `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
  1684. string worker_pool = 1 [(google.api.resource_reference) = {
  1685. type: "cloudbuild.googleapis.com/WorkerPool"
  1686. }];
  1687. // Time the operation was created.
  1688. google.protobuf.Timestamp create_time = 2;
  1689. // Time the operation was completed.
  1690. google.protobuf.Timestamp complete_time = 3;
  1691. }