Class v1.CloudBuildClient (5.1.0)

Creates and manages builds on Google Cloud Platform.

The main concept used by this API is a Build , which describes the location of the source to build, how to build the source, and where to store the built artifacts, if any.

A user can list previously-requested builds or get builds by their ID to determine the status of the build. v1

Package

@google-cloud/cloudbuild

Constructors

(constructor)(opts, gaxInstance)

  constructor 
 ( 
 opts 
 ?: 
  
 ClientOptions 
 , 
  
 gaxInstance 
 ?: 
  
 typeof 
  
 gax 
  
 | 
  
 typeof 
  
 gax 
 . 
 fallback 
 ); 
 

Construct an instance of CloudBuildClient.

Parameters
Name
Description
opts
ClientOptions
gaxInstance
typeof gax | typeof fallback

: loaded instance of google-gax . Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new CloudBuildClient({fallback: true}, gax); ```

Properties

apiEndpoint

  get 
  
 apiEndpoint 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service.

apiEndpoint

  static 
  
 get 
  
 apiEndpoint 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service - same as servicePath.

auth

  auth 
 : 
  
 gax 
 . 
 GoogleAuth 
 ; 
 

cloudBuildStub

  cloudBuildStub 
 ?: 
  
 Promise 
< { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }>; 
 

descriptors

  descriptors 
 : 
  
 Descriptors 
 ; 
 

innerApiCalls

  innerApiCalls 
 : 
  
 { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }; 
 

operationsClient

  operationsClient 
 : 
  
 gax 
 . 
 OperationsClient 
 ; 
 

pathTemplates

  pathTemplates 
 : 
  
 { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 gax 
 . 
 PathTemplate 
 ; 
  
 }; 
 

port

  static 
  
 get 
  
 port 
 () 
 : 
  
 number 
 ; 
 

The port for this API service.

scopes

  static 
  
 get 
  
 scopes 
 () 
 : 
  
 string 
 []; 
 

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

  static 
  
 get 
  
 servicePath 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service.

universeDomain

  get 
  
 universeDomain 
 () 
 : 
  
 string 
 ; 
 

warn

  warn 
 : 
  
 ( 
 code 
 : 
  
 string 
 , 
  
 message 
 : 
  
 string 
 , 
  
 warnType 
 ?: 
  
 string 
 ) 
  
 = 
>  
 void 
 ; 
 

Methods

approveBuild(request, options)

  approveBuild 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IApproveBuildRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Approves or rejects a pending build.

If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call.

If rejected, the returned LRO will be immediately done.

Parameters
Name
Description
request
IApproveBuildRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. Name of the target build. 
 *  For example: "projects/{$project_id}/builds/{$build_id}" 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Approval decision and metadata. 
 */ 
  
 // const approvalResult = {} 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callApproveBuild 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 approveBuild 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callApproveBuild 
 (); 
 

approveBuild(request, options, callback)

  approveBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IApproveBuildRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

approveBuild(request, callback)

  approveBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IApproveBuildRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

cancelBuild(request, options)

  cancelBuild 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICancelBuildRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICancelBuildRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Cancels a build in progress.

Parameters
Name
Description
request
ICancelBuildRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The name of the `Build` to cancel. 
 *  Format: `projects/{project}/locations/{location}/builds/{build}` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Required. ID of the project. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. ID of the build. 
 */ 
  
 // const id = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callCancelBuild 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 id 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 cancelBuild 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCancelBuild 
 (); 
 

cancelBuild(request, options, callback)

  cancelBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICancelBuildRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICancelBuildRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

cancelBuild(request, callback)

  cancelBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICancelBuildRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICancelBuildRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

checkApproveBuildProgress(name)

  checkApproveBuildProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 Build 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 BuildOperationMetadata 
>> ; 
 

Check the status of the long running operation returned by approveBuild() .

Parameter
Name
Description
name
string

The operation name that will be passed.

Returns
Type
Description

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. Name of the target build. 
 *  For example: "projects/{$project_id}/builds/{$build_id}" 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Approval decision and metadata. 
 */ 
  
 // const approvalResult = {} 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callApproveBuild 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 approveBuild 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callApproveBuild 
 (); 
 

checkCreateBuildProgress(name)

  checkCreateBuildProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 Build 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 BuildOperationMetadata 
>> ; 
 

Check the status of the long running operation returned by createBuild() .

Parameter
Name
Description
name
string

The operation name that will be passed.

Returns
Type
Description

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The parent resource where this build will be created. 
 *  Format: `projects/{project}/locations/{location}` 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. ID of the project. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. Build resource to create. 
 */ 
  
 // const build = {} 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateBuild 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 build 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 createBuild 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateBuild 
 (); 
 

checkCreateWorkerPoolProgress(name)

  checkCreateWorkerPoolProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 WorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 CreateWorkerPoolOperationMetadata 
>> ; 
 

Check the status of the long running operation returned by createWorkerPool() .

Parameter
Name
Description
name
string

The operation name that will be passed.

Returns
Type
Description

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The parent resource where this worker pool will be created. 
 *  Format: `projects/{project}/locations/{location}`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. `WorkerPool` resource to create. 
 */ 
  
 // const workerPool = {} 
  
 /** 
 *  Required. Immutable. The ID to use for the `WorkerPool`, which will become 
 *  the final component of the resource name. 
 *  This value should be 1-63 characters, and valid characters 
 *  are /[a-z][0-9]-/. 
 */ 
  
 // const workerPoolId = 'abc123' 
  
 /** 
 *  If set, validate the request and preview the response, but do not actually 
 *  post it. 
 */ 
  
 // const validateOnly = true 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateWorkerPool 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 workerPool 
 , 
  
 workerPoolId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 createWorkerPool 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateWorkerPool 
 (); 
 

checkDeleteWorkerPoolProgress(name)

  checkDeleteWorkerPoolProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 protobuf 
 . 
 Empty 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 DeleteWorkerPoolOperationMetadata 
>> ; 
 

Check the status of the long running operation returned by deleteWorkerPool() .

Parameter
Name
Description
name
string

The operation name that will be passed.

Returns
Type
Description

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the `WorkerPool` to delete. 
 *  Format: 
 *  `projects/{project}/locations/{location}/workerPools/{workerPool}`. 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Optional. If provided, it must match the server's etag on the workerpool 
 *  for the request to be processed. 
 */ 
  
 // const etag = 'abc123' 
  
 /** 
 *  If set to true, and the `WorkerPool` is not found, the request will succeed 
 *  but no action will be taken on the server. 
 */ 
  
 // const allowMissing = true 
  
 /** 
 *  If set, validate the request and preview the response, but do not actually 
 *  post it. 
 */ 
  
 // const validateOnly = true 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteWorkerPool 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 deleteWorkerPool 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callDeleteWorkerPool 
 (); 
 

checkRetryBuildProgress(name)

  checkRetryBuildProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 Build 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 BuildOperationMetadata 
>> ; 
 

Check the status of the long running operation returned by retryBuild() .

Parameter
Name
Description
name
string

The operation name that will be passed.

Returns
Type
Description

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The name of the `Build` to retry. 
 *  Format: `projects/{project}/locations/{location}/builds/{build}` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Required. ID of the project. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. Build ID of the original build. 
 */ 
  
 // const id = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callRetryBuild 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 id 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 retryBuild 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callRetryBuild 
 (); 
 

checkRunBuildTriggerProgress(name)

  checkRunBuildTriggerProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 Build 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 BuildOperationMetadata 
>> ; 
 

Check the status of the long running operation returned by runBuildTrigger() .

Parameter
Name
Description
name
string

The operation name that will be passed.

Returns
Type
Description

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The name of the `Trigger` to run. 
 *  Format: `projects/{project}/locations/{location}/triggers/{trigger}` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Required. ID of the project. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. ID of the trigger. 
 */ 
  
 // const triggerId = 'abc123' 
  
 /** 
 *  Source to build against this trigger. 
 *  Branch and tag names cannot consist of regular expressions. 
 */ 
  
 // const source = {} 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callRunBuildTrigger 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 triggerId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 runBuildTrigger 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callRunBuildTrigger 
 (); 
 

checkUpdateWorkerPoolProgress(name)

  checkUpdateWorkerPoolProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 WorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 UpdateWorkerPoolOperationMetadata 
>> ; 
 

Check the status of the long running operation returned by updateWorkerPool() .

Parameter
Name
Description
name
string

The operation name that will be passed.

Returns
Type
Description

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The `WorkerPool` to update. 
 *  The `name` field is used to identify the `WorkerPool` to update. 
 *  Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. 
 */ 
  
 // const workerPool = {} 
  
 /** 
 *  A mask specifying which fields in `worker_pool` to update. 
 */ 
  
 // const updateMask = {} 
  
 /** 
 *  If set, validate the request and preview the response, but do not actually 
 *  post it. 
 */ 
  
 // const validateOnly = true 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateWorkerPool 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 workerPool 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 updateWorkerPool 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateWorkerPool 
 (); 
 

close()

  close 
 () 
 : 
  
 Promise<void> 
 ; 
 

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type
Description
Promise <void>

{Promise} A promise that resolves when the client is closed.

createBuild(request, options)

  createBuild 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateBuildRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Starts a build with the specified configuration.

This method returns a long-running Operation , which includes the build ID. Pass the build ID to GetBuild to determine the build status (such as SUCCESS or FAILURE ).

Parameters
Name
Description
request
ICreateBuildRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The parent resource where this build will be created. 
 *  Format: `projects/{project}/locations/{location}` 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. ID of the project. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. Build resource to create. 
 */ 
  
 // const build = {} 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateBuild 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 build 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 createBuild 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateBuild 
 (); 
 

createBuild(request, options, callback)

  createBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateBuildRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

createBuild(request, callback)

  createBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateBuildRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

createBuildTrigger(request, options)

  createBuildTrigger 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateBuildTriggerRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 , 
  
 ( 
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateBuildTriggerRequest 
  
 | 
  
 undefined 
 ), 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Creates a new BuildTrigger .

This API is experimental.

Parameters
Name
Description
request
ICreateBuildTriggerRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing BuildTrigger . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The parent resource where this trigger will be created. 
 *  Format: `projects/{project}/locations/{location}` 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. ID of the project for which to configure automatic builds. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. `BuildTrigger` to create. 
 */ 
  
 // const trigger = {} 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateBuildTrigger 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 trigger 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 createBuildTrigger 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateBuildTrigger 
 (); 
 

createBuildTrigger(request, options, callback)

  createBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateBuildTriggerRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateBuildTriggerRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

createBuildTrigger(request, callback)

  createBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateBuildTriggerRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateBuildTriggerRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

createWorkerPool(request, options)

  createWorkerPool 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateWorkerPoolRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateWorkerPoolOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Creates a WorkerPool .

Parameters
Name
Description
request
ICreateWorkerPoolRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The parent resource where this worker pool will be created. 
 *  Format: `projects/{project}/locations/{location}`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. `WorkerPool` resource to create. 
 */ 
  
 // const workerPool = {} 
  
 /** 
 *  Required. Immutable. The ID to use for the `WorkerPool`, which will become 
 *  the final component of the resource name. 
 *  This value should be 1-63 characters, and valid characters 
 *  are /[a-z][0-9]-/. 
 */ 
  
 // const workerPoolId = 'abc123' 
  
 /** 
 *  If set, validate the request and preview the response, but do not actually 
 *  post it. 
 */ 
  
 // const validateOnly = true 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateWorkerPool 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 workerPool 
 , 
  
 workerPoolId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 createWorkerPool 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateWorkerPool 
 (); 
 

createWorkerPool(request, options, callback)

  createWorkerPool 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateWorkerPoolRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateWorkerPoolOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

createWorkerPool(request, callback)

  createWorkerPool 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateWorkerPoolRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 ICreateWorkerPoolOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

cryptoKeyPath(project, location, keyring, key)

  cryptoKeyPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 keyring 
 : 
  
 string 
 , 
  
 key 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified cryptoKey resource name string.

Parameters
Name
Description
project
string
location
string
keyring
string
key
string
Returns
Type
Description
string

{string} Resource name string.

deleteBuildTrigger(request, options)

  deleteBuildTrigger 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteBuildTriggerRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 ( 
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteBuildTriggerRequest 
  
 | 
  
 undefined 
 ), 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
Name
Description
request
IDeleteBuildTriggerRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The name of the `Trigger` to delete. 
 *  Format: `projects/{project}/locations/{location}/triggers/{trigger}` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Required. ID of the project that owns the trigger. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. ID of the `BuildTrigger` to delete. 
 */ 
  
 // const triggerId = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteBuildTrigger 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 triggerId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 deleteBuildTrigger 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callDeleteBuildTrigger 
 (); 
 

deleteBuildTrigger(request, options, callback)

  deleteBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteBuildTriggerRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteBuildTriggerRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

deleteBuildTrigger(request, callback)

  deleteBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteBuildTriggerRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteBuildTriggerRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

deleteWorkerPool(request, options)

  deleteWorkerPool 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteWorkerPoolRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteWorkerPoolOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Deletes a WorkerPool .

Parameters
Name
Description
request
IDeleteWorkerPoolRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the `WorkerPool` to delete. 
 *  Format: 
 *  `projects/{project}/locations/{location}/workerPools/{workerPool}`. 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Optional. If provided, it must match the server's etag on the workerpool 
 *  for the request to be processed. 
 */ 
  
 // const etag = 'abc123' 
  
 /** 
 *  If set to true, and the `WorkerPool` is not found, the request will succeed 
 *  but no action will be taken on the server. 
 */ 
  
 // const allowMissing = true 
  
 /** 
 *  If set, validate the request and preview the response, but do not actually 
 *  post it. 
 */ 
  
 // const validateOnly = true 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteWorkerPool 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 deleteWorkerPool 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callDeleteWorkerPool 
 (); 
 

deleteWorkerPool(request, options, callback)

  deleteWorkerPool 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteWorkerPoolRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteWorkerPoolOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

deleteWorkerPool(request, callback)

  deleteWorkerPool 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteWorkerPoolRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IDeleteWorkerPoolOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

getBuild(request, options)

  getBuild 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Returns information about a previously requested build.

The Build that is returned includes its status (such as SUCCESS , FAILURE , or WORKING ), and timing information.

Parameters
Name
Description
request
IGetBuildRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The name of the `Build` to retrieve. 
 *  Format: `projects/{project}/locations/{location}/builds/{build}` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Required. ID of the project. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. ID of the build. 
 */ 
  
 // const id = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callGetBuild 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 id 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 getBuild 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetBuild 
 (); 
 

getBuild(request, options, callback)

  getBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

getBuild(request, callback)

  getBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

getBuildTrigger(request, options)

  getBuildTrigger 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildTriggerRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildTriggerRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Returns information about a BuildTrigger .

This API is experimental.

Parameters
Name
Description
request
IGetBuildTriggerRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing BuildTrigger . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The name of the `Trigger` to retrieve. 
 *  Format: `projects/{project}/locations/{location}/triggers/{trigger}` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Required. ID of the project that owns the trigger. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. 
 */ 
  
 // const triggerId = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callGetBuildTrigger 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 triggerId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 getBuildTrigger 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetBuildTrigger 
 (); 
 

getBuildTrigger(request, options, callback)

  getBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildTriggerRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildTriggerRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

getBuildTrigger(request, callback)

  getBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildTriggerRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetBuildTriggerRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

getProjectId()

  getProjectId 
 () 
 : 
  
 Promise<string> 
 ; 
 
Returns
Type
Description
Promise <string>

getProjectId(callback)

  getProjectId 
 ( 
 callback 
 : 
  
 Callback<string 
 , 
  
 undefined 
 , 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameter
Name
Description
callback
Callback <string, undefined, undefined>
Returns
Type
Description
void

getWorkerPool(request, options)

  getWorkerPool 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetWorkerPoolRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetWorkerPoolRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Returns details of a WorkerPool .

Parameters
Name
Description
request
IGetWorkerPoolRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the `WorkerPool` to retrieve. 
 *  Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callGetWorkerPool 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 getWorkerPool 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetWorkerPool 
 (); 
 

getWorkerPool(request, options, callback)

  getWorkerPool 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetWorkerPoolRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetWorkerPoolRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

getWorkerPool(request, callback)

  getWorkerPool 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetWorkerPoolRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IGetWorkerPoolRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

initialize()

  initialize 
 () 
 : 
  
 Promise 
< { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }>; 
 

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
Type
Description
Promise <{ [name: string]: Function ; }>

{Promise} A promise that resolves to an authenticated service stub.

listBuilds(request, options)

  listBuilds 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 [], 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsRequest 
  
 | 
  
 null 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsResponse 
  
 ]>; 
 

Lists previously requested builds.

Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully.

Parameters
Name
Description
request
IListBuildsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listBuildsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listBuilds(request, options, callback)

  listBuilds 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsRequest 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

listBuilds(request, callback)

  listBuilds 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsRequest 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsRequest 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listBuildsAsync(request, options)

  listBuildsAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
> ; 
 

Equivalent to listBuilds , but returns an iterable object.

for - await - of syntax is used with the iterable to get response elements on-demand.

Parameters
Name
Description
request
IListBuildsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The parent of the collection of `Builds`. 
 *  Format: `projects/{project}/locations/{location}` 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. ID of the project. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Number of results to return in the list. 
 */ 
  
 // const pageSize = 1234 
  
 /** 
 *  The page token for the next page of Builds. 
 *  If unspecified, the first page of results is returned. 
 *  If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. 
 *  In this case, the token should be discarded, and pagination should be 
 *  restarted from the first page of results. 
 *  See https://google.aip.dev/158 for more. 
 */ 
  
 // const pageToken = 'abc123' 
  
 /** 
 *  The raw filter text to constrain the results. 
 */ 
  
 // const filter = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callListBuilds 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 iterable 
  
 = 
  
 cloudbuildClient 
 . 
  listBuildsAsync 
 
 ( 
 request 
 ); 
  
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 } 
  
 callListBuilds 
 (); 
 

listBuildsStream(request, options)

  listBuildsStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

Equivalent to listBuilds , but returns a NodeJS Stream object.

Parameters
Name
Description
request
IListBuildsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listBuildsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listBuildTriggers(request, options)

  listBuildTriggers 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 [], 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersRequest 
  
 | 
  
 null 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersResponse 
  
 ]>; 
 

Lists existing BuildTrigger s.

This API is experimental.

Parameters
Name
Description
request
IListBuildTriggersRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is Array of BuildTrigger . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listBuildTriggersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listBuildTriggers(request, options, callback)

  listBuildTriggers 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersRequest 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listBuildTriggers(request, callback)

  listBuildTriggers 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersRequest 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersRequest 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listBuildTriggersAsync(request, options)

  listBuildTriggersAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
> ; 
 

Equivalent to listBuildTriggers , but returns an iterable object.

for - await - of syntax is used with the iterable to get response elements on-demand.

Parameters
Name
Description
request
IListBuildTriggersRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing BuildTrigger . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The parent of the collection of `Triggers`. 
 *  Format: `projects/{project}/locations/{location}` 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. ID of the project for which to list BuildTriggers. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Number of results to return in the list. 
 */ 
  
 // const pageSize = 1234 
  
 /** 
 *  Token to provide to skip to a particular spot in the list. 
 */ 
  
 // const pageToken = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callListBuildTriggers 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 iterable 
  
 = 
  
 cloudbuildClient 
 . 
  listBuildTriggersAsync 
 
 ( 
 request 
 ); 
  
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 } 
  
 callListBuildTriggers 
 (); 
 

listBuildTriggersStream(request, options)

  listBuildTriggersStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListBuildTriggersRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

Equivalent to listBuildTriggers , but returns a NodeJS Stream object.

Parameters
Name
Description
request
IListBuildTriggersRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Transform

{Stream} An object stream which emits an object representing BuildTrigger on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listBuildTriggersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listWorkerPools(request, options)

  listWorkerPools 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 [], 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsRequest 
  
 | 
  
 null 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsResponse 
  
 ]>; 
 

Lists WorkerPool s.

Parameters
Name
Description
request
IListWorkerPoolsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listWorkerPoolsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listWorkerPools(request, options, callback)

  listWorkerPools 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsRequest 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listWorkerPools(request, callback)

  listWorkerPools 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsRequest 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsRequest 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listWorkerPoolsAsync(request, options)

  listWorkerPoolsAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
> ; 
 

Equivalent to listWorkerPools , but returns an iterable object.

for - await - of syntax is used with the iterable to get response elements on-demand.

Parameters
Name
Description
request
IListWorkerPoolsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The parent of the collection of `WorkerPools`. 
 *  Format: `projects/{project}/locations/{location}`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  The maximum number of `WorkerPool`s to return. The service may return 
 *  fewer than this value. If omitted, the server will use a sensible default. 
 */ 
  
 // const pageSize = 1234 
  
 /** 
 *  A page token, received from a previous `ListWorkerPools` call. Provide this 
 *  to retrieve the subsequent page. 
 */ 
  
 // const pageToken = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callListWorkerPools 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 iterable 
  
 = 
  
 cloudbuildClient 
 . 
  listWorkerPoolsAsync 
 
 ( 
 request 
 ); 
  
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 } 
  
 callListWorkerPools 
 (); 
 

listWorkerPoolsStream(request, options)

  listWorkerPoolsStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IListWorkerPoolsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

Equivalent to listWorkerPools , but returns a NodeJS Stream object.

Parameters
Name
Description
request
IListWorkerPoolsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listWorkerPoolsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

locationPath(project, location)

  locationPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified location resource name string.

Parameters
Name
Description
project
string
location
string
Returns
Type
Description
string

{string} Resource name string.

matchBuildFromProjectBuildName(projectBuildName)

  matchBuildFromProjectBuildName 
 ( 
 projectBuildName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the build from ProjectBuild resource.

Parameter
Name
Description
projectBuildName
string

A fully-qualified path representing project_build resource.

Returns
Type
Description
string | number

{string} A string representing the build.

matchBuildFromProjectLocationBuildName(projectLocationBuildName)

  matchBuildFromProjectLocationBuildName 
 ( 
 projectLocationBuildName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the build from ProjectLocationBuild resource.

Parameter
Name
Description
projectLocationBuildName
string

A fully-qualified path representing project_location_build resource.

Returns
Type
Description
string | number

{string} A string representing the build.

matchConfigFromProjectConfigName(projectConfigName)

  matchConfigFromProjectConfigName 
 ( 
 projectConfigName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the config from ProjectConfig resource.

Parameter
Name
Description
projectConfigName
string

A fully-qualified path representing project_config resource.

Returns
Type
Description
string | number

{string} A string representing the config.

matchConfigFromProjectLocationConfigName(projectLocationConfigName)

  matchConfigFromProjectLocationConfigName 
 ( 
 projectLocationConfigName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the config from ProjectLocationConfig resource.

Parameter
Name
Description
projectLocationConfigName
string

A fully-qualified path representing project_location_config resource.

Returns
Type
Description
string | number

{string} A string representing the config.

matchConnectionFromRepositoryName(repositoryName)

  matchConnectionFromRepositoryName 
 ( 
 repositoryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the connection from Repository resource.

Parameter
Name
Description
repositoryName
string

A fully-qualified path representing Repository resource.

Returns
Type
Description
string | number

{string} A string representing the connection.

matchKeyFromCryptoKeyName(cryptoKeyName)

  matchKeyFromCryptoKeyName 
 ( 
 cryptoKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the key from CryptoKey resource.

Parameter
Name
Description
cryptoKeyName
string

A fully-qualified path representing CryptoKey resource.

Returns
Type
Description
string | number

{string} A string representing the key.

matchKeyringFromCryptoKeyName(cryptoKeyName)

  matchKeyringFromCryptoKeyName 
 ( 
 cryptoKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the keyring from CryptoKey resource.

Parameter
Name
Description
cryptoKeyName
string

A fully-qualified path representing CryptoKey resource.

Returns
Type
Description
string | number

{string} A string representing the keyring.

matchLocationFromCryptoKeyName(cryptoKeyName)

  matchLocationFromCryptoKeyName 
 ( 
 cryptoKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from CryptoKey resource.

Parameter
Name
Description
cryptoKeyName
string

A fully-qualified path representing CryptoKey resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

  matchLocationFromLocationName 
 ( 
 locationName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Location resource.

Parameter
Name
Description
locationName
string

A fully-qualified path representing Location resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromProjectLocationBuildName(projectLocationBuildName)

  matchLocationFromProjectLocationBuildName 
 ( 
 projectLocationBuildName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from ProjectLocationBuild resource.

Parameter
Name
Description
projectLocationBuildName
string

A fully-qualified path representing project_location_build resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromProjectLocationConfigName(projectLocationConfigName)

  matchLocationFromProjectLocationConfigName 
 ( 
 projectLocationConfigName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from ProjectLocationConfig resource.

Parameter
Name
Description
projectLocationConfigName
string

A fully-qualified path representing project_location_config resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromProjectLocationTriggerName(projectLocationTriggerName)

  matchLocationFromProjectLocationTriggerName 
 ( 
 projectLocationTriggerName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from ProjectLocationTrigger resource.

Parameter
Name
Description
projectLocationTriggerName
string

A fully-qualified path representing project_location_trigger resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromRepositoryName(repositoryName)

  matchLocationFromRepositoryName 
 ( 
 repositoryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Repository resource.

Parameter
Name
Description
repositoryName
string

A fully-qualified path representing Repository resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromWorkerPoolName(workerPoolName)

  matchLocationFromWorkerPoolName 
 ( 
 workerPoolName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from WorkerPool resource.

Parameter
Name
Description
workerPoolName
string

A fully-qualified path representing WorkerPool resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchNetworkFromNetworkName(networkName)

  matchNetworkFromNetworkName 
 ( 
 networkName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the network from Network resource.

Parameter
Name
Description
networkName
string

A fully-qualified path representing Network resource.

Returns
Type
Description
string | number

{string} A string representing the network.

matchProjectFromCryptoKeyName(cryptoKeyName)

  matchProjectFromCryptoKeyName 
 ( 
 cryptoKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from CryptoKey resource.

Parameter
Name
Description
cryptoKeyName
string

A fully-qualified path representing CryptoKey resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

  matchProjectFromLocationName 
 ( 
 locationName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Location resource.

Parameter
Name
Description
locationName
string

A fully-qualified path representing Location resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromNetworkName(networkName)

  matchProjectFromNetworkName 
 ( 
 networkName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Network resource.

Parameter
Name
Description
networkName
string

A fully-qualified path representing Network resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromProjectBuildName(projectBuildName)

  matchProjectFromProjectBuildName 
 ( 
 projectBuildName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from ProjectBuild resource.

Parameter
Name
Description
projectBuildName
string

A fully-qualified path representing project_build resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromProjectConfigName(projectConfigName)

  matchProjectFromProjectConfigName 
 ( 
 projectConfigName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from ProjectConfig resource.

Parameter
Name
Description
projectConfigName
string

A fully-qualified path representing project_config resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromProjectLocationBuildName(projectLocationBuildName)

  matchProjectFromProjectLocationBuildName 
 ( 
 projectLocationBuildName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from ProjectLocationBuild resource.

Parameter
Name
Description
projectLocationBuildName
string

A fully-qualified path representing project_location_build resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromProjectLocationConfigName(projectLocationConfigName)

  matchProjectFromProjectLocationConfigName 
 ( 
 projectLocationConfigName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from ProjectLocationConfig resource.

Parameter
Name
Description
projectLocationConfigName
string

A fully-qualified path representing project_location_config resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromProjectLocationTriggerName(projectLocationTriggerName)

  matchProjectFromProjectLocationTriggerName 
 ( 
 projectLocationTriggerName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from ProjectLocationTrigger resource.

Parameter
Name
Description
projectLocationTriggerName
string

A fully-qualified path representing project_location_trigger resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

  matchProjectFromProjectName 
 ( 
 projectName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Project resource.

Parameter
Name
Description
projectName
string

A fully-qualified path representing Project resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromProjectTriggerName(projectTriggerName)

  matchProjectFromProjectTriggerName 
 ( 
 projectTriggerName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from ProjectTrigger resource.

Parameter
Name
Description
projectTriggerName
string

A fully-qualified path representing project_trigger resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromRepositoryName(repositoryName)

  matchProjectFromRepositoryName 
 ( 
 repositoryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Repository resource.

Parameter
Name
Description
repositoryName
string

A fully-qualified path representing Repository resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromSecretVersionName(secretVersionName)

  matchProjectFromSecretVersionName 
 ( 
 secretVersionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from SecretVersion resource.

Parameter
Name
Description
secretVersionName
string

A fully-qualified path representing SecretVersion resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromServiceAccountName(serviceAccountName)

  matchProjectFromServiceAccountName 
 ( 
 serviceAccountName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from ServiceAccount resource.

Parameter
Name
Description
serviceAccountName
string

A fully-qualified path representing ServiceAccount resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromSubscriptionName(subscriptionName)

  matchProjectFromSubscriptionName 
 ( 
 subscriptionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Subscription resource.

Parameter
Name
Description
subscriptionName
string

A fully-qualified path representing Subscription resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromTopicName(topicName)

  matchProjectFromTopicName 
 ( 
 topicName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Topic resource.

Parameter
Name
Description
topicName
string

A fully-qualified path representing Topic resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromWorkerPoolName(workerPoolName)

  matchProjectFromWorkerPoolName 
 ( 
 workerPoolName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from WorkerPool resource.

Parameter
Name
Description
workerPoolName
string

A fully-qualified path representing WorkerPool resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchRepositoryFromRepositoryName(repositoryName)

  matchRepositoryFromRepositoryName 
 ( 
 repositoryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the repository from Repository resource.

Parameter
Name
Description
repositoryName
string

A fully-qualified path representing Repository resource.

Returns
Type
Description
string | number

{string} A string representing the repository.

matchSecretFromSecretVersionName(secretVersionName)

  matchSecretFromSecretVersionName 
 ( 
 secretVersionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the secret from SecretVersion resource.

Parameter
Name
Description
secretVersionName
string

A fully-qualified path representing SecretVersion resource.

Returns
Type
Description
string | number

{string} A string representing the secret.

matchServiceAccountFromServiceAccountName(serviceAccountName)

  matchServiceAccountFromServiceAccountName 
 ( 
 serviceAccountName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the service_account from ServiceAccount resource.

Parameter
Name
Description
serviceAccountName
string

A fully-qualified path representing ServiceAccount resource.

Returns
Type
Description
string | number

{string} A string representing the service_account.

matchSubscriptionFromSubscriptionName(subscriptionName)

  matchSubscriptionFromSubscriptionName 
 ( 
 subscriptionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the subscription from Subscription resource.

Parameter
Name
Description
subscriptionName
string

A fully-qualified path representing Subscription resource.

Returns
Type
Description
string | number

{string} A string representing the subscription.

matchTopicFromTopicName(topicName)

  matchTopicFromTopicName 
 ( 
 topicName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the topic from Topic resource.

Parameter
Name
Description
topicName
string

A fully-qualified path representing Topic resource.

Returns
Type
Description
string | number

{string} A string representing the topic.

matchTriggerFromProjectLocationTriggerName(projectLocationTriggerName)

  matchTriggerFromProjectLocationTriggerName 
 ( 
 projectLocationTriggerName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the trigger from ProjectLocationTrigger resource.

Parameter
Name
Description
projectLocationTriggerName
string

A fully-qualified path representing project_location_trigger resource.

Returns
Type
Description
string | number

{string} A string representing the trigger.

matchTriggerFromProjectTriggerName(projectTriggerName)

  matchTriggerFromProjectTriggerName 
 ( 
 projectTriggerName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the trigger from ProjectTrigger resource.

Parameter
Name
Description
projectTriggerName
string

A fully-qualified path representing project_trigger resource.

Returns
Type
Description
string | number

{string} A string representing the trigger.

matchVersionFromSecretVersionName(secretVersionName)

  matchVersionFromSecretVersionName 
 ( 
 secretVersionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the version from SecretVersion resource.

Parameter
Name
Description
secretVersionName
string

A fully-qualified path representing SecretVersion resource.

Returns
Type
Description
string | number

{string} A string representing the version.

matchWorkerPoolFromWorkerPoolName(workerPoolName)

  matchWorkerPoolFromWorkerPoolName 
 ( 
 workerPoolName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the worker_pool from WorkerPool resource.

Parameter
Name
Description
workerPoolName
string

A fully-qualified path representing WorkerPool resource.

Returns
Type
Description
string | number

{string} A string representing the worker_pool.

networkPath(project, network)

  networkPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 network 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified network resource name string.

Parameters
Name
Description
project
string
network
string
Returns
Type
Description
string

{string} Resource name string.

projectBuildPath(project, build)

  projectBuildPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 build 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified projectBuild resource name string.

Parameters
Name
Description
project
string
build
string
Returns
Type
Description
string

{string} Resource name string.

projectConfigPath(project, config)

  projectConfigPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 config 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified projectConfig resource name string.

Parameters
Name
Description
project
string
config
string
Returns
Type
Description
string

{string} Resource name string.

projectLocationBuildPath(project, location, build)

  projectLocationBuildPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 build 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified projectLocationBuild resource name string.

Parameters
Name
Description
project
string
location
string
build
string
Returns
Type
Description
string

{string} Resource name string.

projectLocationConfigPath(project, location, config)

  projectLocationConfigPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 config 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified projectLocationConfig resource name string.

Parameters
Name
Description
project
string
location
string
config
string
Returns
Type
Description
string

{string} Resource name string.

projectLocationTriggerPath(project, location, trigger)

  projectLocationTriggerPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 trigger 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified projectLocationTrigger resource name string.

Parameters
Name
Description
project
string
location
string
trigger
string
Returns
Type
Description
string

{string} Resource name string.

projectPath(project)

  projectPath 
 ( 
 project 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified project resource name string.

Parameter
Name
Description
project
string
Returns
Type
Description
string

{string} Resource name string.

projectTriggerPath(project, trigger)

  projectTriggerPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 trigger 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified projectTrigger resource name string.

Parameters
Name
Description
project
string
trigger
string
Returns
Type
Description
string

{string} Resource name string.

receiveTriggerWebhook(request, options)

  receiveTriggerWebhook 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IReceiveTriggerWebhookRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IReceiveTriggerWebhookResponse 
 , 
  
 ( 
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IReceiveTriggerWebhookRequest 
  
 | 
  
 undefined 
 ), 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

ReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger.

Parameters
Name
Description
request
IReceiveTriggerWebhookRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ReceiveTriggerWebhookResponse . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The name of the `ReceiveTriggerWebhook` to retrieve. 
 *  Format: `projects/{project}/locations/{location}/triggers/{trigger}` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  HTTP request body. 
 */ 
  
 // const body = {} 
  
 /** 
 *  Project in which the specified trigger lives 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Name of the trigger to run the payload against 
 */ 
  
 // const trigger = 'abc123' 
  
 /** 
 *  Secret token used for authorization if an OAuth token isn't provided. 
 */ 
  
 // const secret = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callReceiveTriggerWebhook 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 receiveTriggerWebhook 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callReceiveTriggerWebhook 
 (); 
 

receiveTriggerWebhook(request, options, callback)

  receiveTriggerWebhook 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IReceiveTriggerWebhookRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IReceiveTriggerWebhookResponse 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IReceiveTriggerWebhookRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

receiveTriggerWebhook(request, callback)

  receiveTriggerWebhook 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IReceiveTriggerWebhookRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IReceiveTriggerWebhookResponse 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IReceiveTriggerWebhookRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

repositoryPath(project, location, connection, repository)

  repositoryPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 connection 
 : 
  
 string 
 , 
  
 repository 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified repository resource name string.

Parameters
Name
Description
project
string
location
string
connection
string
repository
string
Returns
Type
Description
string

{string} Resource name string.

retryBuild(request, options)

  retryBuild 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IRetryBuildRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Creates a new build based on the specified build.

This method creates a new build using the original build request, which may or may not result in an identical build.

For triggered builds:

* Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision.

For non-triggered builds that specify RepoSource :

* If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build. * If the original build specified a commit sha or revision ID, the retried build will use the identical source.

For builds that specify StorageSource :

* If the original build pulled source from Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source. * If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings.

Parameters
Name
Description
request
IRetryBuildRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The name of the `Build` to retry. 
 *  Format: `projects/{project}/locations/{location}/builds/{build}` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Required. ID of the project. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. Build ID of the original build. 
 */ 
  
 // const id = 'abc123' 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callRetryBuild 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 id 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 retryBuild 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callRetryBuild 
 (); 
 

retryBuild(request, options, callback)

  retryBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IRetryBuildRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

retryBuild(request, callback)

  retryBuild 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IRetryBuildRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

runBuildTrigger(request, options)

  runBuildTrigger 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IRunBuildTriggerRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Runs a BuildTrigger at a particular source revision.

To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.

Parameters
Name
Description
request
IRunBuildTriggerRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  The name of the `Trigger` to run. 
 *  Format: `projects/{project}/locations/{location}/triggers/{trigger}` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Required. ID of the project. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. ID of the trigger. 
 */ 
  
 // const triggerId = 'abc123' 
  
 /** 
 *  Source to build against this trigger. 
 *  Branch and tag names cannot consist of regular expressions. 
 */ 
  
 // const source = {} 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callRunBuildTrigger 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 triggerId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 runBuildTrigger 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callRunBuildTrigger 
 (); 
 

runBuildTrigger(request, options, callback)

  runBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IRunBuildTriggerRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

runBuildTrigger(request, callback)

  runBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IRunBuildTriggerRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuild 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

secretVersionPath(project, secret, version)

  secretVersionPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 secret 
 : 
  
 string 
 , 
  
 version 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified secretVersion resource name string.

Parameters
Name
Description
project
string
secret
string
version
string
Returns
Type
Description
string

{string} Resource name string.

serviceAccountPath(project, serviceAccount)

  serviceAccountPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 serviceAccount 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified serviceAccount resource name string.

Parameters
Name
Description
project
string
serviceAccount
string
Returns
Type
Description
string

{string} Resource name string.

subscriptionPath(project, subscription)

  subscriptionPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 subscription 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified subscription resource name string.

Parameters
Name
Description
project
string
subscription
string
Returns
Type
Description
string

{string} Resource name string.

topicPath(project, topic)

  topicPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 topic 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified topic resource name string.

Parameters
Name
Description
project
string
topic
string
Returns
Type
Description
string

{string} Resource name string.

updateBuildTrigger(request, options)

  updateBuildTrigger 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateBuildTriggerRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 , 
  
 ( 
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateBuildTriggerRequest 
  
 | 
  
 undefined 
 ), 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Updates a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
Name
Description
request
IUpdateBuildTriggerRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing BuildTrigger . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. ID of the project that owns the trigger. 
 */ 
  
 // const projectId = 'abc123' 
  
 /** 
 *  Required. ID of the `BuildTrigger` to update. 
 */ 
  
 // const triggerId = 'abc123' 
  
 /** 
 *  Required. `BuildTrigger` to update. 
 */ 
  
 // const trigger = {} 
  
 /** 
 *  Update mask for the resource. If this is set, 
 *  the server will only update the fields specified in the field mask. 
 *  Otherwise, a full update of the mutable resource fields will be performed. 
 */ 
  
 // const updateMask = {} 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateBuildTrigger 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 projectId 
 , 
  
 triggerId 
 , 
  
 trigger 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 updateBuildTrigger 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateBuildTrigger 
 (); 
 

updateBuildTrigger(request, options, callback)

  updateBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateBuildTriggerRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateBuildTriggerRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

updateBuildTrigger(request, callback)

  updateBuildTrigger 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateBuildTriggerRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IBuildTrigger 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateBuildTriggerRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

updateWorkerPool(request, options)

  updateWorkerPool 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateWorkerPoolRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateWorkerPoolOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Updates a WorkerPool .

Parameters
Name
Description
request
IUpdateWorkerPoolRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The `WorkerPool` to update. 
 *  The `name` field is used to identify the `WorkerPool` to update. 
 *  Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. 
 */ 
  
 // const workerPool = {} 
  
 /** 
 *  A mask specifying which fields in `worker_pool` to update. 
 */ 
  
 // const updateMask = {} 
  
 /** 
 *  If set, validate the request and preview the response, but do not actually 
 *  post it. 
 */ 
  
 // const validateOnly = true 
  
 // Imports the Cloudbuild library 
  
 const 
  
 { 
 CloudBuildClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/cloudbuild 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cloudbuildClient 
  
 = 
  
 new 
  
  CloudBuildClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateWorkerPool 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 workerPool 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 cloudbuildClient 
 . 
 updateWorkerPool 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateWorkerPool 
 (); 
 

updateWorkerPool(request, options, callback)

  updateWorkerPool 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateWorkerPoolRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateWorkerPoolOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

updateWorkerPool(request, callback)

  updateWorkerPool 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateWorkerPoolRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IWorkerPool 
 , 
  
 protos 
 . 
 google 
 . 
 devtools 
 . 
 cloudbuild 
 . 
 v1 
 . 
 IUpdateWorkerPoolOperationMetadata 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

workerPoolPath(project, location, workerPool)

  workerPoolPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 workerPool 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified workerPool resource name string.

Parameters
Name
Description
project
string
location
string
workerPool
string
Returns
Type
Description
string

{string} Resource name string.

Create a Mobile Website
View Site in Mobile | Classic
Share by: