Class v2.ServicesClient (0.2.3)

Cloud Run Service Control Plane API v2

Package

@google-cloud/run

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of ServicesClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof gax.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 ServicesClient({fallback: 'rest'}, gax); ```

Properties

apiEndpoint

  static 
  
 get 
  
 apiEndpoint 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

  auth 
 : 
  
 gax 
 . 
 GoogleAuth 
 ; 
 

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.

servicesStub

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

warn

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

Methods

checkCreateServiceProgress(name)

  checkCreateServiceProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 Service 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 Service 
>> ; 
 

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise < LROperation <protos. google.cloud.run.v2.Service , protos. google.cloud.run.v2.Service >>

{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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 location and project in which this service should be created. 
 *  Format: projects/{projectnumber}/locations/{location} 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. The Service instance to create. 
 */ 
  
 // const service = {} 
  
 /** 
 *  Required. The unique identifier for the Service. The name of the service becomes 
 *  {parent}/services/{service_id}. 
 */ 
  
 // const serviceId = 'abc123' 
  
 /** 
 *  Indicates that the request should be validated and default values 
 *  populated, without persisting the request or creating any resources. 
 */ 
  
 // const validateOnly = true 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateService 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 service 
 , 
  
 serviceId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 runClient 
 . 
 createService 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateService 
 (); 
 

checkDeleteServiceProgress(name)

  checkDeleteServiceProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 Service 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 Service 
>> ; 
 

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise < LROperation <protos. google.cloud.run.v2.Service , protos. google.cloud.run.v2.Service >>

{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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 full name of the Service. 
 *  Format: projects/{projectnumber}/locations/{location}/services/{service} 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Indicates that the request should be validated without actually 
 *  deleting any resources. 
 */ 
  
 // const validateOnly = true 
  
 /** 
 *  A system-generated fingerprint for this version of the 
 *  resource. May be used to detect modification conflict during updates. 
 */ 
  
 // const etag = 'abc123' 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteService 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 runClient 
 . 
 deleteService 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callDeleteService 
 (); 
 

checkUpdateServiceProgress(name)

  checkUpdateServiceProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 Service 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 Service 
>> ; 
 

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise < LROperation <protos. google.cloud.run.v2.Service , protos. google.cloud.run.v2.Service >>

{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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 Service to be updated. 
 */ 
  
 // const service = {} 
  
 /** 
 *  Indicates that the request should be validated and default values 
 *  populated, without persisting the request or updating any resources. 
 */ 
  
 // const validateOnly = true 
  
 /** 
 *  If set to true, and if the Service does not exist, it will create a new 
 *  one. Caller must have both create and update permissions for this call if 
 *  this is set to true. 
 */ 
  
 // const allowMissing = true 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateService 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 service 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 runClient 
 . 
 updateService 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateService 
 (); 
 

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.

createService(request, options)

  createService 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 ICreateServiceRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Creates a new Service in a given project and location.

Parameters
Name Description
request protos. google.cloud.run.v2.ICreateServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise <[ LROperation <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IService >, protos. google.longrunning.IOperation | undefined, {} | undefined ]>

{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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 location and project in which this service should be created. 
 *  Format: projects/{projectnumber}/locations/{location} 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. The Service instance to create. 
 */ 
  
 // const service = {} 
  
 /** 
 *  Required. The unique identifier for the Service. The name of the service becomes 
 *  {parent}/services/{service_id}. 
 */ 
  
 // const serviceId = 'abc123' 
  
 /** 
 *  Indicates that the request should be validated and default values 
 *  populated, without persisting the request or creating any resources. 
 */ 
  
 // const validateOnly = true 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateService 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 service 
 , 
  
 serviceId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 runClient 
 . 
 createService 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateService 
 (); 
 

createService(request, options, callback)

  createService 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 ICreateServiceRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.ICreateServiceRequest
options CallOptions
callback Callback < LROperation <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IService >, protos. google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createService(request, callback)

  createService 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 ICreateServiceRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.ICreateServiceRequest
callback Callback < LROperation <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IService >, protos. google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteService(request, options)

  deleteService 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IDeleteServiceRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
request protos. google.cloud.run.v2.IDeleteServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise <[ LROperation <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IService >, protos. google.longrunning.IOperation | undefined, {} | undefined ]>

{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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 full name of the Service. 
 *  Format: projects/{projectnumber}/locations/{location}/services/{service} 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Indicates that the request should be validated without actually 
 *  deleting any resources. 
 */ 
  
 // const validateOnly = true 
  
 /** 
 *  A system-generated fingerprint for this version of the 
 *  resource. May be used to detect modification conflict during updates. 
 */ 
  
 // const etag = 'abc123' 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteService 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 runClient 
 . 
 deleteService 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callDeleteService 
 (); 
 

deleteService(request, options, callback)

  deleteService 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IDeleteServiceRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.IDeleteServiceRequest
options CallOptions
callback Callback < LROperation <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IService >, protos. google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteService(request, callback)

  deleteService 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IDeleteServiceRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.IDeleteServiceRequest
callback Callback < LROperation <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IService >, protos. google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

getIamPolicy(request, options)

  getIamPolicy 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Get the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.

Parameters
Name Description
request protos. google.iam.v1.IGetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise <[ protos. google.iam.v1.IPolicy , protos. google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 resource for which the policy is being requested. 
 *  See the operation documentation for the appropriate value for this field. 
 */ 
  
 // const resource = 'abc123' 
  
 /** 
 *  OPTIONAL: A `GetPolicyOptions` object for specifying options to 
 *  `GetIamPolicy`. 
 */ 
  
 // const options = {} 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callGetIamPolicy 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 resource 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 runClient 
 . 
 getIamPolicy 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetIamPolicy 
 (); 
 

getIamPolicy(request, options, callback)

  getIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.iam.v1.IGetIamPolicyRequest
options CallOptions
callback Callback <protos. google.iam.v1.IPolicy , protos. google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getIamPolicy(request, callback)

  getIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.iam.v1.IGetIamPolicyRequest
callback Callback <protos. google.iam.v1.IPolicy , protos. google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
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

getService(request, options)

  getService 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IGetServiceRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IGetServiceRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Gets information about a Service.

Parameters
Name Description
request protos. google.cloud.run.v2.IGetServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise <[ protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IGetServiceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Service]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 full name of the Service. 
 *  Format: projects/{projectnumber}/locations/{location}/services/{service} 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callGetService 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 runClient 
 . 
 getService 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetService 
 (); 
 

getService(request, options, callback)

  getService 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IGetServiceRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IGetServiceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.IGetServiceRequest
options CallOptions
callback Callback <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IGetServiceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getService(request, callback)

  getService 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IGetServiceRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IGetServiceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.IGetServiceRequest
callback Callback <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IGetServiceRequest | null | undefined, {} | null | undefined>
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.

listServices(request, options)

  listServices 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 [], 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesRequest 
  
 | 
  
 null 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesResponse 
  
 ]>; 
 

List Services.

Parameters
Name Description
request protos. google.cloud.run.v2.IListServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise <[ protos. google.cloud.run.v2.IService [], protos. google.cloud.run.v2.IListServicesRequest | null, protos. google.cloud.run.v2.IListServicesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Service]. 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 listServicesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listServices(request, options, callback)

  listServices 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.IListServicesRequest
options CallOptions
callback PaginationCallback <protos. google.cloud.run.v2.IListServicesRequest , protos. google.cloud.run.v2.IListServicesResponse | null | undefined, protos. google.cloud.run.v2.IService >
Returns
Type Description
void

listServices(request, callback)

  listServices 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesRequest 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.IListServicesRequest
callback PaginationCallback <protos. google.cloud.run.v2.IListServicesRequest , protos. google.cloud.run.v2.IListServicesResponse | null | undefined, protos. google.cloud.run.v2.IService >
Returns
Type Description
void

listServicesAsync(request, options)

  listServicesAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> ; 
 

Equivalent to listServices , but returns an iterable object.

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

Parameters
Name Description
request protos. google.cloud.run.v2.IListServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable <protos. google.cloud.run.v2.IService >

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Service]. 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) 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 location and project to list resources on. 
 *  Location must be a valid GCP region, and may not be the "-" wildcard. 
 *  Format: projects/{projectnumber}/locations/{location} 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Maximum number of Services to return in this call. 
 */ 
  
 // const pageSize = 1234 
  
 /** 
 *  A page token received from a previous call to ListServices. 
 *  All other parameters must match. 
 */ 
  
 // const pageToken = 'abc123' 
  
 /** 
 *  If true, returns deleted (but unexpired) resources along with active ones. 
 */ 
  
 // const showDeleted = true 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callListServices 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 iterable 
  
 = 
  
 await 
  
 runClient 
 . 
  listServicesAsync 
 
 ( 
 request 
 ); 
  
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 } 
  
 callListServices 
 (); 
 

listServicesStream(request, options)

  listServicesStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IListServicesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

Equivalent to method.name.toCamelCase() , but returns a NodeJS Stream object.

Parameters
Name Description
request protos. google.cloud.run.v2.IListServicesRequest

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 [Service] 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 listServicesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) 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.

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.

matchLocationFromRevisionName(revisionName)

  matchLocationFromRevisionName 
 ( 
 revisionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Revision resource.

Parameter
Name Description
revisionName string

A fully-qualified path representing Revision resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromServiceName(serviceName)

  matchLocationFromServiceName 
 ( 
 serviceName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Service resource.

Parameter
Name Description
serviceName string

A fully-qualified path representing Service resource.

Returns
Type Description
string | number

{string} A string representing the location.

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.

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.

matchProjectFromRevisionName(revisionName)

  matchProjectFromRevisionName 
 ( 
 revisionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Revision resource.

Parameter
Name Description
revisionName string

A fully-qualified path representing Revision resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromServiceName(serviceName)

  matchProjectFromServiceName 
 ( 
 serviceName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Service resource.

Parameter
Name Description
serviceName string

A fully-qualified path representing Service resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchRevisionFromRevisionName(revisionName)

  matchRevisionFromRevisionName 
 ( 
 revisionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the revision from Revision resource.

Parameter
Name Description
revisionName string

A fully-qualified path representing Revision resource.

Returns
Type Description
string | number

{string} A string representing the revision.

matchServiceFromRevisionName(revisionName)

  matchServiceFromRevisionName 
 ( 
 revisionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the service from Revision resource.

Parameter
Name Description
revisionName string

A fully-qualified path representing Revision resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceFromServiceName(serviceName)

  matchServiceFromServiceName 
 ( 
 serviceName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the service from Service resource.

Parameter
Name Description
serviceName string

A fully-qualified path representing Service resource.

Returns
Type Description
string | number

{string} A string representing the service.

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.

revisionPath(project, location, service, revision)

  revisionPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 service 
 : 
  
 string 
 , 
  
 revision 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified revision resource name string.

Parameters
Name Description
project string
location string
service string
revision string
Returns
Type Description
string

{string} Resource name string.

servicePath(project, location, service)

  servicePath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 service 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified service resource name string.

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

{string} Resource name string.

setIamPolicy(request, options)

  setIamPolicy 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.

Parameters
Name Description
request protos. google.iam.v1.ISetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise <[ protos. google.iam.v1.IPolicy , protos. google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 resource for which the policy is being specified. 
 *  See the operation documentation for the appropriate value for this field. 
 */ 
  
 // const resource = 'abc123' 
  
 /** 
 *  REQUIRED: The complete policy to be applied to the `resource`. The size of 
 *  the policy is limited to a few 10s of KB. An empty policy is a 
 *  valid policy but certain Cloud Platform services (such as Projects) 
 *  might reject them. 
 */ 
  
 // const policy = {} 
  
 /** 
 *  OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only 
 *  the fields in the mask will be modified. If no mask is provided, the 
 *  following default mask is used: 
 *  `paths: "bindings, etag"` 
 */ 
  
 // const updateMask = {} 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callSetIamPolicy 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 resource 
 , 
  
 policy 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 runClient 
 . 
 setIamPolicy 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callSetIamPolicy 
 (); 
 

setIamPolicy(request, options, callback)

  setIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.iam.v1.ISetIamPolicyRequest
options CallOptions
callback Callback <protos. google.iam.v1.IPolicy , protos. google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

setIamPolicy(request, callback)

  setIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.iam.v1.ISetIamPolicyRequest
callback Callback <protos. google.iam.v1.IPolicy , protos. google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

testIamPermissions(request, options)

  testIamPermissions 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Parameters
Name Description
request protos. google.iam.v1.ITestIamPermissionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise <[ protos. google.iam.v1.ITestIamPermissionsResponse , protos. google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [TestIamPermissionsResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 resource for which the policy detail is being requested. 
 *  See the operation documentation for the appropriate value for this field. 
 */ 
  
 // const resource = 'abc123' 
  
 /** 
 *  The set of permissions to check for the `resource`. Permissions with 
 *  wildcards (such as '*' or 'storage.*') are not allowed. For more 
 *  information see 
 *  IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). 
 */ 
  
 // const permissions = 'abc123' 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callTestIamPermissions 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 resource 
 , 
  
 permissions 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 runClient 
 . 
 testIamPermissions 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callTestIamPermissions 
 (); 
 

testIamPermissions(request, options, callback)

  testIamPermissions 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.iam.v1.ITestIamPermissionsRequest
options CallOptions
callback Callback <protos. google.iam.v1.ITestIamPermissionsResponse , protos. google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

testIamPermissions(request, callback)

  testIamPermissions 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.iam.v1.ITestIamPermissionsRequest
callback Callback <protos. google.iam.v1.ITestIamPermissionsResponse , protos. google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateService(request, options)

  updateService 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IUpdateServiceRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Updates a Service.

Parameters
Name Description
request protos. google.cloud.run.v2.IUpdateServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise <[ LROperation <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IService >, protos. google.longrunning.IOperation | undefined, {} | undefined ]>

{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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 Service to be updated. 
 */ 
  
 // const service = {} 
  
 /** 
 *  Indicates that the request should be validated and default values 
 *  populated, without persisting the request or updating any resources. 
 */ 
  
 // const validateOnly = true 
  
 /** 
 *  If set to true, and if the Service does not exist, it will create a new 
 *  one. Caller must have both create and update permissions for this call if 
 *  this is set to true. 
 */ 
  
 // const allowMissing = true 
  
 // Imports the Run library 
  
 const 
  
 { 
 ServicesClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/run 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 runClient 
  
 = 
  
 new 
  
  ServicesClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateService 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 service 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 [ 
 operation 
 ] 
  
 = 
  
 await 
  
 runClient 
 . 
 updateService 
 ( 
 request 
 ); 
  
 const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 operation 
 . 
 promise 
 (); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateService 
 (); 
 

updateService(request, options, callback)

  updateService 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IUpdateServiceRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.IUpdateServiceRequest
options CallOptions
callback Callback < LROperation <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IService >, protos. google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateService(request, callback)

  updateService 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IUpdateServiceRequest 
 , 
  
 callback 
 : 
  
 Callback<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 run 
 . 
 v2 
 . 
 IService 
> , 
  
 protos 
 . 
 google 
 . 
 longrunning 
 . 
 IOperation 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name Description
request protos. google.cloud.run.v2.IUpdateServiceRequest
callback Callback < LROperation <protos. google.cloud.run.v2.IService , protos. google.cloud.run.v2.IService >, protos. google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void
Create a Mobile Website
View Site in Mobile | Classic
Share by: