Secret Manager Service
Manages secrets and operations using those secrets. Implements a REST model with the following objects:
* * v1
Package
@google-cloud/secret-managerConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);Construct an instance of SecretManagerServiceClient.
| Parameters | |
|---|---|
| Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
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;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.
secretManagerServiceStub
secretManagerServiceStub?: Promise<{
[name: string]: Function;
}>;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
accessSecretVersion(request, options)
accessSecretVersion(request?: protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.IAccessSecretVersionResponse,
(protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest | undefined),
{} | undefined
]>;Accesses a . This call returns the secret data.
projects/* /secrets/* /versions/latest is an alias to the most recently created .
| Parameters | |
|---|---|
| Name | Description |
request |
IAccessSecretVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.IAccessSecretVersionResponse,
(protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest | undefined),
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing AccessSecretVersionResponse. 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. The resource name of the
* SecretVersion google.cloud.secretmanager.v1.SecretVersion in the format
* `projects/* /secrets/* /versions/*` or
* `projects/* /locations/* /secrets/* /versions/*`.
* `projects/* /secrets/* /versions/latest` or
* `projects/* /locations/* /secrets/* /versions/latest` is an alias to the most
* recently created
* SecretVersion google.cloud.secretmanager.v1.SecretVersion.
*/
// const name = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callAccessSecretVersion() {
// Construct request
const request = {
name,
};
// Run request
const response = await secretmanagerClient.accessSecretVersion(request);
console.log(response);
}
callAccessSecretVersion();
accessSecretVersion(request, options, callback)
accessSecretVersion(request: protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.IAccessSecretVersionResponse, protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IAccessSecretVersionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.IAccessSecretVersionResponse, protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
accessSecretVersion(request, callback)
accessSecretVersion(request: protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest, callback: Callback<protos.google.cloud.secretmanager.v1.IAccessSecretVersionResponse, protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IAccessSecretVersionRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.IAccessSecretVersionResponse, protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
addSecretVersion(request, options)
addSecretVersion(request?: protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest | undefined,
{} | undefined
]>;Creates a new containing secret data and attaches it to an existing .
| Parameters | |
|---|---|
| Name | Description |
request |
IAddSecretVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest | undefined,
{} | undefined
]> |
{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. |
/**
* 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
* Secret google.cloud.secretmanager.v1.Secret to associate with the
* SecretVersion google.cloud.secretmanager.v1.SecretVersion in the format
* `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`.
*/
// const parent = 'abc123'
/**
* Required. The secret payload of the
* SecretVersion google.cloud.secretmanager.v1.SecretVersion.
*/
// const payload = {}
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callAddSecretVersion() {
// Construct request
const request = {
parent,
payload,
};
// Run request
const response = await secretmanagerClient.addSecretVersion(request);
console.log(response);
}
callAddSecretVersion();
addSecretVersion(request, options, callback)
addSecretVersion(request: protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IAddSecretVersionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
addSecretVersion(request, callback)
addSecretVersion(request: protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IAddSecretVersionRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
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. |
createSecret(request, options)
createSecret(request?: protos.google.cloud.secretmanager.v1.ICreateSecretRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecret,
protos.google.cloud.secretmanager.v1.ICreateSecretRequest | undefined,
{} | undefined
]>;Creates a new containing no .
| Parameters | |
|---|---|
| Name | Description |
request |
ICreateSecretRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecret,
protos.google.cloud.secretmanager.v1.ICreateSecretRequest | undefined,
{} | undefined
]> |
{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. |
/**
* 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 project to associate with the
* Secret google.cloud.secretmanager.v1.Secret, in the format `projects/*`
* or `projects/* /locations/*`.
*/
// const parent = 'abc123'
/**
* Required. This must be unique within the project.
* A secret ID is a string with a maximum length of 255 characters and can
* contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and
* underscore (`_`) characters.
*/
// const secretId = 'abc123'
/**
* Required. A Secret google.cloud.secretmanager.v1.Secret with initial
* field values.
*/
// const secret = {}
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callCreateSecret() {
// Construct request
const request = {
parent,
secretId,
secret,
};
// Run request
const response = await secretmanagerClient.createSecret(request);
console.log(response);
}
callCreateSecret();
createSecret(request, options, callback)
createSecret(request: protos.google.cloud.secretmanager.v1.ICreateSecretRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.ICreateSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateSecretRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.ICreateSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
createSecret(request, callback)
createSecret(request: protos.google.cloud.secretmanager.v1.ICreateSecretRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.ICreateSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateSecretRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.ICreateSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
deleteSecret(request, options)
deleteSecret(request?: protos.google.cloud.secretmanager.v1.IDeleteSecretRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.google.cloud.secretmanager.v1.IDeleteSecretRequest | undefined,
{} | undefined
]>;Deletes a .
| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteSecretRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
protos.google.cloud.secretmanager.v1.IDeleteSecretRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples. |
/**
* 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
* Secret google.cloud.secretmanager.v1.Secret to delete in the format
* `projects/* /secrets/*`.
*/
// const name = 'abc123'
/**
* Optional. Etag of the Secret google.cloud.secretmanager.v1.Secret. The
* request succeeds if it matches the etag of the currently stored secret
* object. If the etag is omitted, the request succeeds.
*/
// const etag = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callDeleteSecret() {
// Construct request
const request = {
name,
};
// Run request
const response = await secretmanagerClient.deleteSecret(request);
console.log(response);
}
callDeleteSecret();
deleteSecret(request, options, callback)
deleteSecret(request: protos.google.cloud.secretmanager.v1.IDeleteSecretRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.secretmanager.v1.IDeleteSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteSecretRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.secretmanager.v1.IDeleteSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
deleteSecret(request, callback)
deleteSecret(request: protos.google.cloud.secretmanager.v1.IDeleteSecretRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.secretmanager.v1.IDeleteSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteSecretRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.secretmanager.v1.IDeleteSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
destroySecretVersion(request, options)
destroySecretVersion(request?: protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
(protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest | undefined),
{} | undefined
]>;Destroys a .
Sets the of the to and irrevocably destroys the secret data.
| Parameters | |
|---|---|
| Name | Description |
request |
IDestroySecretVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
(protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest | undefined),
{} | undefined
]> |
{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. |
/**
* 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
* SecretVersion google.cloud.secretmanager.v1.SecretVersion to destroy in
* the format `projects/* /secrets/* /versions/*` or
* `projects/* /locations/* /secrets/* /versions/*`.
*/
// const name = 'abc123'
/**
* Optional. Etag of the
* SecretVersion google.cloud.secretmanager.v1.SecretVersion. The request
* succeeds if it matches the etag of the currently stored secret version
* object. If the etag is omitted, the request succeeds.
*/
// const etag = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callDestroySecretVersion() {
// Construct request
const request = {
name,
};
// Run request
const response = await secretmanagerClient.destroySecretVersion(request);
console.log(response);
}
callDestroySecretVersion();
destroySecretVersion(request, options, callback)
destroySecretVersion(request: protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDestroySecretVersionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
destroySecretVersion(request, callback)
destroySecretVersion(request: protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDestroySecretVersionRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
disableSecretVersion(request, options)
disableSecretVersion(request?: protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
(protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest | undefined),
{} | undefined
]>;Disables a .
Sets the of the to .
| Parameters | |
|---|---|
| Name | Description |
request |
IDisableSecretVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
(protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest | undefined),
{} | undefined
]> |
{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. |
/**
* 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
* SecretVersion google.cloud.secretmanager.v1.SecretVersion to disable in
* the format `projects/* /secrets/* /versions/*` or
* `projects/* /locations/* /secrets/* /versions/*`.
*/
// const name = 'abc123'
/**
* Optional. Etag of the
* SecretVersion google.cloud.secretmanager.v1.SecretVersion. The request
* succeeds if it matches the etag of the currently stored secret version
* object. If the etag is omitted, the request succeeds.
*/
// const etag = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callDisableSecretVersion() {
// Construct request
const request = {
name,
};
// Run request
const response = await secretmanagerClient.disableSecretVersion(request);
console.log(response);
}
callDisableSecretVersion();
disableSecretVersion(request, options, callback)
disableSecretVersion(request: protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDisableSecretVersionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
disableSecretVersion(request, callback)
disableSecretVersion(request: protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDisableSecretVersionRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
enableManagedRotation(request, options)
enableManagedRotation(request?: protos.google.cloud.secretmanager.v1.IEnableManagedRotationRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
(protos.google.cloud.secretmanager.v1.IEnableManagedRotationRequest | undefined),
{} | undefined
]>;Enables the managed rotation feature for a . This method can only be triggered once for a secret. In order to do further rotations, RotateSecret should be used. This method will add a secret version and update the password in Cloud SQL.
| Parameters | |
|---|---|
| Name | Description |
request |
IEnableManagedRotationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
(protos.google.cloud.secretmanager.v1.IEnableManagedRotationRequest | undefined),
{} | undefined
]> |
{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. |
/**
* 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
* Secret google.cloud.secretmanager.v1.Secret to associate with the
* SecretVersion google.cloud.secretmanager.v1.SecretVersion in the format
* `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`.
*/
// const parent = 'abc123'
/**
* Credentials required for Cloud SQL DB for Single user Managed Rotation.
*/
// const cloudSqlSingleUserCredentials = {}
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callEnableManagedRotation() {
// Construct request
const request = {
parent,
};
// Run request
const response = await secretmanagerClient.enableManagedRotation(request);
console.log(response);
}
callEnableManagedRotation();
enableManagedRotation(request, options, callback)
enableManagedRotation(request: protos.google.cloud.secretmanager.v1.IEnableManagedRotationRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IEnableManagedRotationRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IEnableManagedRotationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IEnableManagedRotationRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
enableManagedRotation(request, callback)
enableManagedRotation(request: protos.google.cloud.secretmanager.v1.IEnableManagedRotationRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IEnableManagedRotationRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IEnableManagedRotationRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IEnableManagedRotationRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
enableSecretVersion(request, options)
enableSecretVersion(request?: protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
(protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest | undefined),
{} | undefined
]>;Enables a .
Sets the of the to .
| Parameters | |
|---|---|
| Name | Description |
request |
IEnableSecretVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
(protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest | undefined),
{} | undefined
]> |
{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. |
/**
* 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
* SecretVersion google.cloud.secretmanager.v1.SecretVersion to enable in
* the format `projects/* /secrets/* /versions/*` or
* `projects/* /locations/* /secrets/* /versions/*`.
*/
// const name = 'abc123'
/**
* Optional. Etag of the
* SecretVersion google.cloud.secretmanager.v1.SecretVersion. The request
* succeeds if it matches the etag of the currently stored secret version
* object. If the etag is omitted, the request succeeds.
*/
// const etag = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callEnableSecretVersion() {
// Construct request
const request = {
name,
};
// Run request
const response = await secretmanagerClient.enableSecretVersion(request);
console.log(response);
}
callEnableSecretVersion();
enableSecretVersion(request, options, callback)
enableSecretVersion(request: protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IEnableSecretVersionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
enableSecretVersion(request, callback)
enableSecretVersion(request: protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IEnableSecretVersionRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getIamPolicy(request, options)
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]>;Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set.
| Parameters | |
|---|---|
| Name | Description |
request |
IGetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy. Please see the documentation 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: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
* `GetIamPolicy`.
*/
// const options = {}
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callGetIamPolicy() {
// Construct request
const request = {
resource,
};
// Run request
const response = await secretmanagerClient.getIamPolicy(request);
console.log(response);
}
callGetIamPolicy();
getIamPolicy(request, options, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getIamPolicy(request, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
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.
| 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. |
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 |
|
getSecret(request, options)
getSecret(request?: protos.google.cloud.secretmanager.v1.IGetSecretRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecret,
protos.google.cloud.secretmanager.v1.IGetSecretRequest | undefined,
{} | undefined
]>;Gets metadata for a given .
| Parameters | |
|---|---|
| Name | Description |
request |
IGetSecretRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecret,
protos.google.cloud.secretmanager.v1.IGetSecretRequest | undefined,
{} | undefined
]> |
{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. |
/**
* 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
* Secret google.cloud.secretmanager.v1.Secret, in the format
* `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`.
*/
// const name = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callGetSecret() {
// Construct request
const request = {
name,
};
// Run request
const response = await secretmanagerClient.getSecret(request);
console.log(response);
}
callGetSecret();
getSecret(request, options, callback)
getSecret(request: protos.google.cloud.secretmanager.v1.IGetSecretRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.IGetSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetSecretRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.IGetSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getSecret(request, callback)
getSecret(request: protos.google.cloud.secretmanager.v1.IGetSecretRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.IGetSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetSecretRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.IGetSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getSecretVersion(request, options)
getSecretVersion(request?: protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest | undefined,
{} | undefined
]>;Gets metadata for a .
projects/* /secrets/* /versions/latest is an alias to the most recently created .
| Parameters | |
|---|---|
| Name | Description |
request |
IGetSecretVersionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest | undefined,
{} | undefined
]> |
{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. |
/**
* 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
* SecretVersion google.cloud.secretmanager.v1.SecretVersion in the format
* `projects/* /secrets/* /versions/*` or
* `projects/* /locations/* /secrets/* /versions/*`.
* `projects/* /secrets/* /versions/latest` or
* `projects/* /locations/* /secrets/* /versions/latest` is an alias to the most
* recently created
* SecretVersion google.cloud.secretmanager.v1.SecretVersion.
*/
// const name = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callGetSecretVersion() {
// Construct request
const request = {
name,
};
// Run request
const response = await secretmanagerClient.getSecretVersion(request);
console.log(response);
}
callGetSecretVersion();
getSecretVersion(request, options, callback)
getSecretVersion(request: protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetSecretVersionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getSecretVersion(request, callback)
getSecretVersion(request: protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetSecretVersionRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
| Returns | |
|---|---|
| Type | Description |
Promise<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub. |
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. |
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
listSecrets(request, options)
listSecrets(request?: protos.google.cloud.secretmanager.v1.IListSecretsRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecret[],
protos.google.cloud.secretmanager.v1.IListSecretsRequest | null,
protos.google.cloud.secretmanager.v1.IListSecretsResponse
]>;Lists .
| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecret[],
protos.google.cloud.secretmanager.v1.IListSecretsRequest | null,
protos.google.cloud.secretmanager.v1.IListSecretsResponse
]> |
{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 |
listSecrets(request, options, callback)
listSecrets(request: protos.google.cloud.secretmanager.v1.IListSecretsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.secretmanager.v1.IListSecretsRequest, protos.google.cloud.secretmanager.v1.IListSecretsResponse | null | undefined, protos.google.cloud.secretmanager.v1.ISecret>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.secretmanager.v1.IListSecretsRequest, protos.google.cloud.secretmanager.v1.IListSecretsResponse | null | undefined, protos.google.cloud.secretmanager.v1.ISecret>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listSecrets(request, callback)
listSecrets(request: protos.google.cloud.secretmanager.v1.IListSecretsRequest, callback: PaginationCallback<protos.google.cloud.secretmanager.v1.IListSecretsRequest, protos.google.cloud.secretmanager.v1.IListSecretsResponse | null | undefined, protos.google.cloud.secretmanager.v1.ISecret>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretsRequest
|
callback |
PaginationCallback<protos.google.cloud.secretmanager.v1.IListSecretsRequest, protos.google.cloud.secretmanager.v1.IListSecretsResponse | null | undefined, protos.google.cloud.secretmanager.v1.ISecret>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listSecretsAsync(request, options)
listSecretsAsync(request?: protos.google.cloud.secretmanager.v1.IListSecretsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.secretmanager.v1.ISecret>;Equivalent to listSecrets, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.secretmanager.v1.ISecret> |
{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. |
/**
* 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 project associated with the
* Secrets google.cloud.secretmanager.v1.Secret, in the format `projects/*`
* or `projects/* /locations/*`
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of results to be returned in a single page. If
* set to 0, the server decides the number of results to return. If the
* number is greater than 25000, it is capped at 25000.
*/
// const pageSize = 1234
/**
* Optional. Pagination token, returned earlier via
* ListSecretsResponse.next_page_token google.cloud.secretmanager.v1.ListSecretsResponse.next_page_token.
*/
// const pageToken = 'abc123'
/**
* Optional. Filter string, adhering to the rules in
* List-operation
* filtering (https://cloud.google.com/secret-manager/docs/filtering). List
* only secrets matching the filter. If filter is empty, all secrets are
* listed.
*/
// const filter = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callListSecrets() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = secretmanagerClient.listSecretsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListSecrets();
listSecretsStream(request, options)
listSecretsStream(request?: protos.google.cloud.secretmanager.v1.IListSecretsRequest, options?: CallOptions): Transform;Equivalent to listSecrets, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretsRequest
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 |
listSecretVersions(request, options)
listSecretVersions(request?: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion[],
protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest | null,
protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse
]>;Lists . This call does not return secret data.
| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretVersionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion[],
protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest | null,
protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse
]> |
{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 |
listSecretVersions(request, options, callback)
listSecretVersions(request: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse | null | undefined, protos.google.cloud.secretmanager.v1.ISecretVersion>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretVersionsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse | null | undefined, protos.google.cloud.secretmanager.v1.ISecretVersion>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listSecretVersions(request, callback)
listSecretVersions(request: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, callback: PaginationCallback<protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse | null | undefined, protos.google.cloud.secretmanager.v1.ISecretVersion>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretVersionsRequest
|
callback |
PaginationCallback<protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse | null | undefined, protos.google.cloud.secretmanager.v1.ISecretVersion>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listSecretVersionsAsync(request, options)
listSecretVersionsAsync(request?: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.secretmanager.v1.ISecretVersion>;Equivalent to listSecretVersions, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretVersionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.secretmanager.v1.ISecretVersion> |
{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. |
/**
* 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
* Secret google.cloud.secretmanager.v1.Secret associated with the
* SecretVersions google.cloud.secretmanager.v1.SecretVersion to list, in
* the format `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`.
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of results to be returned in a single page. If
* set to 0, the server decides the number of results to return. If the
* number is greater than 25000, it is capped at 25000.
*/
// const pageSize = 1234
/**
* Optional. Pagination token, returned earlier via
* ListSecretVersionsResponse.next_page_token .
*/
// const pageToken = 'abc123'
/**
* Optional. Filter string, adhering to the rules in
* List-operation
* filtering (https://cloud.google.com/secret-manager/docs/filtering). List
* only secret versions matching the filter. If filter is empty, all secret
* versions are listed.
*/
// const filter = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callListSecretVersions() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = secretmanagerClient.listSecretVersionsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListSecretVersions();
listSecretVersionsStream(request, options)
listSecretVersionsStream(request?: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, options?: CallOptions): Transform;Equivalent to listSecretVersions, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
IListSecretVersionsRequest
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 |
matchLocationFromProjectLocationSecretSecretVersionName(projectLocationSecretSecretVersionName)
matchLocationFromProjectLocationSecretSecretVersionName(projectLocationSecretSecretVersionName: string): string | number;Parse the location from ProjectLocationSecretSecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
projectLocationSecretSecretVersionName |
string
A fully-qualified path representing project_location_secret_secret_version resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromProjectLocationSecretsName(projectLocationSecretsName)
matchLocationFromProjectLocationSecretsName(projectLocationSecretsName: string): string | number;Parse the location from ProjectLocationSecrets resource.
| Parameter | |
|---|---|
| Name | Description |
projectLocationSecretsName |
string
A fully-qualified path representing project_location_secrets resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchProjectFromProjectLocationSecretSecretVersionName(projectLocationSecretSecretVersionName)
matchProjectFromProjectLocationSecretSecretVersionName(projectLocationSecretSecretVersionName: string): string | number;Parse the project from ProjectLocationSecretSecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
projectLocationSecretSecretVersionName |
string
A fully-qualified path representing project_location_secret_secret_version resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectLocationSecretsName(projectLocationSecretsName)
matchProjectFromProjectLocationSecretsName(projectLocationSecretsName: string): string | number;Parse the project from ProjectLocationSecrets resource.
| Parameter | |
|---|---|
| Name | Description |
projectLocationSecretsName |
string
A fully-qualified path representing project_location_secrets resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;Parse the project from Project resource.
| Parameter | |
|---|---|
| Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectSecretSecretVersionName(projectSecretSecretVersionName)
matchProjectFromProjectSecretSecretVersionName(projectSecretSecretVersionName: string): string | number;Parse the project from ProjectSecretSecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
projectSecretSecretVersionName |
string
A fully-qualified path representing project_secret_secret_version resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectSecretsName(projectSecretsName)
matchProjectFromProjectSecretsName(projectSecretsName: string): string | number;Parse the project from ProjectSecrets resource.
| Parameter | |
|---|---|
| Name | Description |
projectSecretsName |
string
A fully-qualified path representing project_secrets resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromSecretName(secretName)
matchProjectFromSecretName(secretName: string): string | number;Parse the project from Secret resource.
| Parameter | |
|---|---|
| Name | Description |
secretName |
string
A fully-qualified path representing Secret resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromSecretVersionName(secretVersionName)
matchProjectFromSecretVersionName(secretVersionName: string): string | number;Parse the project from SecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
secretVersionName |
string
A fully-qualified path representing SecretVersion resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromTopicName(topicName)
matchProjectFromTopicName(topicName: string): string | number;Parse the project from Topic resource.
| Parameter | |
|---|---|
| Name | Description |
topicName |
string
A fully-qualified path representing Topic resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchSecretFromProjectLocationSecretSecretVersionName(projectLocationSecretSecretVersionName)
matchSecretFromProjectLocationSecretSecretVersionName(projectLocationSecretSecretVersionName: string): string | number;Parse the secret from ProjectLocationSecretSecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
projectLocationSecretSecretVersionName |
string
A fully-qualified path representing project_location_secret_secret_version resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the secret. |
matchSecretFromProjectLocationSecretsName(projectLocationSecretsName)
matchSecretFromProjectLocationSecretsName(projectLocationSecretsName: string): string | number;Parse the secret from ProjectLocationSecrets resource.
| Parameter | |
|---|---|
| Name | Description |
projectLocationSecretsName |
string
A fully-qualified path representing project_location_secrets resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the secret. |
matchSecretFromProjectSecretSecretVersionName(projectSecretSecretVersionName)
matchSecretFromProjectSecretSecretVersionName(projectSecretSecretVersionName: string): string | number;Parse the secret from ProjectSecretSecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
projectSecretSecretVersionName |
string
A fully-qualified path representing project_secret_secret_version resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the secret. |
matchSecretFromProjectSecretsName(projectSecretsName)
matchSecretFromProjectSecretsName(projectSecretsName: string): string | number;Parse the secret from ProjectSecrets resource.
| Parameter | |
|---|---|
| Name | Description |
projectSecretsName |
string
A fully-qualified path representing project_secrets resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the secret. |
matchSecretFromSecretName(secretName)
matchSecretFromSecretName(secretName: string): string | number;Parse the secret from Secret resource.
| Parameter | |
|---|---|
| Name | Description |
secretName |
string
A fully-qualified path representing Secret resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the secret. |
matchSecretFromSecretVersionName(secretVersionName)
matchSecretFromSecretVersionName(secretVersionName: string): string | number;Parse the secret from SecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
secretVersionName |
string
A fully-qualified path representing SecretVersion resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the secret. |
matchSecretVersionFromProjectLocationSecretSecretVersionName(projectLocationSecretSecretVersionName)
matchSecretVersionFromProjectLocationSecretSecretVersionName(projectLocationSecretSecretVersionName: string): string | number;Parse the secret_version from ProjectLocationSecretSecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
projectLocationSecretSecretVersionName |
string
A fully-qualified path representing project_location_secret_secret_version resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the secret_version. |
matchSecretVersionFromProjectSecretSecretVersionName(projectSecretSecretVersionName)
matchSecretVersionFromProjectSecretSecretVersionName(projectSecretSecretVersionName: string): string | number;Parse the secret_version from ProjectSecretSecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
projectSecretSecretVersionName |
string
A fully-qualified path representing project_secret_secret_version resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the secret_version. |
matchSecretVersionFromSecretVersionName(secretVersionName)
matchSecretVersionFromSecretVersionName(secretVersionName: string): string | number;Parse the secret_version from SecretVersion resource.
| Parameter | |
|---|---|
| Name | Description |
secretVersionName |
string
A fully-qualified path representing SecretVersion resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the secret_version. |
matchTopicFromTopicName(topicName)
matchTopicFromTopicName(topicName: string): string | number;Parse the topic from Topic resource.
| Parameter | |
|---|---|
| Name | Description |
topicName |
string
A fully-qualified path representing Topic resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the topic. |
projectLocationSecretSecretVersionPath(project, location, secret, secretVersion)
projectLocationSecretSecretVersionPath(project: string, location: string, secret: string, secretVersion: string): string;Return a fully-qualified projectLocationSecretSecretVersion resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
secret |
string
|
secretVersion |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
projectLocationSecretsPath(project, location, secret)
projectLocationSecretsPath(project: string, location: string, secret: string): string;Return a fully-qualified projectLocationSecrets resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
secret |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
projectPath(project)
projectPath(project: string): string;Return a fully-qualified project resource name string.
| Parameter | |
|---|---|
| Name | Description |
project |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
projectSecretSecretVersionPath(project, secret, secretVersion)
projectSecretSecretVersionPath(project: string, secret: string, secretVersion: string): string;Return a fully-qualified projectSecretSecretVersion resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
secret |
string
|
secretVersion |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
projectSecretsPath(project, secret)
projectSecretsPath(project: string, secret: string): string;Return a fully-qualified projectSecrets resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
secret |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
rotateSecret(request, options)
rotateSecret(request?: protos.google.cloud.secretmanager.v1.IRotateSecretRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
protos.google.cloud.secretmanager.v1.IRotateSecretRequest | undefined,
{} | undefined
]>;Do a managed rotation for a . This can only be triggered after Managed rotation has been enabled. This method will add a secret version and update the password in Cloud SQL.
| Parameters | |
|---|---|
| Name | Description |
request |
IRotateSecretRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecretVersion,
protos.google.cloud.secretmanager.v1.IRotateSecretRequest | undefined,
{} | undefined
]> |
{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. |
/**
* 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
* Secret google.cloud.secretmanager.v1.Secret to associate with the
* SecretVersion google.cloud.secretmanager.v1.SecretVersion in the format
* `projects/* /secrets/*` or `projects/* /locations/* /secrets/*`.
*/
// const parent = 'abc123'
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callRotateSecret() {
// Construct request
const request = {
parent,
};
// Run request
const response = await secretmanagerClient.rotateSecret(request);
console.log(response);
}
callRotateSecret();
rotateSecret(request, options, callback)
rotateSecret(request: protos.google.cloud.secretmanager.v1.IRotateSecretRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IRotateSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IRotateSecretRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IRotateSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
rotateSecret(request, callback)
rotateSecret(request: protos.google.cloud.secretmanager.v1.IRotateSecretRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IRotateSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IRotateSecretRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecretVersion, protos.google.cloud.secretmanager.v1.IRotateSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
secretPath(project, secret)
secretPath(project: string, secret: string): string;Return a fully-qualified project resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
secret |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
secretVersionPath(project, secret, secretVersion)
secretVersionPath(project: string, secret: string, secretVersion: string): string;Return a fully-qualified secretVersion resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
secret |
string
|
secretVersion |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
setIamPolicy(request, options)
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]>;Sets the access control policy on the specified secret. Replaces any existing policy.
Permissions on are enforced according to the policy set on the associated .
| Parameters | |
|---|---|
| Name | Description |
request |
ISetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy. Please see the documentation 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: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* REQUIRED: The complete policy to be applied to the `resource`. The size of
* the policy is limited to a few 10s of KB. An empty policy is a
* valid policy but certain Cloud Platform services (such as Projects)
* might reject them.
*/
// const policy = {}
/**
* OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
* the fields in the mask will be modified. If no mask is provided, the
* following default mask is used:
* `paths: "bindings, etag"`
*/
// const updateMask = {}
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callSetIamPolicy() {
// Construct request
const request = {
resource,
policy,
};
// Run request
const response = await secretmanagerClient.setIamPolicy(request);
console.log(response);
}
callSetIamPolicy();
setIamPolicy(request, options, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
setIamPolicy(request, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ISetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
testIamPermissions(request, options)
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]>;Returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns 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 |
ITestIamPermissionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing TestIamPermissionsResponse. Please see the documentation 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: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
* IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).
*/
// const permissions = ['abc','def']
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callTestIamPermissions() {
// Construct request
const request = {
resource,
permissions,
};
// Run request
const response = await secretmanagerClient.testIamPermissions(request);
console.log(response);
}
callTestIamPermissions();
testIamPermissions(request, options, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ITestIamPermissionsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
testIamPermissions(request, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ITestIamPermissionsRequest
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
topicPath(project, topic)
topicPath(project: string, topic: string): string;Return a fully-qualified topic resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
topic |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
updateSecret(request, options)
updateSecret(request?: protos.google.cloud.secretmanager.v1.IUpdateSecretRequest, options?: CallOptions): Promise<[
protos.google.cloud.secretmanager.v1.ISecret,
protos.google.cloud.secretmanager.v1.IUpdateSecretRequest | undefined,
{} | undefined
]>;Updates metadata of an existing .
| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateSecretRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.secretmanager.v1.ISecret,
protos.google.cloud.secretmanager.v1.IUpdateSecretRequest | undefined,
{} | undefined
]> |
{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. |
/**
* 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. Secret google.cloud.secretmanager.v1.Secret with updated field
* values.
*/
// const secret = {}
/**
* Required. Specifies the fields to be updated.
*/
// const updateMask = {}
// Imports the Secretmanager library
const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1;
// Instantiates a client
const secretmanagerClient = new SecretManagerServiceClient();
async function callUpdateSecret() {
// Construct request
const request = {
secret,
updateMask,
};
// Run request
const response = await secretmanagerClient.updateSecret(request);
console.log(response);
}
callUpdateSecret();
updateSecret(request, options, callback)
updateSecret(request: protos.google.cloud.secretmanager.v1.IUpdateSecretRequest, options: CallOptions, callback: Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.IUpdateSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateSecretRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.IUpdateSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
updateSecret(request, callback)
updateSecret(request: protos.google.cloud.secretmanager.v1.IUpdateSecretRequest, callback: Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.IUpdateSecretRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateSecretRequest
|
callback |
Callback<protos.google.cloud.secretmanager.v1.ISecret, protos.google.cloud.secretmanager.v1.IUpdateSecretRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|