Class v1.AlloyDBAdminClient (1.10.1)

Service describing handlers for resources v1

Package

@google-cloud/alloydb

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of AlloyDBAdminClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

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

Properties

alloyDBAdminStub

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

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;

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

backupPath(project, location, backup)

backupPath(project: string, location: string, backup: string): string;

Return a fully-qualified backup resource name string.

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

{string} Resource name string.

batchCreateInstances(request, options)

batchCreateInstances(request?: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates new instances under the given project, location and cluster. There can be only one primary instance in a cluster. If the primary instance exists in the cluster as well as this request, then API will throw an error. The primary instance should exist before any read pool instance is created. If the primary instance is a part of the request payload, then the API will take care of creating instances in the correct order. This method is here to support Google-internal use cases, and is not meant for external customers to consume. Please do not start relying on it; its behavior is subject to change without notice.

Parameters
Name Description
request IBatchCreateInstancesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent resource.
   */
  // const parent = 'abc123'
  /**
   *  Required. Resources being created.
   */
  // const requests = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callBatchCreateInstances() {
    // Construct request
    const request = {
      parent,
      requests,
    };

    // Run request
    const [operation] = await alloydbClient.batchCreateInstances(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBatchCreateInstances();

batchCreateInstances(request, options, callback)

batchCreateInstances(request: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBatchCreateInstancesRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

batchCreateInstances(request, callback)

batchCreateInstances(request: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBatchCreateInstancesRequest
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

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.

Parameters
Name Description
request CancelOperationRequest

The request object that will be sent.

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.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkBatchCreateInstancesProgress(name)

checkBatchCreateInstancesProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.BatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.BatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent resource.
   */
  // const parent = 'abc123'
  /**
   *  Required. Resources being created.
   */
  // const requests = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callBatchCreateInstances() {
    // Construct request
    const request = {
      parent,
      requests,
    };

    // Run request
    const [operation] = await alloydbClient.batchCreateInstances(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBatchCreateInstances();

checkCreateBackupProgress(name)

checkCreateBackupProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Backup, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Backup, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Value for parent.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const backupId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const backup = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, the backend validates the request, but doesn't actually
   *  execute it.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateBackup() {
    // Construct request
    const request = {
      parent,
      backupId,
      backup,
    };

    // Run request
    const [operation] = await alloydbClient.createBackup(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateBackup();

checkCreateClusterProgress(name)

checkCreateClusterProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The location of the new cluster. For the required format, see the
   *  comment on the Cluster.name field.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const clusterId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const cluster = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateCluster() {
    // Construct request
    const request = {
      parent,
      clusterId,
      cluster,
    };

    // Run request
    const [operation] = await alloydbClient.createCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateCluster();

checkCreateInstanceProgress(name)

checkCreateInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const instanceId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const instance = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateInstance() {
    // Construct request
    const request = {
      parent,
      instanceId,
      instance,
    };

    // Run request
    const [operation] = await alloydbClient.createInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateInstance();

checkCreateSecondaryClusterProgress(name)

checkCreateSecondaryClusterProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The location of the new cluster. For the required
   *  format, see the comment on the Cluster.name field.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object (the secondary cluster).
   */
  // const clusterId = 'abc123'
  /**
   *  Required. Configuration of the requesting object (the secondary cluster).
   */
  // const cluster = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateSecondaryCluster() {
    // Construct request
    const request = {
      parent,
      clusterId,
      cluster,
    };

    // Run request
    const [operation] = await alloydbClient.createSecondaryCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateSecondaryCluster();

checkCreateSecondaryInstanceProgress(name)

checkCreateSecondaryInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const instanceId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const instance = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateSecondaryInstance() {
    // Construct request
    const request = {
      parent,
      instanceId,
      instance,
    };

    // Run request
    const [operation] = await alloydbClient.createSecondaryInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateSecondaryInstance();

checkDeleteBackupProgress(name)

checkDeleteBackupProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the resource. For the required format, see the comment on
   *  the Backup.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, the backend validates the request, but doesn't actually
   *  execute it.
   */
  // const validateOnly = true
  /**
   *  Optional. The current etag of the Backup.
   *  If an etag is provided and does not match the current etag of the Backup,
   *  deletion will be blocked and an ABORTED error will be returned.
   */
  // const etag = 'abc123'

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callDeleteBackup() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.deleteBackup(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteBackup();

checkDeleteClusterProgress(name)

checkDeleteClusterProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Cluster.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. The current etag of the Cluster.
   *  If an etag is provided and does not match the current etag of the Cluster,
   *  deletion will be blocked and an ABORTED error will be returned.
   */
  // const etag = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true
  /**
   *  Optional. Whether to cascade delete child instances for given cluster.
   */
  // const force = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callDeleteCluster() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.deleteCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteCluster();

checkDeleteInstanceProgress(name)

checkDeleteInstanceProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. The current etag of the Instance.
   *  If an etag is provided and does not match the current etag of the Instance,
   *  deletion will be blocked and an ABORTED error will be returned.
   */
  // const etag = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callDeleteInstance() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.deleteInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteInstance();

checkFailoverInstanceProgress(name)

checkFailoverInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callFailoverInstance() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.failoverInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callFailoverInstance();

checkInjectFaultProgress(name)

checkInjectFaultProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The type of fault to be injected in an instance.
   */
  // const faultType = {}
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callInjectFault() {
    // Construct request
    const request = {
      faultType,
      name,
    };

    // Run request
    const [operation] = await alloydbClient.injectFault(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callInjectFault();

checkPromoteClusterProgress(name)

checkPromoteClusterProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Cluster.name field
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. The current etag of the Cluster.
   *  If an etag is provided and does not match the current etag of the Cluster,
   *  deletion will be blocked and an ABORTED error will be returned.
   */
  // const etag = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callPromoteCluster() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.promoteCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callPromoteCluster();

checkRestartInstanceProgress(name)

checkRestartInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true
  /**
   *  Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to
   *  restart upon. Applicable only to read instances.
   */
  // const nodeIds = ['abc','def']

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callRestartInstance() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.restartInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callRestartInstance();

checkRestoreClusterProgress(name)

checkRestoreClusterProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Backup source.
   */
  // const backupSource = {}
  /**
   *  ContinuousBackup source. Continuous backup needs to be enabled in the
   *  source cluster for this operation to succeed.
   */
  // const continuousBackupSource = {}
  /**
   *  Required. The name of the parent resource. For the required format, see the
   *  comment on the Cluster.name field.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const clusterId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const cluster = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callRestoreCluster() {
    // Construct request
    const request = {
      parent,
      clusterId,
      cluster,
    };

    // Run request
    const [operation] = await alloydbClient.restoreCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callRestoreCluster();

checkSwitchoverClusterProgress(name)

checkSwitchoverClusterProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Cluster.name field
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callSwitchoverCluster() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.switchoverCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callSwitchoverCluster();

checkUpdateBackupProgress(name)

checkUpdateBackupProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Backup, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Backup, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. Field mask is used to specify the fields to be overwritten in the
   *  Backup resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request. A field will be overwritten if it is in the mask. If the
   *  user does not provide a mask then all fields will be overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated
   */
  // const backup = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, the backend validates the request, but doesn't actually
   *  execute it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set to true, update succeeds even if instance is not found. In
   *  that case, a new backup is created and `update_mask` is ignored.
   */
  // const allowMissing = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callUpdateBackup() {
    // Construct request
    const request = {
      backup,
    };

    // Run request
    const [operation] = await alloydbClient.updateBackup(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateBackup();

checkUpdateClusterProgress(name)

checkUpdateClusterProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. Field mask is used to specify the fields to be overwritten in the
   *  Cluster resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request. A field will be overwritten if it is in the mask. If the
   *  user does not provide a mask then all fields will be overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated
   */
  // const cluster = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true
  /**
   *  Optional. If set to true, update succeeds even if cluster is not found. In
   *  that case, a new cluster is created and `update_mask` is ignored.
   */
  // const allowMissing = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callUpdateCluster() {
    // Construct request
    const request = {
      cluster,
    };

    // Run request
    const [operation] = await alloydbClient.updateCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateCluster();

checkUpdateInstanceProgress(name)

checkUpdateInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. Field mask is used to specify the fields to be overwritten in the
   *  Instance resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request. A field will be overwritten if it is in the mask. If the
   *  user does not provide a mask then all fields will be overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated
   */
  // const instance = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true
  /**
   *  Optional. If set to true, update succeeds even if instance is not found. In
   *  that case, a new instance is created and `update_mask` is ignored.
   */
  // const allowMissing = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callUpdateInstance() {
    // Construct request
    const request = {
      instance,
    };

    // Run request
    const [operation] = await alloydbClient.updateInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateInstance();

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.

clusterPath(project, location, cluster)

clusterPath(project: string, location: string, cluster: string): string;

Return a fully-qualified cluster resource name string.

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

{string} Resource name string.

connectionInfoPath(project, location, cluster, instance)

connectionInfoPath(project: string, location: string, cluster: string, instance: string): string;

Return a fully-qualified connectionInfo resource name string.

Parameters
Name Description
project string
location string
cluster string
instance string
Returns
Type Description
string

{string} Resource name string.

createBackup(request, options)

createBackup(request?: protos.google.cloud.alloydb.v1.ICreateBackupRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new Backup in a given project and location.

Parameters
Name Description
request ICreateBackupRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Value for parent.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const backupId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const backup = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, the backend validates the request, but doesn't actually
   *  execute it.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateBackup() {
    // Construct request
    const request = {
      parent,
      backupId,
      backup,
    };

    // Run request
    const [operation] = await alloydbClient.createBackup(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateBackup();

createBackup(request, options, callback)

createBackup(request: protos.google.cloud.alloydb.v1.ICreateBackupRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateBackupRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createBackup(request, callback)

createBackup(request: protos.google.cloud.alloydb.v1.ICreateBackupRequest, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateBackupRequest
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createCluster(request, options)

createCluster(request?: protos.google.cloud.alloydb.v1.ICreateClusterRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new Cluster in a given project and location.

Parameters
Name Description
request ICreateClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The location of the new cluster. For the required format, see the
   *  comment on the Cluster.name field.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const clusterId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const cluster = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateCluster() {
    // Construct request
    const request = {
      parent,
      clusterId,
      cluster,
    };

    // Run request
    const [operation] = await alloydbClient.createCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateCluster();

createCluster(request, options, callback)

createCluster(request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateClusterRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createCluster(request, callback)

createCluster(request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateClusterRequest
callback Callback<LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createInstance(request, options)

createInstance(request?: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new Instance in a given project and location.

Parameters
Name Description
request ICreateInstanceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const instanceId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const instance = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateInstance() {
    // Construct request
    const request = {
      parent,
      instanceId,
      instance,
    };

    // Run request
    const [operation] = await alloydbClient.createInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateInstance();

createInstance(request, options, callback)

createInstance(request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createInstance(request, callback)

createInstance(request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateInstanceRequest
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createSecondaryCluster(request, options)

createSecondaryCluster(request?: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.

Parameters
Name Description
request ICreateSecondaryClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The location of the new cluster. For the required
   *  format, see the comment on the Cluster.name field.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object (the secondary cluster).
   */
  // const clusterId = 'abc123'
  /**
   *  Required. Configuration of the requesting object (the secondary cluster).
   */
  // const cluster = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateSecondaryCluster() {
    // Construct request
    const request = {
      parent,
      clusterId,
      cluster,
    };

    // Run request
    const [operation] = await alloydbClient.createSecondaryCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateSecondaryCluster();

createSecondaryCluster(request, options, callback)

createSecondaryCluster(request: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateSecondaryClusterRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createSecondaryCluster(request, callback)

createSecondaryCluster(request: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateSecondaryClusterRequest
callback Callback<LROperation<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createSecondaryInstance(request, options)

createSecondaryInstance(request?: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new SECONDARY Instance in a given project and location.

Parameters
Name Description
request ICreateSecondaryInstanceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const instanceId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const instance = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateSecondaryInstance() {
    // Construct request
    const request = {
      parent,
      instanceId,
      instance,
    };

    // Run request
    const [operation] = await alloydbClient.createSecondaryInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateSecondaryInstance();

createSecondaryInstance(request, options, callback)

createSecondaryInstance(request: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateSecondaryInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createSecondaryInstance(request, callback)

createSecondaryInstance(request: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateSecondaryInstanceRequest
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createUser(request, options)

createUser(request?: protos.google.cloud.alloydb.v1.ICreateUserRequest, options?: CallOptions): Promise<[
        protos.google.cloud.alloydb.v1.IUser,
        protos.google.cloud.alloydb.v1.ICreateUserRequest | undefined,
        {} | undefined
    ]>;

Creates a new User in a given project, location, and cluster.

Parameters
Name Description
request ICreateUserRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.alloydb.v1.IUser, protos.google.cloud.alloydb.v1.ICreateUserRequest | 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Value for parent.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID of the requesting object.
   */
  // const userId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const user = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, the backend validates the request, but doesn't actually
   *  execute it.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callCreateUser() {
    // Construct request
    const request = {
      parent,
      userId,
      user,
    };

    // Run request
    const response = await alloydbClient.createUser(request);
    console.log(response);
  }

  callCreateUser();

createUser(request, options, callback)

createUser(request: protos.google.cloud.alloydb.v1.ICreateUserRequest, options: CallOptions, callback: Callback<protos.google.cloud.alloydb.v1.IUser, protos.google.cloud.alloydb.v1.ICreateUserRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateUserRequest
options CallOptions
callback Callback<protos.google.cloud.alloydb.v1.IUser, protos.google.cloud.alloydb.v1.ICreateUserRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createUser(request, callback)

createUser(request: protos.google.cloud.alloydb.v1.ICreateUserRequest, callback: Callback<protos.google.cloud.alloydb.v1.IUser, protos.google.cloud.alloydb.v1.ICreateUserRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateUserRequest
callback Callback<protos.google.cloud.alloydb.v1.IUser, protos.google.cloud.alloydb.v1.ICreateUserRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

databasePath(project, location, cluster, database)

databasePath(project: string, location: string, cluster: string, database: string): string;

Return a fully-qualified database resource name string.

Parameters
Name Description
project string
location string
cluster string
database string
Returns
Type Description
string

{string} Resource name string.

deleteBackup(request, options)

deleteBackup(request?: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single Backup.

Parameters
Name Description
request IDeleteBackupRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the resource. For the required format, see the comment on
   *  the Backup.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, the backend validates the request, but doesn't actually
   *  execute it.
   */
  // const validateOnly = true
  /**
   *  Optional. The current etag of the Backup.
   *  If an etag is provided and does not match the current etag of the Backup,
   *  deletion will be blocked and an ABORTED error will be returned.
   */
  // const etag = 'abc123'

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callDeleteBackup() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.deleteBackup(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteBackup();

deleteBackup(request, options, callback)

deleteBackup(request: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteBackupRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteBackup(request, callback)

deleteBackup(request: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteBackupRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteCluster(request, options)

deleteCluster(request?: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single Cluster.

Parameters
Name Description
request IDeleteClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Cluster.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. The current etag of the Cluster.
   *  If an etag is provided and does not match the current etag of the Cluster,
   *  deletion will be blocked and an ABORTED error will be returned.
   */
  // const etag = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true
  /**
   *  Optional. Whether to cascade delete child instances for given cluster.
   */
  // const force = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callDeleteCluster() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.deleteCluster(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteCluster();

deleteCluster(request, options, callback)

deleteCluster(request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteClusterRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteCluster(request, callback)

deleteCluster(request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteClusterRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteInstance(request, options)

deleteInstance(request?: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single Instance.

Parameters
Name Description
request IDeleteInstanceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. The current etag of the Instance.
   *  If an etag is provided and does not match the current etag of the Instance,
   *  deletion will be blocked and an ABORTED error will be returned.
   */
  // const etag = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callDeleteInstance() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.deleteInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteInstance();

deleteInstance(request, options, callback)

deleteInstance(request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteInstance(request, callback)

deleteInstance(request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteInstanceRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

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.

Parameters
Name Description
request DeleteOperationRequest

The request object that will be sent.

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.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});

deleteUser(request, options)

deleteUser(request?: protos.google.cloud.alloydb.v1.IDeleteUserRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.cloud.alloydb.v1.IDeleteUserRequest | undefined,
        {} | undefined
    ]>;

Deletes a single User.

Parameters
Name Description
request IDeleteUserRequest

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.alloydb.v1.IDeleteUserRequest | 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the User.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, the backend validates the request, but doesn't actually
   *  execute it.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callDeleteUser() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await alloydbClient.deleteUser(request);
    console.log(response);
  }

  callDeleteUser();

deleteUser(request, options, callback)

deleteUser(request: protos.google.cloud.alloydb.v1.IDeleteUserRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IDeleteUserRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteUserRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IDeleteUserRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteUser(request, callback)

deleteUser(request: protos.google.cloud.alloydb.v1.IDeleteUserRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IDeleteUserRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteUserRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IDeleteUserRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

executeSql(request, options)

executeSql(request?: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, options?: CallOptions): Promise<[
        protos.google.cloud.alloydb.v1.IExecuteSqlResponse,
        protos.google.cloud.alloydb.v1.IExecuteSqlRequest | undefined,
        {} | undefined
    ]>;

Executes a SQL statement in a database inside an AlloyDB instance.

Parameters
Name Description
request IExecuteSqlRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.alloydb.v1.IExecuteSqlResponse, protos.google.cloud.alloydb.v1.IExecuteSqlRequest | undefined, {} | undefined ]>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The database native user’s password.
   */
  // const password = 'abc123'
  /**
   *  Required. The instance where the SQL will be executed. For the required
   *  format, see the comment on the Instance.name field.
   */
  // const instance = 'abc123'
  /**
   *  Required. Name of the database where the query will be executed.
   *  Note - Value provided should be the same as expected from `SELECT
   *  current_database();` and NOT as a resource reference.
   */
  // const database = 'abc123'
  /**
   *  Required. Database user to be used for executing the SQL.
   *  Note - Value provided should be the same as expected from
   *  `SELECT current_user;` and NOT as a resource reference.
   */
  // const user = 'abc123'
  /**
   *  Required. SQL statement to execute on database. Any valid statement is
   *  permitted, including DDL, DML, DQL statements.
   */
  // const sqlStatement = 'abc123'

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callExecuteSql() {
    // Construct request
    const request = {
      instance,
      database,
      user,
      sqlStatement,
    };

    // Run request
    const response = await alloydbClient.executeSql(request);
    console.log(response);
  }

  callExecuteSql();

executeSql(request, options, callback)

executeSql(request: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, options: CallOptions, callback: Callback<protos.google.cloud.alloydb.v1.IExecuteSqlResponse, protos.google.cloud.alloydb.v1.IExecuteSqlRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IExecuteSqlRequest
options CallOptions
callback Callback<protos.google.cloud.alloydb.v1.IExecuteSqlResponse, protos.google.cloud.alloydb.v1.IExecuteSqlRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

executeSql(request, callback)

executeSql(request: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, callback: Callback<protos.google.cloud.alloydb.v1.IExecuteSqlResponse, protos.google.cloud.alloydb.v1.IExecuteSqlRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IExecuteSqlRequest
callback Callback<protos.google.cloud.alloydb.v1.IExecuteSqlResponse, protos.google.cloud.alloydb.v1.IExecuteSqlRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

failoverInstance(request, options)

failoverInstance(request?: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.

Parameters
Name Description
request IFailoverInstanceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Instance.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, performs request validation, for example, permission
   *  checks and any other type of validation, but does not actually execute the
   *  create request.
   */
  // const validateOnly = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callFailoverInstance() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await alloydbClient.failoverInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callFailoverInstance();

failoverInstance(request, options, callback)

failoverInstance(request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFailoverInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

failoverInstance(request, callback)

failoverInstance(request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, callback: Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFailoverInstanceRequest
callback Callback<LROperation<protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

generateClientCertificate(request, options)

generateClientCertificate(request?: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, options?: CallOptions): Promise<[
        protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse,
        (protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest | undefined),
        {} | undefined
    ]>;

Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to support AlloyDB connectors and the Auth Proxy client. The endpoint's behavior is subject to change without notice, so do not rely on its behavior remaining constant. Future changes will not break AlloyDB connectors or the Auth Proxy client.

Parameters
Name Description
request IGenerateClientCertificateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, (protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest | undefined), {} | undefined ]>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent resource. The required format is:
   *   * projects/{project}/locations/{location}/clusters/{cluster}
   */
  // const parent = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server ignores the
   *  request if it has already been completed. The server guarantees that for at
   *  least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if the original operation with the same request ID
   *  was received, and if so, ignores the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. An optional hint to the endpoint to generate the client
   *  certificate with the requested duration. The duration can be from 1 hour to
   *  24 hours. The endpoint may or may not honor the hint. If the hint is left
   *  unspecified or is not honored, then the endpoint will pick an appropriate
   *  default duration.
   */
  // const certDuration = {}
  /**
   *  Optional. The public key from the client.
   */
  // const publicKey = 'abc123'
  /**
   *  Optional. An optional hint to the endpoint to generate a client
   *  ceritificate that can be used by AlloyDB connectors to exchange additional
   *  metadata with the server after TLS handshake.
   */
  // const useMetadataExchange = true

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callGenerateClientCertificate() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const response = await alloydbClient.generateClientCertificate(request);
    console.log(response);
  }

  callGenerateClientCertificate();

generateClientCertificate(request, options, callback)

generateClientCertificate(request: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, options: CallOptions, callback: Callback<protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGenerateClientCertificateRequest
options CallOptions
callback Callback<protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

generateClientCertificate(request, callback)

generateClientCertificate(request: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, callback: Callback<protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGenerateClientCertificateRequest
callback Callback<protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getBackup(request, options)

getBackup(request?: protos.google.cloud.alloydb.v1.IGetBackupRequest, options?: CallOptions): Promise<[
        protos.google.cloud.alloydb.v1.IBackup,
        protos.google.cloud.alloydb.v1.IGetBackupRequest | undefined,
        {} | undefined
    ]>;

Gets details of a single Backup.

Parameters
Name Description
request IGetBackupRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IGetBackupRequest | 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the resource
   */
  // const name = 'abc123'

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callGetBackup() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await alloydbClient.getBackup(request);
    console.log(response);
  }

  callGetBackup();

getBackup(request, options, callback)

getBackup(request: protos.google.cloud.alloydb.v1.IGetBackupRequest, options: CallOptions, callback: Callback<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IGetBackupRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetBackupRequest
options CallOptions
callback Callback<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IGetBackupRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getBackup(request, callback)

getBackup(request: protos.google.cloud.alloydb.v1.IGetBackupRequest, callback: Callback<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IGetBackupRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetBackupRequest
callback Callback<protos.google.cloud.alloydb.v1.IBackup, protos.google.cloud.alloydb.v1.IGetBackupRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getCluster(request, options)

getCluster(request?: protos.google.cloud.alloydb.v1.IGetClusterRequest, options?: CallOptions): Promise<[
        protos.google.cloud.alloydb.v1.ICluster,
        protos.google.cloud.alloydb.v1.IGetClusterRequest | undefined,
        {} | undefined
    ]>;

Gets details of a single Cluster.

Parameters
Name Description
request IGetClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IGetClusterRequest | 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.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the resource. For the required format, see the
   *  comment on the Cluster.name field.
   */
  // const name = 'abc123'
  /**
   *  Optional. The view of the cluster to return. Returns all default fields if
   *  not set.
   */
  // const view = {}

  // Imports the Alloydb library
  const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1;

  // Instantiates a client
  const alloydbClient = new AlloyDBAdminClient();

  async function callGetCluster() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await alloydbClient.getCluster(request);
    console.log(response);
  }

  callGetCluster();

getCluster(request, options, callback)

getCluster(request: protos.google.cloud.alloydb.v1.IGetClusterRequest, options: CallOptions, callback: Callback<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IGetClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetClusterRequest
options CallOptions
callback Callback<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IGetClusterRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getCluster(request, callback)

getCluster(request: protos.google.cloud.alloydb.v1.IGetClusterRequest, callback: Callback<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IGetClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetClusterRequest
callback Callback<protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IGetClusterRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getConnectionInfo(request, options)

getConnectionInfo(request?: protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest, options?: CallOptions): Promise<[
        protos.google.cloud.alloydb.v1.IConnectionInfo,
        protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest | undefined,
        {} | undefined
    ]>;

Get instance metadata used for a connection.

Parameters
Name Description
request IGetConnectionInfoRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.alloydb.v1.IConnectionInfo, protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest | undefined, {} | undefined ]>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent resource. The required format is:
   *  projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
   */
  // const parent = 'abc123'
  /**
   *  Optional. An optional request ID to