BigtableTableAdminClient

BigtableTableAdminClient

Service for creating, configuring, and deleting Cloud Bigtable tables.

Provides access to the table schemas only, not the data stored within the tables.

Constructor

new BigtableTableAdminClient(optionsopt, gaxInstanceopt)

Construct an instance of BigtableTableAdminClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. The options accepted by the constructor are described in detail in this document. The common options are:

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

clientConfig gax.ClientConfig <optional>

Client configuration override. Follows the structure of gapicConfig.

fallback boolean | "rest" <optional>

Use HTTP fallback mode. Pass "rest" to use HTTP/1.1 REST API instead of gRPC. For more information, please check the documentation.

gaxInstance gax <optional>

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 BigtableTableAdminClient({fallback: 'rest'}, gax);

Members

apiEndpoint

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

port

The port for this API service.

scopes

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

The DNS address for this API service.

Methods

appProfilePath(project, instance, app_profile) → {string}

Return a fully-qualified appProfile resource name string.

Parameters:
Name Type Description
project string
instance string
app_profile string
Returns:
Type Description
string

Resource name string.

backupPath(project, instance, cluster, backup) → {string}

Return a fully-qualified backup resource name string.

Parameters:
Name Type Description
project string
instance string
cluster string
backup string
Returns:
Type Description
string

Resource name string.

(async) checkCreateBackupProgress(name) → {Promise}

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

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
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. This must be one of the clusters in the instance in which this
   *  table is located. The backup will be stored in this cluster. Values are
   *  of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The id of the backup to be created. The `backup_id` along with
   *  the parent `parent` are combined as {parent}/backups/{backup_id} to create
   *  the full backup name, of the form:
   *  `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
   *  This string must be between 1 and 50 characters in length and match the
   *  regex _a-zA-Z0-9 -_.a-zA-Z0-9 *.
   */
  // const backupId = 'abc123'
  /**
   *  Required. The backup to create.
   */
  // const backup = {}

  // Imports the Admin library
  const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;

  // Instantiates a client
  const adminClient = new BigtableTableAdminClient();

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

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

  callCreateBackup();

(async) checkCreateTableFromSnapshotProgress(name) → {Promise}

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

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
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 unique name of the instance in which to create the table.
   *  Values are of the form `projects/{project}/instances/{instance}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The name by which the new table should be referred to within the parent
   *  instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
   */
  // const tableId = 'abc123'
  /**
   *  Required. The unique name of the snapshot from which to restore the table. The
   *  snapshot and the table must be in the same instance.
   *  Values are of the form
   *  `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
   */
  // const sourceSnapshot = 'abc123'

  // Imports the Admin library
  const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;

  // Instantiates a client
  const adminClient = new BigtableTableAdminClient();

  async function callCreateTableFromSnapshot() {
    // Construct request
    const request = {
      parent,
      tableId,
      sourceSnapshot,
    };

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

  callCreateTableFromSnapshot();

(async) checkRestoreTableProgress(name) → {Promise}

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

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
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 instance in which to create the restored
   *  table. This instance must be in the same project as the source backup.
   *  Values are of the form `projects/<project>/instances/<instance>`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The id of the table to create and restore to. This
   *  table must not already exist. The `table_id` appended to
   *  `parent` forms the full table name of the form
   *  `projects/<project>/instances/<instance>/tables/<table_id>`.
   */
  // const tableId = 'abc123'
  /**
   *  Name of the backup from which to restore.  Values are of the form
   *  `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
   */
  // const backup = 'abc123'

  // Imports the Admin library
  const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;

  // Instantiates a client
  const adminClient = new BigtableTableAdminClient();

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

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

  callRestoreTable();

(async) checkSnapshotTableProgress(name) → {Promise}

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

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
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 unique name of the table to have the snapshot taken.
   *  Values are of the form
   *  `projects/{project}/instances/{instance}/tables/{table}`.
   */
  // const name = 'abc123'
  /**
   *  Required. The name of the cluster where the snapshot will be created in.
   *  Values are of the form
   *  `projects/{project}/instances/{instance}/clusters/{cluster}`.
   */
  // const cluster = 'abc123'
  /**
   *  Required. The ID by which the new snapshot should be referred to within the parent
   *  cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
   *  rather than
   *  `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
   */
  // const snapshotId = 'abc123'
  /**
   *  The amount of time that the new snapshot can stay active after it is
   *  created. Once 'ttl' expires, the snapshot will get deleted. The maximum
   *  amount of time a snapshot can stay active is 7 days. If 'ttl' is not
   *  specified, the default value of 24 hours will be used.
   */
  // const ttl = {}
  /**
   *  Description of the snapshot.
   */
  // const description = 'abc123'

  // Imports the Admin library
  const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;

  // Instantiates a client
  const adminClient = new BigtableTableAdminClient();

  async function callSnapshotTable() {
    // Construct request
    const request = {
      name,
      cluster,
      snapshotId,
    };

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

  callSnapshotTable();

(async) checkUndeleteTableProgress(name) → {Promise}

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

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
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 unique name of the table to be restored.
   *  Values are of the form
   *  `projects/{project}/instances/{instance}/tables/{table}`.
   */
  // const name = 'abc123'

  // Imports the Admin library
  const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;

  // Instantiates a client
  const adminClient = new BigtableTableAdminClient();

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

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

  callUndeleteTable();

(async) checkUpdateTableProgress(name) → {Promise}

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

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
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 table to update.
   *  The table's `name` field is used to identify the table to update.
   */
  // const table = {}
  /**
   *  Required. The list of fields to update.
   *  A mask specifying which fields (e.g. `change_stream_config`) in the `table`
   *  field should be updated. This mask is relative to the `table` field, not to
   *  the request message. The wildcard (*) path is currently not supported.
   *  Currently UpdateTable is only supported for the following fields:
   *  * `change_stream_config`
   *  * `change_stream_config.retention_period`
   *  * `deletion_protection`
   *  If `column_families` is set in `update_mask`, it will return an
   *  UNIMPLEMENTED error.
   */
  // const updateMask = {}

  // Imports the Admin library
  const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;

  // Instantiates a client
  const adminClient = new BigtableTableAdminClient();

  async function callUpdateTable() {
    // Construct request
    const request = {
      table,
      updateMask,
    };

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

  callUpdateTable();

close() → {Promise}

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

A promise that resolves when the client is closed.

clusterPath(project, instance, cluster) → {string}

Return a fully-qualified cluster resource name string.

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

Resource name string.

getProjectId() → {Promise}

Return the project ID used by this class.

Returns:
Type Description
Promise

A promise that resolves to string containing the project ID.

hotTabletPath(project, instance, cluster, hot_tablet) → {string}

Return a fully-qualified hotTablet resource name string.

Parameters:
Name Type Description
project string
instance string
cluster string
hot_tablet string
Returns:
Type Description
string

Resource name string.

initialize() → {Promise}

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns:
Type Description
Promise

A promise that resolves to an authenticated service stub.

instancePath(project, instance) → {string}

Return a fully-qualified instance resource name string.

Parameters:
Name Type Description
project string
instance string
Returns:
Type Description
string

Resource name string.

listBackupsAsync(request, optionsopt) → {Object}

Equivalent to listBackups, but returns an iterable object.

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The cluster to list backups from. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}. Use {cluster} = '-' to list backups for all clusters in an instance, e.g., projects/{project}/instances/{instance}/clusters/-.

filter string

A filter expression that filters backups listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is roughly synonymous with equality. Filter rules are case insensitive.

The fields eligible for filtering are: * name * source_table * state * start_time (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * end_time (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * expire_time (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * size_bytes

To filter on multiple expressions, provide each separate expression within parentheses. By default, each expression is an AND expression. However, you can include AND, OR, and NOT expressions explicitly.

Some examples of using filters are:

* `name:"exact"` --> The backup's name is the string "exact".
* `name:howl` --> The backup's name contains the string "howl".
* `source_table:prod`
       --> The source_table's name contains the string "prod".
* `state:CREATING` --> The backup is pending creation.
* `state:READY` --> The backup is fully created and ready for use.
* `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
       --> The backup name contains the string "howl" and start_time
           of the backup is before 2018-03-28T14:50:00Z.
* `size_bytes > 10000000000` --> The backup's size is greater than 10GB
orderBy string

An expression for specifying the sort order of the results of the request. The string value should specify one or more fields in Backup. The full syntax is described at https://aip.dev/132#ordering.

Fields supported are: * name * source_table * expire_time * start_time * end_time * size_bytes * state

For example, "start_time". The default sorting order is ascending. To specify descending order for the field, a suffix " desc" should be appended to the field name. For example, "start_time desc". Redundant space characters in the syntax are insigificant.

If order_by is empty, results will be sorted by start_time in descending order starting from the most recently created backup.

pageSize number

Number of backups to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size.

pageToken string

If non-empty, page_token should contain a next_page_token from a previous ListBackupsResponse to the same parent and with the same filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Backup. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The cluster to list backups from.  Values are of the
   *  form `projects/{project}/instances/{instance}/clusters/{cluster}`.
   *  Use `{cluster} = '-'` to list backups for all clusters in an instance,
   *  e.g., `projects/{project}/instances/{instance}/clusters/-`.
   */
  // const parent = 'abc123'
  /**
   *  A filter expression that filters backups listed in the response.
   *  The expression must specify the field name, a comparison operator,
   *  and the value that you want to use for filtering. The value must be a
   *  string, a number, or a boolean. The comparison operator must be
   *  <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
   *  roughly synonymous with equality. Filter rules are case insensitive.
   *  The fields eligible for filtering are:
   *    * `name`
   *    * `source_table`
   *    * `state`
   *    * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
   *    * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
   *    * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
   *    * `size_bytes`
   *  To filter on multiple expressions, provide each separate expression within
   *  parentheses. By default, each expression is an AND expression. However,
   *  you can include AND, OR, and NOT expressions explicitly.
   *  Some examples of using filters are:
   *    * `name:"exact"` --> The backup's name is the string "exact".
   *    * `name:howl` --> The backup's name contains the string "howl".
   *    * `source_table:prod`
   *           --> The source_table's name contains the string "prod".
   *    * `state:CREATING` --> The backup is pending creation.
   *    * `state:READY` --> The backup is fully created and ready for use.
   *    * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
   *           --> The backup name contains the string "howl" and start_time
   *               of the backup is before 2018-03-28T14:50:00Z.
   *    * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
   */
  // const filter = 'abc123'
  /**
   *  An expression for specifying the sort order of the results of the request.
   *  The string value should specify one or more fields in Backup google.bigtable.admin.v2.Backup. The full
   *  syntax is described at https://aip.dev/132#ordering.
   *  Fields supported are:
   *     * name
   *     * source_table
   *     * expire_time
   *     * start_time
   *     * end_time
   *     * size_bytes
   *     * state
   *  For example, "start_time". The default sorting order is ascending.
   *  To specify descending order for the field, a suffix " desc" should
   *  be appended to the field name. For example, "start_time desc".
   *  Redundant space characters in the syntax are insigificant.
   *  If order_by is empty, results will be sorted by `start_time` in descending
   *  order starting from the most recently created backup.
   */
  // const orderBy = 'abc123'
  /**
   *  Number of backups to be returned in the response. If 0 or
   *  less, defaults to the server's maximum allowed page size.
   */
  // const pageSize = 1234
  /**
   *  If non-empty, `page_token` should contain a
   *  next_page_token google.bigtable.admin.v2.ListBackupsResponse.next_page_token  from a
   *  previous ListBackupsResponse google.bigtable.admin.v2.ListBackupsResponse  to the same `parent` and with the same
   *  `filter`.
   */
  // const pageToken = 'abc123'

  // Imports the Admin library
  const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;

  // Instantiates a client
  const adminClient = new BigtableTableAdminClient();

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

    // Run request
    const iterable = await adminClient.listBackupsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListBackups();

listBackupsStream(request, optionsopt) → {Stream}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The cluster to list backups from. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}. Use {cluster} = '-' to list backups for all clusters in an instance, e.g., projects/{project}/instances/{instance}/clusters/-.

filter string

A filter expression that filters backups listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is roughly synonymous with equality. Filter rules are case insensitive.

The fields eligible for filtering are: * name * source_table * state * start_time (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * end_time (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * expire_time (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * size_bytes

To filter on multiple expressions, provide each separate expression within parentheses. By default, each expression is an AND expression. However, you can include AND, OR, and NOT expressions explicitly.

Some examples of using filters are:

* `name:"exact"` --> The backup's name is the string "exact".
* `name:howl` --> The backup's name contains the string "howl".
* `source_table:prod`
       --> The source_table's name contains the string "prod".
* `state:CREATING` --> The backup is pending creation.
* `state:READY` --> The backup is fully created and ready for use.
* `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
       --> The backup name contains the string "howl" and start_time
           of the backup is before 2018-03-28T14:50:00Z.
* `size_bytes > 10000000000` --> The backup's size is greater than 10GB
orderBy string

An expression for specifying the sort order of the results of the request. The string value should specify one or more fields in Backup. The full syntax is described at https://aip.dev/132#ordering.

Fields supported are: * name * source_table * expire_time * start_time * end_time * size_bytes * state

For example, "start_time". The default sorting order is ascending. To specify descending order for the field, a suffix " desc" should be appended to the field name. For example, "start_time desc". Redundant space characters in the syntax are insigificant.

If order_by is empty, results will be sorted by start_time in descending order starting from the most recently created backup.

pageSize number

Number of backups to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size.

pageToken string

If non-empty, page_token should contain a next_page_token from a previous ListBackupsResponse to the same parent and with the same filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Backup on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listBackupsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listSnapshotsAsync(request, optionsopt) → {Object}

Equivalent to listSnapshots, but returns an iterable object.

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The unique name of the cluster for which snapshots should be listed. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}. Use {cluster} = '-' to list snapshots for all clusters in an instance, e.g., projects/{project}/instances/{instance}/clusters/-.

pageSize number

The maximum number of snapshots to return per page. CURRENTLY UNIMPLEMENTED AND IGNORED.

pageToken string

The value of next_page_token returned by a previous call.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Snapshot. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The unique name of the cluster for which snapshots should be listed.
   *  Values are of the form
   *  `projects/{project}/instances/{instance}/clusters/{cluster}`.
   *  Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
   *  e.g., `projects/{project}/instances/{instance}/clusters/-`.
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of snapshots to return per page.
   *  CURRENTLY UNIMPLEMENTED AND IGNORED.
   */
  // const pageSize = 1234
  /**
   *  The value of `next_page_token` returned by a previous call.
   */
  // const pageToken = 'abc123'

  // Imports the Admin library
  const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;

  // Instantiates a client
  const adminClient = new BigtableTableAdminClient();

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

    // Run request
    const iterable = await adminClient.listSnapshotsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListSnapshots();

listSnapshotsStream(request, optionsopt) → {Stream}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The unique name of the cluster for which snapshots should be listed. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}. Use {cluster} = '-' to list snapshots for all clusters in an instance, e.g., projects/{project}/instances/{instance}/clusters/-.

pageSize number

The maximum number of snapshots to return per page. CURRENTLY UNIMPLEMENTED AND IGNORED.

pageToken string

The value of next_page_token returned by a previous call.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Snapshot on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listSnapshotsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listTablesAsync(request, optionsopt) → {Object}

Equivalent to listTables, but returns an iterable object.

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The unique name of the instance for which tables should be listed. Values are of the form projects/{project}/instances/{instance}.

view google.bigtable.admin.v2.Table.View

The view to be applied to the returned tables' fields. Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.

pageSize number

Maximum number of results per page.

A page_size of zero lets the server choose the number of items to return. A page_size which is strictly positive will return at most that many items. A negative page_size will cause an error.

Following the first request, subsequent paginated calls are not required to pass a page_size. If a page_size is set in subsequent calls, it must match the page_size given in the first request.

pageToken string

The value of next_page_token returned by a previous call.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Table. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The unique name of the instance for which tables should be listed.
   *  Values are of the form `projects/{project}/instances/{instance}`.
   */
  // const parent = 'abc123'
  /**
   *  The view to be applied to the returned tables' fields.
   *  Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
   */
  // const view = {}
  /**
   *  Maximum number of results per page.
   *  A page_size of zero lets the server choose the number of items to return.
   *  A page_size which is strictly positive will return at most that many items.
   *  A negative page_size will cause an error.
   *  Following the first request, subsequent paginated calls are not required
   *  to pass a page_size. If a page_size is set in subsequent calls, it must
   *  match the page_size given in the first request.
   */
  // const pageSize = 1234
  /**
   *  The value of `next_page_token` returned by a previous call.
   */
  // const pageToken = 'abc123'

  // Imports the Admin library
  const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;

  // Instantiates a client
  const adminClient = new BigtableTableAdminClient();

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

    // Run request
    const iterable = await adminClient.listTablesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListTables();

listTablesStream(request, optionsopt) → {Stream}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The unique name of the instance for which tables should be listed. Values are of the form projects/{project}/instances/{instance}.

view google.bigtable.admin.v2.Table.View

The view to be applied to the returned tables' fields. Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.

pageSize number

Maximum number of results per page.

A page_size of zero lets the server choose the number of items to return. A page_size which is strictly positive will return at most that many items. A negative page_size will cause an error.

Following the first request, subsequent paginated calls are not required to pass a page_size. If a page_size is set in subsequent calls, it must match the page_size given in the first request.

pageToken string

The value of next_page_token returned by a previous call.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Table on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listTablesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

matchAppProfileFromAppProfileName(appProfileName) → {string}

Parse the app_profile from AppProfile resource.

Parameters:
Name Type Description
appProfileName string

A fully-qualified path representing AppProfile resource.

Returns:
Type Description
string

A string representing the app_profile.

matchBackupFromBackupName(backupName) → {string}

Parse the backup from Backup resource.

Parameters:
Name Type Description
backupName string

A fully-qualified path representing Backup resource.

Returns:
Type Description
string

A string representing the backup.

matchClusterFromBackupName(backupName) → {string}

Parse the cluster from Backup resource.

Parameters:
Name Type Description
backupName string

A fully-qualified path representing Backup resource.

Returns:
Type Description
string

A string representing the cluster.

matchClusterFromClusterName(clusterName) → {string}

Parse the cluster from Cluster resource.

Parameters:
Name Type Description
clusterName string

A fully-qualified path representing Cluster resource.

Returns:
Type Description
string

A string representing the cluster.

matchClusterFromHotTabletName(hotTabletName) → {string}

Parse the cluster from HotTablet resource.

Parameters:
Name Type Description
hotTabletName string

A fully-qualified path representing HotTablet resource.

Returns:
Type Description
string

A string representing the cluster.

matchClusterFromSnapshotName(snapshotName) → {string}

Parse the cluster from Snapshot resource.

Parameters:
Name Type Description
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns:
Type Description
string

A string representing the cluster.

matchHotTabletFromHotTabletName(hotTabletName) → {string}

Parse the hot_tablet from HotTablet resource.

Parameters:
Name Type Description
hotTabletName string

A fully-qualified path representing HotTablet resource.

Returns:
Type Description
string

A string representing the hot_tablet.

matchInstanceFromAppProfileName(appProfileName) → {string}

Parse the instance from AppProfile resource.

Parameters:
Name Type Description
appProfileName string

A fully-qualified path representing AppProfile resource.

Returns:
Type Description
string

A string representing the instance.

matchInstanceFromBackupName(backupName) → {string}

Parse the instance from Backup resource.

Parameters:
Name Type Description
backupName string

A fully-qualified path representing Backup resource.

Returns:
Type Description
string

A string representing the instance.

matchInstanceFromClusterName(clusterName) → {string}

Parse the instance from Cluster resource.

Parameters:
Name Type Description
clusterName string

A fully-qualified path representing Cluster resource.

Returns:
Type Description
string

A string representing the instance.

matchInstanceFromHotTabletName(hotTabletName) → {string}

Parse the instance from HotTablet resource.

Parameters:
Name Type Description
hotTabletName string

A fully-qualified path representing HotTablet resource.

Returns:
Type Description
string

A string representing the instance.

matchInstanceFromInstanceName(instanceName) → {string}

Parse the instance from Instance resource.

Parameters:
Name Type Description
instanceName string

A fully-qualified path representing Instance resource.

Returns:
Type Description
string

A string representing the instance.

matchInstanceFromSnapshotName(snapshotName) → {string}

Parse the instance from Snapshot resource.

Parameters:
Name Type Description
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns:
Type Description
string

A string representing the instance.

matchInstanceFromTableName(tableName) → {string}

Parse the instance from Table resource.

Parameters:
Name Type Description
tableName string

A fully-qualified path representing Table resource.

Returns:
Type Description
string

A string representing the instance.

matchProjectFromAppProfileName(appProfileName) → {string}

Parse the project from AppProfile resource.

Parameters:
Name Type Description
appProfileName string

A fully-qualified path representing AppProfile resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromBackupName(backupName) → {string}

Parse the project from Backup resource.

Parameters:
Name Type Description
backupName string

A fully-qualified path representing Backup resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromClusterName(clusterName) → {string}

Parse the project from Cluster resource.

Parameters:
Name Type Description
clusterName string

A fully-qualified path representing Cluster resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromHotTabletName(hotTabletName) → {string}

Parse the project from HotTablet resource.

Parameters:
Name Type Description
hotTabletName string

A fully-qualified path representing HotTablet resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromInstanceName(instanceName) → {string}

Parse the project from Instance resource.

Parameters:
Name Type Description
instanceName string

A fully-qualified path representing Instance resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromSnapshotName(snapshotName) → {string}

Parse the project from Snapshot resource.

Parameters:
Name Type Description
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromTableName(tableName) → {string}

Parse the project from Table resource.

Parameters:
Name Type Description
tableName string

A fully-qualified path representing Table resource.

Returns:
Type Description
string

A string representing the project.

matchSnapshotFromSnapshotName(snapshotName) → {string}

Parse the snapshot from Snapshot resource.

Parameters:
Name Type Description
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns:
Type Description
string

A string representing the snapshot.

matchTableFromTableName(tableName) → {string}

Parse the table from Table resource.

Parameters:
Name Type Description
tableName string

A fully-qualified path representing Table resource.

Returns:
Type Description
string

A string representing the table.

snapshotPath(project, instance, cluster, snapshot) → {string}

Return a fully-qualified snapshot resource name string.

Parameters:
Name Type Description
project string
instance string
cluster string
snapshot string
Returns:
Type Description
string

Resource name string.

tablePath(project, instance, table) → {string}

Return a fully-qualified table resource name string.

Parameters:
Name Type Description
project string
instance string
table string
Returns:
Type Description
string

Resource name string.