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
|
||||||||||||||||||||||||||||||||||||||||||||||||
gaxInstance |
gax |
<optional> |
loaded instance of |
Members
apiEndpoint
The DNS address for this API service.
apiEndpoint
The DNS address for this API service - same as servicePath.
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. |
authorizedViewPath(project, instance, table, authorized_view) → {string}
Return a fully-qualified authorizedView resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
instance |
string | |
table |
string | |
authorized_view |
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) checkCopyBackupProgress(name) → {Promise}
Check the status of the long running operation returned by copyBackup()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
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 destination cluster that will contain the backup
* copy. The cluster must already exists. Values are of the form:
* `projects/{project}/instances/{instance}/clusters/{cluster}`.
*/
// const parent = 'abc123'
/**
* Required. The id of the new backup. The `backup_id` along with `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 source backup to be copied from.
* The source backup needs to be in READY state for it to be copied.
* Copying a copied backup is not allowed.
* Once CopyBackup is in progress, the source backup cannot be deleted or
* cleaned up on expiration until CopyBackup is finished.
* Values are of the form:
* `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
*/
// const sourceBackup = 'abc123'
/**
* Required. Required. The expiration time of the copied backup with
* microsecond granularity that must be at least 6 hours and at most 30 days
* from the time the request is received. Once the `expire_time` has
* passed, Cloud Bigtable will delete the backup and free the resources used
* by the backup.
*/
// const expireTime = {}
// Imports the Admin library
const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;
// Instantiates a client
const adminClient = new BigtableTableAdminClient();
async function callCopyBackup() {
// Construct request
const request = {
parent,
backupId,
sourceBackup,
expireTime,
};
// Run request
const [operation] = await adminClient.copyBackup(request);
const [response] = await operation.promise();
console.log(response);
}
callCopyBackup();
(async) checkCreateAuthorizedViewProgress(name) → {Promise}
Check the status of the long running operation returned by createAuthorizedView()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
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 is the name of the table the AuthorizedView belongs to.
* Values are of the form
* `projects/{project}/instances/{instance}/tables/{table}`.
*/
// const parent = 'abc123'
/**
* Required. The id of the AuthorizedView to create. This AuthorizedView must
* not already exist. The `authorized_view_id` appended to `parent` forms the
* full AuthorizedView name of the form
* `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
*/
// const authorizedViewId = 'abc123'
/**
* Required. The AuthorizedView to create.
*/
// const authorizedView = {}
// Imports the Admin library
const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;
// Instantiates a client
const adminClient = new BigtableTableAdminClient();
async function callCreateAuthorizedView() {
// Construct request
const request = {
parent,
authorizedViewId,
authorizedView,
};
// Run request
const [operation] = await adminClient.createAuthorizedView(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateAuthorizedView();
(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 |
|
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 |
|
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 |
|
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. 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 |
|
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 |
|
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) checkUpdateAuthorizedViewProgress(name) → {Promise}
Check the status of the long running operation returned by updateAuthorizedView()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
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 AuthorizedView to update. The `name` in `authorized_view` is
* used to identify the AuthorizedView. AuthorizedView name must in this
* format
* projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>
*/
// const authorizedView = {}
/**
* Optional. The list of fields to update.
* A mask specifying which fields in the AuthorizedView resource should be
* updated. This mask is relative to the AuthorizedView resource, not to the
* request message. A field will be overwritten if it is in the mask. If
* empty, all fields set in the request will be overwritten. A special value
* `*` means to overwrite all fields (including fields not set in the
* request).
*/
// const updateMask = {}
/**
* Optional. If true, ignore the safety checks when updating the
* AuthorizedView.
*/
// const ignoreWarnings = true
// Imports the Admin library
const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;
// Instantiates a client
const adminClient = new BigtableTableAdminClient();
async function callUpdateAuthorizedView() {
// Construct request
const request = {
authorizedView,
};
// Run request
const [operation] = await adminClient.updateAuthorizedView(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateAuthorizedView();
(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 |
|
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. |
listAuthorizedViewsAsync(request, optionsopt) → {Object}
Equivalent to listAuthorizedViews
, 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
|
|||||||||||||||||||||
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 AuthorizedView. 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 table for which AuthorizedViews should be
* listed. Values are of the form
* `projects/{project}/instances/{instance}/tables/{table}`.
*/
// const parent = 'abc123'
/**
* Optional. 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
/**
* Optional. The value of `next_page_token` returned by a previous call.
*/
// const pageToken = 'abc123'
/**
* Optional. The resource_view to be applied to the returned views' fields.
* Default to NAME_ONLY.
*/
// const view = {}
// Imports the Admin library
const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2;
// Instantiates a client
const adminClient = new BigtableTableAdminClient();
async function callListAuthorizedViews() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = adminClient.listAuthorizedViewsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAuthorizedViews();
listAuthorizedViewsStream(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
|
|||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing AuthorizedView 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(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
|
|||||||||||||||||||
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 = 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
|
|||||||||||||||||||
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 |
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
|
|||||||||||||
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 = 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
|
|||||||||||||
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 |
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
|
||||||||||||||||
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.
* 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 = 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
|
||||||||||||||||
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 |
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. |
matchAuthorizedViewFromAuthorizedViewName(authorizedViewName) → {string}
Parse the authorized_view from AuthorizedView resource.
Parameters:
Name | Type | Description |
---|---|---|
authorizedViewName |
string |
A fully-qualified path representing AuthorizedView resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the authorized_view. |
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. |
matchInstanceFromAuthorizedViewName(authorizedViewName) → {string}
Parse the instance from AuthorizedView resource.
Parameters:
Name | Type | Description |
---|---|---|
authorizedViewName |
string |
A fully-qualified path representing AuthorizedView 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. |
matchProjectFromAuthorizedViewName(authorizedViewName) → {string}
Parse the project from AuthorizedView resource.
Parameters:
Name | Type | Description |
---|---|---|
authorizedViewName |
string |
A fully-qualified path representing AuthorizedView 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. |
matchProjectFromProjectName(projectName) → {string}
Parse the project from Project resource.
Parameters:
Name | Type | Description |
---|---|---|
projectName |
string |
A fully-qualified path representing Project 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. |
matchTableFromAuthorizedViewName(authorizedViewName) → {string}
Parse the table from AuthorizedView resource.
Parameters:
Name | Type | Description |
---|---|---|
authorizedViewName |
string |
A fully-qualified path representing AuthorizedView resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the table. |
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. |
projectPath(project) → {string}
Return a fully-qualified project resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
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. |