Class v1.EkmServiceClient (4.5.0)

Google Cloud Key Management EKM Service

Manages external cryptographic keys and operations using those keys. Implements a REST model with the following objects: * v1

Package

@google-cloud/kms

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of EkmServiceClient.

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 EkmServiceClient({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 
 ; 
 

descriptors

  descriptors 
 : 
  
 Descriptors 
 ; 
 

ekmServiceStub

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

iamClient

  iamClient 
 : 
  
 IamClient 
 ; 
 

innerApiCalls

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

locationsClient

  locationsClient 
 : 
  
 LocationsClient 
 ; 
 

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

autokeyConfigPath(folder)

  autokeyConfigPath 
 ( 
 folder 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified autokeyConfig resource name string.

Parameter
Name
Description
folder
string
Returns
Type
Description
string

{string} Resource name string.

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.

createEkmConnection(request, options)

  createEkmConnection 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 ICreateEkmConnectionRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 ICreateEkmConnectionRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Creates a new in a given Project and Location.

Parameters
Name
Description
request
ICreateEkmConnectionRequest

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 resource name of the location associated with the 
 *  EkmConnection google.cloud.kms.v1.EkmConnection, in the format 
 *  `projects/* /locations/*`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. It must be unique within a location and match the regular 
 *  expression `[a-zA-Z0-9_-]{1,63}`. 
 */ 
  
 // const ekmConnectionId = 'abc123' 
  
 /** 
 *  Required. An EkmConnection google.cloud.kms.v1.EkmConnection  with 
 *  initial field values. 
 */ 
  
 // const ekmConnection = {} 
  
 // Imports the Kms library 
  
 const 
  
 { 
 EkmServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/kms 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 kmsClient 
  
 = 
  
 new 
  
  EkmServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateEkmConnection 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 ekmConnectionId 
 , 
  
 ekmConnection 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 kmsClient 
 . 
 createEkmConnection 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateEkmConnection 
 (); 
 

createEkmConnection(request, options, callback)

  createEkmConnection 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 ICreateEkmConnectionRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 ICreateEkmConnectionRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

createEkmConnection(request, callback)

  createEkmConnection 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 ICreateEkmConnectionRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 ICreateEkmConnectionRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

cryptoKeyPath(project, location, keyRing, cryptoKey)

  cryptoKeyPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 keyRing 
 : 
  
 string 
 , 
  
 cryptoKey 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified cryptoKey resource name string.

Parameters
Name
Description
project
string
location
string
keyRing
string
cryptoKey
string
Returns
Type
Description
string

{string} Resource name string.

cryptoKeyVersionPath(project, location, keyRing, cryptoKey, cryptoKeyVersion)

  cryptoKeyVersionPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 keyRing 
 : 
  
 string 
 , 
  
 cryptoKey 
 : 
  
 string 
 , 
  
 cryptoKeyVersion 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified cryptoKeyVersion resource name string.

Parameters
Name
Description
project
string
location
string
keyRing
string
cryptoKey
string
cryptoKeyVersion
string
Returns
Type
Description
string

{string} Resource name string.

ekmConfigPath(project, location)

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

Return a fully-qualified ekmConfig resource name string.

Parameters
Name
Description
project
string
location
string
Returns
Type
Description
string

{string} Resource name string.

ekmConnectionPath(project, location, ekmConnection)

  ekmConnectionPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 ekmConnection 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified ekmConnection resource name string.

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

{string} Resource name string.

getEkmConfig(request, options)

  getEkmConfig 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConfigRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConfig 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConfigRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Returns the EkmConfig singleton resource for a given project and location.

Parameters
Name
Description
request
IGetEkmConfigRequest

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 EkmConfig . 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 google.cloud.kms.v1.EkmConfig.name  of the 
 *  EkmConfig google.cloud.kms.v1.EkmConfig  to get. 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Kms library 
  
 const 
  
 { 
 EkmServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/kms 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 kmsClient 
  
 = 
  
 new 
  
  EkmServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callGetEkmConfig 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 kmsClient 
 . 
 getEkmConfig 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetEkmConfig 
 (); 
 

getEkmConfig(request, options, callback)

  getEkmConfig 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConfigRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConfig 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConfigRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.kms.v1.IEkmConfig , protos.google.cloud.kms.v1.IGetEkmConfigRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getEkmConfig(request, callback)

  getEkmConfig 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConfigRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConfig 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConfigRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.kms.v1.IEkmConfig , protos.google.cloud.kms.v1.IGetEkmConfigRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getEkmConnection(request, options)

  getEkmConnection 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConnectionRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConnectionRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Returns metadata for a given .

Parameters
Name
Description
request
IGetEkmConnectionRequest

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 google.cloud.kms.v1.EkmConnection.name  of the 
 *  EkmConnection google.cloud.kms.v1.EkmConnection  to get. 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Kms library 
  
 const 
  
 { 
 EkmServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/kms 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 kmsClient 
  
 = 
  
 new 
  
  EkmServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callGetEkmConnection 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 kmsClient 
 . 
 getEkmConnection 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetEkmConnection 
 (); 
 

getEkmConnection(request, options, callback)

  getEkmConnection 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConnectionRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConnectionRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

getEkmConnection(request, callback)

  getEkmConnection 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConnectionRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IGetEkmConnectionRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

getIamPolicy(request, options, callback)

  getIamPolicy 
 ( 
 request 
 : 
  
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 GetIamPolicyRequest 
 , 
  
 options 
 ?: 
  
 gax 
 . 
 CallOptions 
  
 | 
  
 Callback<IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 Policy 
 , 
  
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 GetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> , 
  
 callback 
 ?: 
  
 Callback<IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 Policy 
 , 
  
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 GetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 Promise 
< [ 
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 Policy 
 ]>; 
 

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
Name
Description
request
IamProtos.google.iam.v1.GetIamPolicyRequest

The request object that will be sent.

options
CallOptions | Callback < google.iam.v1.Policy , google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback
Callback < google.iam.v1.Policy , google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
Type
Description
Promise <[ google.iam.v1.Policy ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

getLocation(request, options, callback)

  getLocation 
 ( 
 request 
 : 
  
 LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 IGetLocationRequest 
 , 
  
 options 
 ?: 
  
 gax 
 . 
 CallOptions 
  
 | 
  
 Callback<LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 ILocation 
 , 
  
 LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 IGetLocationRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> , 
  
 callback 
 ?: 
  
 Callback<LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 ILocation 
 , 
  
 LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 IGetLocationRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 Promise<LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 ILocation 
> ; 
 

Gets information about a location.

Parameters
Name
Description
request
LocationProtos.google.cloud.location.IGetLocationRequest

The request object that will be sent.

options
CallOptions | Callback < google.cloud.location.ILocation , google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>

Call options. See CallOptions for more details.

callback
Callback < google.cloud.location.ILocation , google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
Promise < google.cloud.location.ILocation >

{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
  const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 client 
 . 
 getLocation 
 ( 
 request 
 ); 
 

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

importJobPath(project, location, keyRing, importJob)

  importJobPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 keyRing 
 : 
  
 string 
 , 
  
 importJob 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified importJob resource name string.

Parameters
Name
Description
project
string
location
string
keyRing
string
importJob
string
Returns
Type
Description
string

{string} Resource name string.

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.

keyHandlePath(project, location, keyHandle)

  keyHandlePath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 keyHandle 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified keyHandle resource name string.

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

{string} Resource name string.

keyRingPath(project, location, keyRing)

  keyRingPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 keyRing 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified keyRing resource name string.

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

{string} Resource name string.

listEkmConnections(request, options)

  listEkmConnections 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 [], 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsRequest 
  
 | 
  
 null 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsResponse 
  
 ]>; 
 

Lists .

Parameters
Name
Description
request
IListEkmConnectionsRequest

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 listEkmConnectionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listEkmConnections(request, options, callback)

  listEkmConnections 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listEkmConnections(request, callback)

  listEkmConnections 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsRequest 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listEkmConnectionsAsync(request, options)

  listEkmConnectionsAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
> ; 
 

Equivalent to listEkmConnections , but returns an iterable object.

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

Parameters
Name
Description
request
IListEkmConnectionsRequest

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 resource name of the location associated with the 
 *  EkmConnections google.cloud.kms.v1.EkmConnection  to list, in the format 
 *  `projects/* /locations/*`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Optional. Optional limit on the number of 
 *  EkmConnections google.cloud.kms.v1.EkmConnection  to include in the 
 *  response. Further EkmConnections google.cloud.kms.v1.EkmConnection  can 
 *  subsequently be obtained by including the 
 *  ListEkmConnectionsResponse.next_page_token google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token 
 *  in a subsequent request. If unspecified, the server will pick an 
 *  appropriate default. 
 */ 
  
 // const pageSize = 1234 
  
 /** 
 *  Optional. Optional pagination token, returned earlier via 
 *  ListEkmConnectionsResponse.next_page_token google.cloud.kms.v1.ListEkmConnectionsResponse.next_page_token. 
 */ 
  
 // const pageToken = 'abc123' 
  
 /** 
 *  Optional. Only include resources that match the filter in the response. For 
 *  more information, see 
 *  Sorting and filtering list 
 *  results (https://cloud.google.com/kms/docs/sorting-and-filtering). 
 */ 
  
 // const filter = 'abc123' 
  
 /** 
 *  Optional. Specify how the results should be sorted. If not specified, the 
 *  results will be sorted in the default order.  For more information, see 
 *  Sorting and filtering list 
 *  results (https://cloud.google.com/kms/docs/sorting-and-filtering). 
 */ 
  
 // const orderBy = 'abc123' 
  
 // Imports the Kms library 
  
 const 
  
 { 
 EkmServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/kms 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 kmsClient 
  
 = 
  
 new 
  
  EkmServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callListEkmConnections 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 iterable 
  
 = 
  
 kmsClient 
 . 
  listEkmConnectionsAsync 
 
 ( 
 request 
 ); 
  
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 } 
  
 callListEkmConnections 
 (); 
 

listEkmConnectionsStream(request, options)

  listEkmConnectionsStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IListEkmConnectionsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

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

Parameters
Name
Description
request
IListEkmConnectionsRequest

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 listEkmConnectionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listLocationsAsync(request, options)

  listLocationsAsync 
 ( 
 request 
 : 
  
 LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 IListLocationsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 ILocation 
> ; 
 

Lists information about the supported locations for this service. Returns an iterable object.

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

Parameters
Name
Description
request
LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
AsyncIterable < google.cloud.location.ILocation >

{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
  const 
  
 iterable 
  
 = 
  
 client 
 . 
 listLocationsAsync 
 ( 
 request 
 ); 
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 // process response 
 } 
 

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.

matchCryptoKeyFromCryptoKeyName(cryptoKeyName)

  matchCryptoKeyFromCryptoKeyName 
 ( 
 cryptoKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the crypto_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 crypto_key.

matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName)

  matchCryptoKeyFromCryptoKeyVersionName 
 ( 
 cryptoKeyVersionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the crypto_key from CryptoKeyVersion resource.

Parameter
Name
Description
cryptoKeyVersionName
string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
Type
Description
string | number

{string} A string representing the crypto_key.

matchCryptoKeyFromPublicKeyName(publicKeyName)

  matchCryptoKeyFromPublicKeyName 
 ( 
 publicKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the crypto_key from PublicKey resource.

Parameter
Name
Description
publicKeyName
string

A fully-qualified path representing PublicKey resource.

Returns
Type
Description
string | number

{string} A string representing the crypto_key.

matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName)

  matchCryptoKeyVersionFromCryptoKeyVersionName 
 ( 
 cryptoKeyVersionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the crypto_key_version from CryptoKeyVersion resource.

Parameter
Name
Description
cryptoKeyVersionName
string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
Type
Description
string | number

{string} A string representing the crypto_key_version.

matchCryptoKeyVersionFromPublicKeyName(publicKeyName)

  matchCryptoKeyVersionFromPublicKeyName 
 ( 
 publicKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the crypto_key_version from PublicKey resource.

Parameter
Name
Description
publicKeyName
string

A fully-qualified path representing PublicKey resource.

Returns
Type
Description
string | number

{string} A string representing the crypto_key_version.

matchEkmConnectionFromEkmConnectionName(ekmConnectionName)

  matchEkmConnectionFromEkmConnectionName 
 ( 
 ekmConnectionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the ekm_connection from EkmConnection resource.

Parameter
Name
Description
ekmConnectionName
string

A fully-qualified path representing EkmConnection resource.

Returns
Type
Description
string | number

{string} A string representing the ekm_connection.

matchFolderFromAutokeyConfigName(autokeyConfigName)

  matchFolderFromAutokeyConfigName 
 ( 
 autokeyConfigName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the folder from AutokeyConfig resource.

Parameter
Name
Description
autokeyConfigName
string

A fully-qualified path representing AutokeyConfig resource.

Returns
Type
Description
string | number

{string} A string representing the folder.

matchImportJobFromImportJobName(importJobName)

  matchImportJobFromImportJobName 
 ( 
 importJobName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the import_job from ImportJob resource.

Parameter
Name
Description
importJobName
string

A fully-qualified path representing ImportJob resource.

Returns
Type
Description
string | number

{string} A string representing the import_job.

matchKeyHandleFromKeyHandleName(keyHandleName)

  matchKeyHandleFromKeyHandleName 
 ( 
 keyHandleName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the key_handle from KeyHandle resource.

Parameter
Name
Description
keyHandleName
string

A fully-qualified path representing KeyHandle resource.

Returns
Type
Description
string | number

{string} A string representing the key_handle.

matchKeyRingFromCryptoKeyName(cryptoKeyName)

  matchKeyRingFromCryptoKeyName 
 ( 
 cryptoKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the key_ring 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_ring.

matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName)

  matchKeyRingFromCryptoKeyVersionName 
 ( 
 cryptoKeyVersionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the key_ring from CryptoKeyVersion resource.

Parameter
Name
Description
cryptoKeyVersionName
string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
Type
Description
string | number

{string} A string representing the key_ring.

matchKeyRingFromImportJobName(importJobName)

  matchKeyRingFromImportJobName 
 ( 
 importJobName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the key_ring from ImportJob resource.

Parameter
Name
Description
importJobName
string

A fully-qualified path representing ImportJob resource.

Returns
Type
Description
string | number

{string} A string representing the key_ring.

matchKeyRingFromKeyRingName(keyRingName)

  matchKeyRingFromKeyRingName 
 ( 
 keyRingName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the key_ring from KeyRing resource.

Parameter
Name
Description
keyRingName
string

A fully-qualified path representing KeyRing resource.

Returns
Type
Description
string | number

{string} A string representing the key_ring.

matchKeyRingFromPublicKeyName(publicKeyName)

  matchKeyRingFromPublicKeyName 
 ( 
 publicKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the key_ring from PublicKey resource.

Parameter
Name
Description
publicKeyName
string

A fully-qualified path representing PublicKey resource.

Returns
Type
Description
string | number

{string} A string representing the key_ring.

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.

matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName)

  matchLocationFromCryptoKeyVersionName 
 ( 
 cryptoKeyVersionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from CryptoKeyVersion resource.

Parameter
Name
Description
cryptoKeyVersionName
string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromEkmConfigName(ekmConfigName)

  matchLocationFromEkmConfigName 
 ( 
 ekmConfigName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from EkmConfig resource.

Parameter
Name
Description
ekmConfigName
string

A fully-qualified path representing EkmConfig resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromEkmConnectionName(ekmConnectionName)

  matchLocationFromEkmConnectionName 
 ( 
 ekmConnectionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from EkmConnection resource.

Parameter
Name
Description
ekmConnectionName
string

A fully-qualified path representing EkmConnection resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromImportJobName(importJobName)

  matchLocationFromImportJobName 
 ( 
 importJobName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from ImportJob resource.

Parameter
Name
Description
importJobName
string

A fully-qualified path representing ImportJob resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromKeyHandleName(keyHandleName)

  matchLocationFromKeyHandleName 
 ( 
 keyHandleName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from KeyHandle resource.

Parameter
Name
Description
keyHandleName
string

A fully-qualified path representing KeyHandle resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromKeyRingName(keyRingName)

  matchLocationFromKeyRingName 
 ( 
 keyRingName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from KeyRing resource.

Parameter
Name
Description
keyRingName
string

A fully-qualified path representing KeyRing 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.

matchLocationFromPublicKeyName(publicKeyName)

  matchLocationFromPublicKeyName 
 ( 
 publicKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from PublicKey resource.

Parameter
Name
Description
publicKeyName
string

A fully-qualified path representing PublicKey resource.

Returns
Type
Description
string | number

{string} A string representing the location.

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.

matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName)

  matchProjectFromCryptoKeyVersionName 
 ( 
 cryptoKeyVersionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from CryptoKeyVersion resource.

Parameter
Name
Description
cryptoKeyVersionName
string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromEkmConfigName(ekmConfigName)

  matchProjectFromEkmConfigName 
 ( 
 ekmConfigName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from EkmConfig resource.

Parameter
Name
Description
ekmConfigName
string

A fully-qualified path representing EkmConfig resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromEkmConnectionName(ekmConnectionName)

  matchProjectFromEkmConnectionName 
 ( 
 ekmConnectionName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from EkmConnection resource.

Parameter
Name
Description
ekmConnectionName
string

A fully-qualified path representing EkmConnection resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromImportJobName(importJobName)

  matchProjectFromImportJobName 
 ( 
 importJobName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from ImportJob resource.

Parameter
Name
Description
importJobName
string

A fully-qualified path representing ImportJob resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromKeyHandleName(keyHandleName)

  matchProjectFromKeyHandleName 
 ( 
 keyHandleName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from KeyHandle resource.

Parameter
Name
Description
keyHandleName
string

A fully-qualified path representing KeyHandle resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromKeyRingName(keyRingName)

  matchProjectFromKeyRingName 
 ( 
 keyRingName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from KeyRing resource.

Parameter
Name
Description
keyRingName
string

A fully-qualified path representing KeyRing 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.

matchProjectFromPublicKeyName(publicKeyName)

  matchProjectFromPublicKeyName 
 ( 
 publicKeyName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from PublicKey resource.

Parameter
Name
Description
publicKeyName
string

A fully-qualified path representing PublicKey resource.

Returns
Type
Description
string | number

{string} A string representing the project.

publicKeyPath(project, location, keyRing, cryptoKey, cryptoKeyVersion)

  publicKeyPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 keyRing 
 : 
  
 string 
 , 
  
 cryptoKey 
 : 
  
 string 
 , 
  
 cryptoKeyVersion 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified publicKey resource name string.

Parameters
Name
Description
project
string
location
string
keyRing
string
cryptoKey
string
cryptoKeyVersion
string
Returns
Type
Description
string

{string} Resource name string.

setIamPolicy(request, options, callback)

  setIamPolicy 
 ( 
 request 
 : 
  
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 SetIamPolicyRequest 
 , 
  
 options 
 ?: 
  
 gax 
 . 
 CallOptions 
  
 | 
  
 Callback<IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 Policy 
 , 
  
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 SetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> , 
  
 callback 
 ?: 
  
 Callback<IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 Policy 
 , 
  
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 SetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 Promise 
< [ 
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 Policy 
 ]>; 
 

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
Name
Description
request
IamProtos.google.iam.v1.SetIamPolicyRequest

The request object that will be sent.

options
CallOptions | Callback < google.iam.v1.Policy , google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback
Callback < google.iam.v1.Policy , google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
Type
Description
Promise <[ google.iam.v1.Policy ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

testIamPermissions(request, options, callback)

  testIamPermissions 
 ( 
 request 
 : 
  
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 TestIamPermissionsRequest 
 , 
  
 options 
 ?: 
  
 gax 
 . 
 CallOptions 
  
 | 
  
 Callback<IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 TestIamPermissionsResponse 
 , 
  
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 TestIamPermissionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> , 
  
 callback 
 ?: 
  
 Callback<IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 TestIamPermissionsResponse 
 , 
  
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 TestIamPermissionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 Promise 
< [ 
 IamProtos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 TestIamPermissionsResponse 
 ]>; 
 

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
Name
Description
request
IamProtos.google.iam.v1.TestIamPermissionsRequest

The request object that will be sent.

options
CallOptions | Callback < google.iam.v1.TestIamPermissionsResponse , google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback
Callback < google.iam.v1.TestIamPermissionsResponse , google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
Type
Description
Promise <[ google.iam.v1.TestIamPermissionsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

updateEkmConfig(request, options)

  updateEkmConfig 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConfigRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConfig 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConfigRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Updates the EkmConfig singleton resource for a given project and location.

Parameters
Name
Description
request
IUpdateEkmConfigRequest

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 EkmConfig . 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. EkmConfig google.cloud.kms.v1.EkmConfig  with updated values. 
 */ 
  
 // const ekmConfig = {} 
  
 /** 
 *  Required. List of fields to be updated in this request. 
 */ 
  
 // const updateMask = {} 
  
 // Imports the Kms library 
  
 const 
  
 { 
 EkmServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/kms 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 kmsClient 
  
 = 
  
 new 
  
  EkmServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateEkmConfig 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 ekmConfig 
 , 
  
 updateMask 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 kmsClient 
 . 
 updateEkmConfig 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateEkmConfig 
 (); 
 

updateEkmConfig(request, options, callback)

  updateEkmConfig 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConfigRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConfig 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConfigRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.kms.v1.IEkmConfig , protos.google.cloud.kms.v1.IUpdateEkmConfigRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

updateEkmConfig(request, callback)

  updateEkmConfig 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConfigRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConfig 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConfigRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.kms.v1.IEkmConfig , protos.google.cloud.kms.v1.IUpdateEkmConfigRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

updateEkmConnection(request, options)

  updateEkmConnection 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConnectionRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConnectionRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Updates an 's metadata.

Parameters
Name
Description
request
IUpdateEkmConnectionRequest

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. EkmConnection google.cloud.kms.v1.EkmConnection  with updated 
 *  values. 
 */ 
  
 // const ekmConnection = {} 
  
 /** 
 *  Required. List of fields to be updated in this request. 
 */ 
  
 // const updateMask = {} 
  
 // Imports the Kms library 
  
 const 
  
 { 
 EkmServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/kms 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 kmsClient 
  
 = 
  
 new 
  
  EkmServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateEkmConnection 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 ekmConnection 
 , 
  
 updateMask 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 kmsClient 
 . 
 updateEkmConnection 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateEkmConnection 
 (); 
 

updateEkmConnection(request, options, callback)

  updateEkmConnection 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConnectionRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConnectionRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

updateEkmConnection(request, callback)

  updateEkmConnection 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConnectionRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IEkmConnection 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IUpdateEkmConnectionRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

verifyConnectivity(request, options)

  verifyConnectivity 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IVerifyConnectivityRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IVerifyConnectivityResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IVerifyConnectivityRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Verifies that Cloud KMS can successfully connect to the external key manager specified by an . If there is an error connecting to the EKM, this method returns a FAILED_PRECONDITION status containing structured information as described at https://cloud.google.com/kms/docs/reference/ekm_errors.

Parameters
Name
Description
request
IVerifyConnectivityRequest

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 VerifyConnectivityResponse . 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 google.cloud.kms.v1.EkmConnection.name  of the 
 *  EkmConnection google.cloud.kms.v1.EkmConnection  to verify. 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Kms library 
  
 const 
  
 { 
 EkmServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/kms 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 kmsClient 
  
 = 
  
 new 
  
  EkmServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callVerifyConnectivity 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 kmsClient 
 . 
 verifyConnectivity 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callVerifyConnectivity 
 (); 
 

verifyConnectivity(request, options, callback)

  verifyConnectivity 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IVerifyConnectivityRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IVerifyConnectivityResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IVerifyConnectivityRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

verifyConnectivity(request, callback)

  verifyConnectivity 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IVerifyConnectivityRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IVerifyConnectivityResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 kms 
 . 
 v1 
 . 
 IVerifyConnectivityRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void
Design a Mobile Site
View Site in Mobile | Classic
Share by: