Provides interfaces for using Cloud KMS Autokey to provision new , ready for Customer Managed Encryption Key (CMEK) use, on-demand. To support certain client tooling, this feature is modeled around a KeyHandle resource: creating a KeyHandle in a resource project and given location triggers Cloud KMS Autokey to provision a in the configured key project and the same location.
Prior to use in a given resource project, should have been called on an ancestor folder, setting the key project where Cloud KMS Autokey should create new . See documentation for additional prerequisites. To check what key project, if any, is currently configured on a resource project's ancestor folder, see . v1
Package
@google-cloud/kmsConstructors
(constructor)(opts, gaxInstance)
constructor
(
opts
?:
ClientOptions
,
gaxInstance
?:
typeof
gax
|
typeof
gax
.
fallback
);
Construct an instance of AutokeyClient.
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 AutokeyClient({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
;
autokeyStub
autokeyStub
?:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
descriptors
descriptors
:
Descriptors
;
iamClient
iamClient
:
IamClient
;
innerApiCalls
innerApiCalls
:
{
[
name
:
string
]
:
Function
;
};
locationsClient
locationsClient
:
LocationsClient
;
operationsClient
operationsClient
:
gax
.
OperationsClient
;
pathTemplates
pathTemplates
:
{
[
name
:
string
]
:
gax
.
PathTemplate
;
};
port
static
get
port
()
:
number
;
The port for this API service.
scopes
static
get
scopes
()
:
string
[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static
get
servicePath
()
:
string
;
The DNS address for this API service.
universeDomain
get
universeDomain
()
:
string
;
warn
warn
:
(
code
:
string
,
message
:
string
,
warnType
?:
string
)
=
>
void
;
Methods
autokeyConfigPath(folder)
autokeyConfigPath
(
folder
:
string
)
:
string
;
Return a fully-qualified autokeyConfig resource name string.
folder
string
string
{string} Resource name string.
cancelOperation(request, options, callback)
cancelOperation
(
request
:
protos
.
google
.
longrunning
.
CancelOperationRequest
,
options
?:
gax
.
CallOptions
|
Callback<protos
.
google
.
protobuf
.
Empty
,
protos
.
google
.
longrunning
.
CancelOperationRequest
,
{}
|
undefined
|
null
> ,
callback
?:
Callback<protos
.
google
.
longrunning
.
CancelOperationRequest
,
protos
.
google
.
protobuf
.
Empty
,
{}
|
undefined
|
null
> )
:
Promise<protos
.
google
.
protobuf
.
Empty
> ;
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED
.
request
options
CallOptions
| Callback
< protos.google.protobuf.Empty
, protos.google.longrunning.CancelOperationRequest
, {} | undefined | null>
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
< protos.google.longrunning.CancelOperationRequest
, protos.google.protobuf.Empty
, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
const
client
=
longrunning
.
operationsClient
();
await
client
.
cancelOperation
({
name
:
''
});
checkCreateKeyHandleProgress(name)
checkCreateKeyHandleProgress
(
name
:
string
)
:
Promise<LROperation<protos
.
google
.
cloud
.
kms
.
v1
.
KeyHandle
,
protos
.
google
.
cloud
.
kms
.
v1
.
CreateKeyHandleMetadata
>> ;
Check the status of the long running operation returned by createKeyHandle()
.
name
string
The operation name that will be passed.
Promise
< LROperation
< protos.google.cloud.kms.v1.KeyHandle
, protos.google.cloud.kms.v1.CreateKeyHandleMetadata
>>
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the resource project and location to create the
* KeyHandle google.cloud.kms.v1.KeyHandle in, e.g.
* `projects/{PROJECT_ID}/locations/{LOCATION}`.
*/
// const parent = 'abc123'
/**
* Optional. Id of the KeyHandle google.cloud.kms.v1.KeyHandle. Must be
* unique to the resource project and location. If not provided by the caller,
* a new UUID is used.
*/
// const keyHandleId = 'abc123'
/**
* Required. KeyHandle google.cloud.kms.v1.KeyHandle to create.
*/
// const keyHandle = {}
// Imports the Kms library
const
{
AutokeyClient
}
=
require
(
' @google-cloud/kms
'
).
v1
;
// Instantiates a client
const
kmsClient
=
new
AutokeyClient
();
async
function
callCreateKeyHandle
()
{
// Construct request
const
request
=
{
parent
,
keyHandle
,
};
// Run request
const
[
operation
]
=
await
kmsClient
.
createKeyHandle
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callCreateKeyHandle
();
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.
Promise
<void>
{Promise} A promise that resolves when the client is closed.
createKeyHandle(request, options)
createKeyHandle
(
request
?:
protos
.
google
.
cloud
.
kms
.
v1
.
ICreateKeyHandleRequest
,
options
?:
CallOptions
)
:
Promise
< [
LROperation<protos
.
google
.
cloud
.
kms
.
v1
.
IKeyHandle
,
protos
.
google
.
cloud
.
kms
.
v1
.
ICreateKeyHandleMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
undefined
,
{}
|
undefined
]>;
Creates a new KeyHandle , triggering the provisioning of a new for CMEK use with the given resource type in the configured key project and the same location. should be used to resolve the resulting long-running operation and get the resulting KeyHandle and .
request
options
Promise
<[ LROperation
< protos.google.cloud.kms.v1.IKeyHandle
, protos.google.cloud.kms.v1.ICreateKeyHandleMetadata
>, 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
for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the resource project and location to create the
* KeyHandle google.cloud.kms.v1.KeyHandle in, e.g.
* `projects/{PROJECT_ID}/locations/{LOCATION}`.
*/
// const parent = 'abc123'
/**
* Optional. Id of the KeyHandle google.cloud.kms.v1.KeyHandle. Must be
* unique to the resource project and location. If not provided by the caller,
* a new UUID is used.
*/
// const keyHandleId = 'abc123'
/**
* Required. KeyHandle google.cloud.kms.v1.KeyHandle to create.
*/
// const keyHandle = {}
// Imports the Kms library
const
{
AutokeyClient
}
=
require
(
' @google-cloud/kms
'
).
v1
;
// Instantiates a client
const
kmsClient
=
new
AutokeyClient
();
async
function
callCreateKeyHandle
()
{
// Construct request
const
request
=
{
parent
,
keyHandle
,
};
// Run request
const
[
operation
]
=
await
kmsClient
.
createKeyHandle
(
request
);
const
[
response
]
=
await
operation
.
promise
();
console
.
log
(
response
);
}
callCreateKeyHandle
();
createKeyHandle(request, options, callback)
createKeyHandle
(
request
:
protos
.
google
.
cloud
.
kms
.
v1
.
ICreateKeyHandleRequest
,
options
:
CallOptions
,
callback
:
Callback<LROperation<protos
.
google
.
cloud
.
kms
.
v1
.
IKeyHandle
,
protos
.
google
.
cloud
.
kms
.
v1
.
ICreateKeyHandleMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< LROperation
< protos.google.cloud.kms.v1.IKeyHandle
, protos.google.cloud.kms.v1.ICreateKeyHandleMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
createKeyHandle(request, callback)
createKeyHandle
(
request
:
protos
.
google
.
cloud
.
kms
.
v1
.
ICreateKeyHandleRequest
,
callback
:
Callback<LROperation<protos
.
google
.
cloud
.
kms
.
v1
.
IKeyHandle
,
protos
.
google
.
cloud
.
kms
.
v1
.
ICreateKeyHandleMetadata
> ,
protos
.
google
.
longrunning
.
IOperation
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< LROperation
< protos.google.cloud.kms.v1.IKeyHandle
, protos.google.cloud.kms.v1.ICreateKeyHandleMetadata
>, protos.google.longrunning.IOperation
| null | undefined, {} | null | undefined>
void
cryptoKeyPath(project, location, keyRing, cryptoKey)
cryptoKeyPath
(
project
:
string
,
location
:
string
,
keyRing
:
string
,
cryptoKey
:
string
)
:
string
;
Return a fully-qualified cryptoKey resource name string.
project
string
location
string
keyRing
string
cryptoKey
string
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.
project
string
location
string
keyRing
string
cryptoKey
string
cryptoKeyVersion
string
string
{string} Resource name string.
deleteOperation(request, options, callback)
deleteOperation
(
request
:
protos
.
google
.
longrunning
.
DeleteOperationRequest
,
options
?:
gax
.
CallOptions
|
Callback<protos
.
google
.
protobuf
.
Empty
,
protos
.
google
.
longrunning
.
DeleteOperationRequest
,
{}
|
null
|
undefined
> ,
callback
?:
Callback<protos
.
google
.
protobuf
.
Empty
,
protos
.
google
.
longrunning
.
DeleteOperationRequest
,
{}
|
null
|
undefined
> )
:
Promise<protos
.
google
.
protobuf
.
Empty
> ;
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
.
request
options
CallOptions
| Callback
< protos.google.protobuf.Empty
, protos.google.longrunning.DeleteOperationRequest
, {} | 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
< protos.google.protobuf.Empty
, protos.google.longrunning.DeleteOperationRequest
, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
const
client
=
longrunning
.
operationsClient
();
await
client
.
deleteOperation
({
name
:
''
});
ekmConfigPath(project, location)
ekmConfigPath
(
project
:
string
,
location
:
string
)
:
string
;
Return a fully-qualified ekmConfig resource name string.
project
string
location
string
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.
project
string
location
string
ekmConnection
string
string
{string} Resource name string.
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.
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 .
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.
getKeyHandle(request, options)
getKeyHandle
(
request
?:
protos
.
google
.
cloud
.
kms
.
v1
.
IGetKeyHandleRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
cloud
.
kms
.
v1
.
IKeyHandle
,
protos
.
google
.
cloud
.
kms
.
v1
.
IGetKeyHandleRequest
|
undefined
,
{}
|
undefined
]>;
Returns the KeyHandle .
request
options
Promise
<[ protos.google.cloud.kms.v1.IKeyHandle
, protos.google.cloud.kms.v1.IGetKeyHandleRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing KeyHandle . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the KeyHandle google.cloud.kms.v1.KeyHandle resource,
* e.g.
* `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`.
*/
// const name = 'abc123'
// Imports the Kms library
const
{
AutokeyClient
}
=
require
(
' @google-cloud/kms
'
).
v1
;
// Instantiates a client
const
kmsClient
=
new
AutokeyClient
();
async
function
callGetKeyHandle
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
kmsClient
.
getKeyHandle
(
request
);
console
.
log
(
response
);
}
callGetKeyHandle
();
getKeyHandle(request, options, callback)
getKeyHandle
(
request
:
protos
.
google
.
cloud
.
kms
.
v1
.
IGetKeyHandleRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
cloud
.
kms
.
v1
.
IKeyHandle
,
protos
.
google
.
cloud
.
kms
.
v1
.
IGetKeyHandleRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.kms.v1.IKeyHandle
, protos.google.cloud.kms.v1.IGetKeyHandleRequest
| null | undefined, {} | null | undefined>
void
getKeyHandle(request, callback)
getKeyHandle
(
request
:
protos
.
google
.
cloud
.
kms
.
v1
.
IGetKeyHandleRequest
,
callback
:
Callback<protos
.
google
.
cloud
.
kms
.
v1
.
IKeyHandle
,
protos
.
google
.
cloud
.
kms
.
v1
.
IGetKeyHandleRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.cloud.kms.v1.IKeyHandle
, protos.google.cloud.kms.v1.IGetKeyHandleRequest
| null | undefined, {} | null | undefined>
void
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.
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>
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.
const
[
response
]
=
await
client
.
getLocation
(
request
);
getOperation(request, options, callback)
getOperation
(
request
:
protos
.
google
.
longrunning
.
GetOperationRequest
,
options
?:
gax
.
CallOptions
|
Callback<protos
.
google
.
longrunning
.
Operation
,
protos
.
google
.
longrunning
.
GetOperationRequest
,
{}
|
null
|
undefined
> ,
callback
?:
Callback<protos
.
google
.
longrunning
.
Operation
,
protos
.
google
.
longrunning
.
GetOperationRequest
,
{}
|
null
|
undefined
> )
:
Promise
< [
protos
.
google
.
longrunning
.
Operation
]>;
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
request
options
CallOptions
| Callback
< protos.google.longrunning.Operation
, protos.google.longrunning.GetOperationRequest
, {} | 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
< protos.google.longrunning.Operation
, protos.google.longrunning.GetOperationRequest
, {} | 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 . {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.
const
client
=
longrunning
.
operationsClient
();
const
name
=
''
;
const
[
response
]
=
await
client
.
getOperation
({
name
});
// doThingsWith(response)
getProjectId()
getProjectId
()
:
Promise<string>
;
Promise
<string>
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
callback
Callback
<string, undefined, undefined>
void
importJobPath(project, location, keyRing, importJob)
importJobPath
(
project
:
string
,
location
:
string
,
keyRing
:
string
,
importJob
:
string
)
:
string
;
Return a fully-qualified importJob resource name string.
project
string
location
string
keyRing
string
importJob
string
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.
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.
project
string
location
string
keyHandle
string
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.
project
string
location
string
keyRing
string
string
{string} Resource name string.
listKeyHandles(request, options)
listKeyHandles
(
request
?:
protos
.
google
.
cloud
.
kms
.
v1
.
IListKeyHandlesRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
cloud
.
kms
.
v1
.
IListKeyHandlesResponse
,
protos
.
google
.
cloud
.
kms
.
v1
.
IListKeyHandlesRequest
|
undefined
,
{}
|
undefined
]>;
Lists KeyHandles .
request
options
Promise
<[ protos.google.cloud.kms.v1.IListKeyHandlesResponse
, protos.google.cloud.kms.v1.IListKeyHandlesRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing ListKeyHandlesResponse . Please see the documentation for more details and examples.
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the resource project and location from which to list
* KeyHandles google.cloud.kms.v1.KeyHandle, e.g.
* `projects/{PROJECT_ID}/locations/{LOCATION}`.
*/
// const parent = 'abc123'
/**
* Optional. Filter to apply when listing
* KeyHandles google.cloud.kms.v1.KeyHandle, e.g.
* `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`.
*/
// const filter = 'abc123'
// Imports the Kms library
const
{
AutokeyClient
}
=
require
(
' @google-cloud/kms
'
).
v1
;
// Instantiates a client
const
kmsClient
=
new
AutokeyClient
();
async
function
callListKeyHandles
()
{
// Construct request
const
request
=
{
parent
,
};
// Run request
const
response
=
await
kmsClient
.
listKeyHandles
(
request
);
console
.
log
(
response
);
}
callListKeyHandles
();
listKeyHandles(request, options, callback)
listKeyHandles
(
request
:
protos
.
google
.
cloud
.
kms
.
v1
.
IListKeyHandlesRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
cloud
.
kms
.
v1
.
IListKeyHandlesResponse
,
protos
.
google
.
cloud
.
kms
.
v1
.
IListKeyHandlesRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.kms.v1.IListKeyHandlesResponse
, protos.google.cloud.kms.v1.IListKeyHandlesRequest
| null | undefined, {} | null | undefined>
void
listKeyHandles(request, callback)
listKeyHandles
(
request
:
protos
.
google
.
cloud
.
kms
.
v1
.
IListKeyHandlesRequest
,
callback
:
Callback<protos
.
google
.
cloud
.
kms
.
v1
.
IListKeyHandlesResponse
,
protos
.
google
.
cloud
.
kms
.
v1
.
IListKeyHandlesRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.cloud.kms.v1.IListKeyHandlesResponse
, protos.google.cloud.kms.v1.IListKeyHandlesRequest
| null | undefined, {} | null | undefined>
void
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.
request
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent.
options
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.
const
iterable
=
client
.
listLocationsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
// process response
}
listOperationsAsync(request, options)
listOperationsAsync
(
request
:
protos
.
google
.
longrunning
.
ListOperationsRequest
,
options
?:
gax
.
CallOptions
)
:
AsyncIterable<protos
.
google
.
longrunning
.
ListOperationsResponse
> ;
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED
. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
request
options
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
AsyncIterable
< protos.google.longrunning.ListOperationsResponse
>
{Object} An iterable Object that conforms to iteration protocols .
const
client
=
longrunning
.
operationsClient
();
for
await
(
const
response
of
client
.
listOperationsAsync
(
request
));
// doThingsWith(response)
locationPath(project, location)
locationPath
(
project
:
string
,
location
:
string
)
:
string
;
Return a fully-qualified location resource name string.
project
string
location
string
string
{string} Resource name string.
matchCryptoKeyFromCryptoKeyName(cryptoKeyName)
matchCryptoKeyFromCryptoKeyName
(
cryptoKeyName
:
string
)
:
string
|
number
;
Parse the crypto_key from CryptoKey resource.
cryptoKeyName
string
A fully-qualified path representing CryptoKey resource.
string | number
{string} A string representing the crypto_key.
matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName)
matchCryptoKeyFromCryptoKeyVersionName
(
cryptoKeyVersionName
:
string
)
:
string
|
number
;
Parse the crypto_key from CryptoKeyVersion resource.
cryptoKeyVersionName
string
A fully-qualified path representing CryptoKeyVersion resource.
string | number
{string} A string representing the crypto_key.
matchCryptoKeyFromPublicKeyName(publicKeyName)
matchCryptoKeyFromPublicKeyName
(
publicKeyName
:
string
)
:
string
|
number
;
Parse the crypto_key from PublicKey resource.
publicKeyName
string
A fully-qualified path representing PublicKey resource.
string | number
{string} A string representing the crypto_key.
matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName)
matchCryptoKeyVersionFromCryptoKeyVersionName
(
cryptoKeyVersionName
:
string
)
:
string
|
number
;
Parse the crypto_key_version from CryptoKeyVersion resource.
cryptoKeyVersionName
string
A fully-qualified path representing CryptoKeyVersion resource.
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.
publicKeyName
string
A fully-qualified path representing PublicKey resource.
string | number
{string} A string representing the crypto_key_version.
matchEkmConnectionFromEkmConnectionName(ekmConnectionName)
matchEkmConnectionFromEkmConnectionName
(
ekmConnectionName
:
string
)
:
string
|
number
;
Parse the ekm_connection from EkmConnection resource.
ekmConnectionName
string
A fully-qualified path representing EkmConnection resource.
string | number
{string} A string representing the ekm_connection.
matchFolderFromAutokeyConfigName(autokeyConfigName)
matchFolderFromAutokeyConfigName
(
autokeyConfigName
:
string
)
:
string
|
number
;
Parse the folder from AutokeyConfig resource.
autokeyConfigName
string
A fully-qualified path representing AutokeyConfig resource.
string | number
{string} A string representing the folder.
matchImportJobFromImportJobName(importJobName)
matchImportJobFromImportJobName
(
importJobName
:
string
)
:
string
|
number
;
Parse the import_job from ImportJob resource.
importJobName
string
A fully-qualified path representing ImportJob resource.
string | number
{string} A string representing the import_job.
matchKeyHandleFromKeyHandleName(keyHandleName)
matchKeyHandleFromKeyHandleName
(
keyHandleName
:
string
)
:
string
|
number
;
Parse the key_handle from KeyHandle resource.
keyHandleName
string
A fully-qualified path representing KeyHandle resource.
string | number
{string} A string representing the key_handle.
matchKeyRingFromCryptoKeyName(cryptoKeyName)
matchKeyRingFromCryptoKeyName
(
cryptoKeyName
:
string
)
:
string
|
number
;
Parse the key_ring from CryptoKey resource.
cryptoKeyName
string
A fully-qualified path representing CryptoKey resource.
string | number
{string} A string representing the key_ring.
matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName)
matchKeyRingFromCryptoKeyVersionName
(
cryptoKeyVersionName
:
string
)
:
string
|
number
;
Parse the key_ring from CryptoKeyVersion resource.
cryptoKeyVersionName
string
A fully-qualified path representing CryptoKeyVersion resource.
string | number
{string} A string representing the key_ring.
matchKeyRingFromImportJobName(importJobName)
matchKeyRingFromImportJobName
(
importJobName
:
string
)
:
string
|
number
;
Parse the key_ring from ImportJob resource.
importJobName
string
A fully-qualified path representing ImportJob resource.
string | number
{string} A string representing the key_ring.
matchKeyRingFromKeyRingName(keyRingName)
matchKeyRingFromKeyRingName
(
keyRingName
:
string
)
:
string
|
number
;
Parse the key_ring from KeyRing resource.
keyRingName
string
A fully-qualified path representing KeyRing resource.
string | number
{string} A string representing the key_ring.
matchKeyRingFromPublicKeyName(publicKeyName)
matchKeyRingFromPublicKeyName
(
publicKeyName
:
string
)
:
string
|
number
;
Parse the key_ring from PublicKey resource.
publicKeyName
string
A fully-qualified path representing PublicKey resource.
string | number
{string} A string representing the key_ring.
matchLocationFromCryptoKeyName(cryptoKeyName)
matchLocationFromCryptoKeyName
(
cryptoKeyName
:
string
)
:
string
|
number
;
Parse the location from CryptoKey resource.
cryptoKeyName
string
A fully-qualified path representing CryptoKey resource.
string | number
{string} A string representing the location.
matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName)
matchLocationFromCryptoKeyVersionName
(
cryptoKeyVersionName
:
string
)
:
string
|
number
;
Parse the location from CryptoKeyVersion resource.
cryptoKeyVersionName
string
A fully-qualified path representing CryptoKeyVersion resource.
string | number
{string} A string representing the location.
matchLocationFromEkmConfigName(ekmConfigName)
matchLocationFromEkmConfigName
(
ekmConfigName
:
string
)
:
string
|
number
;
Parse the location from EkmConfig resource.
ekmConfigName
string
A fully-qualified path representing EkmConfig resource.
string | number
{string} A string representing the location.
matchLocationFromEkmConnectionName(ekmConnectionName)
matchLocationFromEkmConnectionName
(
ekmConnectionName
:
string
)
:
string
|
number
;
Parse the location from EkmConnection resource.
ekmConnectionName
string
A fully-qualified path representing EkmConnection resource.
string | number
{string} A string representing the location.
matchLocationFromImportJobName(importJobName)
matchLocationFromImportJobName
(
importJobName
:
string
)
:
string
|
number
;
Parse the location from ImportJob resource.
importJobName
string
A fully-qualified path representing ImportJob resource.
string | number
{string} A string representing the location.
matchLocationFromKeyHandleName(keyHandleName)
matchLocationFromKeyHandleName
(
keyHandleName
:
string
)
:
string
|
number
;
Parse the location from KeyHandle resource.
keyHandleName
string
A fully-qualified path representing KeyHandle resource.
string | number
{string} A string representing the location.
matchLocationFromKeyRingName(keyRingName)
matchLocationFromKeyRingName
(
keyRingName
:
string
)
:
string
|
number
;
Parse the location from KeyRing resource.
keyRingName
string
A fully-qualified path representing KeyRing resource.
string | number
{string} A string representing the location.
matchLocationFromLocationName(locationName)
matchLocationFromLocationName
(
locationName
:
string
)
:
string
|
number
;
Parse the location from Location resource.
locationName
string
A fully-qualified path representing Location resource.
string | number
{string} A string representing the location.
matchLocationFromPublicKeyName(publicKeyName)
matchLocationFromPublicKeyName
(
publicKeyName
:
string
)
:
string
|
number
;
Parse the location from PublicKey resource.
publicKeyName
string
A fully-qualified path representing PublicKey resource.
string | number
{string} A string representing the location.
matchProjectFromCryptoKeyName(cryptoKeyName)
matchProjectFromCryptoKeyName
(
cryptoKeyName
:
string
)
:
string
|
number
;
Parse the project from CryptoKey resource.
cryptoKeyName
string
A fully-qualified path representing CryptoKey resource.
string | number
{string} A string representing the project.
matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName)
matchProjectFromCryptoKeyVersionName
(
cryptoKeyVersionName
:
string
)
:
string
|
number
;
Parse the project from CryptoKeyVersion resource.
cryptoKeyVersionName
string
A fully-qualified path representing CryptoKeyVersion resource.
string | number
{string} A string representing the project.
matchProjectFromEkmConfigName(ekmConfigName)
matchProjectFromEkmConfigName
(
ekmConfigName
:
string
)
:
string
|
number
;
Parse the project from EkmConfig resource.
ekmConfigName
string
A fully-qualified path representing EkmConfig resource.
string | number
{string} A string representing the project.
matchProjectFromEkmConnectionName(ekmConnectionName)
matchProjectFromEkmConnectionName
(
ekmConnectionName
:
string
)
:
string
|
number
;
Parse the project from EkmConnection resource.
ekmConnectionName
string
A fully-qualified path representing EkmConnection resource.
string | number
{string} A string representing the project.
matchProjectFromImportJobName(importJobName)
matchProjectFromImportJobName
(
importJobName
:
string
)
:
string
|
number
;
Parse the project from ImportJob resource.
importJobName
string
A fully-qualified path representing ImportJob resource.
string | number
{string} A string representing the project.
matchProjectFromKeyHandleName(keyHandleName)
matchProjectFromKeyHandleName
(
keyHandleName
:
string
)
:
string
|
number
;
Parse the project from KeyHandle resource.
keyHandleName
string
A fully-qualified path representing KeyHandle resource.
string | number
{string} A string representing the project.
matchProjectFromKeyRingName(keyRingName)
matchProjectFromKeyRingName
(
keyRingName
:
string
)
:
string
|
number
;
Parse the project from KeyRing resource.
keyRingName
string
A fully-qualified path representing KeyRing resource.
string | number
{string} A string representing the project.
matchProjectFromLocationName(locationName)
matchProjectFromLocationName
(
locationName
:
string
)
:
string
|
number
;
Parse the project from Location resource.
locationName
string
A fully-qualified path representing Location resource.
string | number
{string} A string representing the project.
matchProjectFromPublicKeyName(publicKeyName)
matchProjectFromPublicKeyName
(
publicKeyName
:
string
)
:
string
|
number
;
Parse the project from PublicKey resource.
publicKeyName
string
A fully-qualified path representing PublicKey resource.
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.
project
string
location
string
keyRing
string
cryptoKey
string
cryptoKeyVersion
string
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.
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 .
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.
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 .
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.