Constructor
new BigtableTableAdminClient(optionsopt)
Construct an instance of BigtableTableAdminClient.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. See the subsequent parameters for more details. Properties
|
- Source:
Members
(static) apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
(static) port
The port for this API service.
(static) scopes
The scopes needed to make gRPC calls for every method defined in this service.
(static) servicePath
The DNS address for this API service.
Methods
checkConsistency(request, optionsopt, callbackopt) → {Promise}
Checks replication consistency based on a consistency token, that is, if replication has caught up based on the conditions specified in the token and the check request.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing CheckConsistencyResponse. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const consistencyToken = '';
const request = {
name: formattedName,
consistencyToken: consistencyToken,
};
client.checkConsistency(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
clusterPath(project, instance, cluster) → {String}
Return a fully-qualified cluster resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
String | |
instance |
String | |
cluster |
String |
createTable(request, optionsopt, callbackopt) → {Promise}
Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Table. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
const tableId = '';
const table = {};
const request = {
parent: formattedParent,
tableId: tableId,
table: table,
};
client.createTable(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
createTableFromSnapshot(request, optionsopt, callbackopt) → {Promise}
Creates a new table from the specified snapshot. The target table must not exist. The snapshot and the table must be in the same instance.
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is a gax.Operation object. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
const tableId = '';
const sourceSnapshot = '';
const request = {
parent: formattedParent,
tableId: tableId,
sourceSnapshot: sourceSnapshot,
};
// Handle the operation using the promise pattern.
client.createTableFromSnapshot(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Operation#promise starts polling for the completion of the LRO.
return operation.promise();
})
.then(responses => {
const result = responses[0];
const metadata = responses[1];
const finalApiResponse = responses[2];
})
.catch(err => {
console.error(err);
});
const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
const tableId = '';
const sourceSnapshot = '';
const request = {
parent: formattedParent,
tableId: tableId,
sourceSnapshot: sourceSnapshot,
};
// Handle the operation using the event emitter pattern.
client.createTableFromSnapshot(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Adding a listener for the "complete" event starts polling for the
// completion of the operation.
operation.on('complete', (result, metadata, finalApiResponse) => {
// doSomethingWith(result);
});
// Adding a listener for the "progress" event causes the callback to be
// called on any change in metadata when the operation is polled.
operation.on('progress', (metadata, apiResponse) => {
// doSomethingWith(metadata)
});
// Adding a listener for the "error" event handles any errors found during polling.
operation.on('error', err => {
// throw(err);
});
})
.catch(err => {
console.error(err);
});
const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
const tableId = '';
const sourceSnapshot = '';
const request = {
parent: formattedParent,
tableId: tableId,
sourceSnapshot: sourceSnapshot,
};
// Handle the operation using the await pattern.
const [operation] = await client.createTableFromSnapshot(request);
const [response] = await operation.promise();
deleteSnapshot(request, optionsopt, callbackopt) → {Promise}
Permanently deletes the specified snapshot.
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedName = client.snapshotPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]');
client.deleteSnapshot({name: formattedName}).catch(err => {
console.error(err);
});
deleteTable(request, optionsopt, callbackopt) → {Promise}
Permanently deletes a specified table and all of its data.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
client.deleteTable({name: formattedName}).catch(err => {
console.error(err);
});
dropRowRange(request, optionsopt, callbackopt) → {Promise}
Permanently drop/delete a row range from a specified table. The request can specify whether to delete all rows in a table, or only those that match a particular prefix.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
client.dropRowRange({name: formattedName}).catch(err => {
console.error(err);
});
generateConsistencyToken(request, optionsopt, callbackopt) → {Promise}
Generates a consistency token for a Table, which can be used in CheckConsistency to check whether mutations to the table that finished before this call started have been replicated. The tokens will be available for 90 days.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing GenerateConsistencyTokenResponse. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
client.generateConsistencyToken({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getIamPolicy(request, optionsopt, callbackopt) → {Promise}
Gets the access control policy for an instance resource. Returns an empty policy if an table exists but does not have a policy set.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Policy. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedResource = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
client.getIamPolicy({resource: formattedResource})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getProjectId(callback)
Return the project ID used by this class.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
the callback to be called with the current project Id. |
getSnapshot(request, optionsopt, callbackopt) → {Promise}
Gets metadata information about the specified snapshot.
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Snapshot. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedName = client.snapshotPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]');
client.getSnapshot({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getTable(request, optionsopt, callbackopt) → {Promise}
Gets metadata information about the specified table.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Table. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
client.getTable({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
instancePath(project, instance) → {String}
Return a fully-qualified instance resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
String | |
instance |
String |
listSnapshots(request, optionsopt, callbackopt) → {Promise}
Lists all snapshots associated with the specified cluster.
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of Snapshot. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListSnapshotsResponse. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
client.listSnapshots({parent: formattedParent})
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listSnapshots(nextRequest, options).then(callback);
}
}
client.listSnapshots({parent: formattedParent}, options)
.then(callback)
.catch(err => {
console.error(err);
});
listSnapshotsStream(request, optionsopt) → {Stream}
Equivalent to listSnapshots, but returns a NodeJS Stream object.
This fetches the paged responses for listSnapshots continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
client.listSnapshotsStream({parent: formattedParent})
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
listTables(request, optionsopt, callbackopt) → {Promise}
Lists all tables served from a specified instance.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of Table. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListTablesResponse. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
client.listTables({parent: formattedParent})
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listTables(nextRequest, options).then(callback);
}
}
client.listTables({parent: formattedParent}, options)
.then(callback)
.catch(err => {
console.error(err);
});
listTablesStream(request, optionsopt) → {Stream}
Equivalent to listTables, but returns a NodeJS Stream object.
This fetches the paged responses for listTables continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
client.listTablesStream({parent: formattedParent})
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
matchClusterFromClusterName(clusterName) → {String}
Parse the clusterName from a cluster resource.
Parameters:
Name | Type | Description |
---|---|---|
clusterName |
String |
A fully-qualified path representing a cluster resources. |
matchClusterFromSnapshotName(snapshotName) → {String}
Parse the snapshotName from a snapshot resource.
Parameters:
Name | Type | Description |
---|---|---|
snapshotName |
String |
A fully-qualified path representing a snapshot resources. |
matchInstanceFromClusterName(clusterName) → {String}
Parse the clusterName from a cluster resource.
Parameters:
Name | Type | Description |
---|---|---|
clusterName |
String |
A fully-qualified path representing a cluster resources. |
matchInstanceFromInstanceName(instanceName) → {String}
Parse the instanceName from a instance resource.
Parameters:
Name | Type | Description |
---|---|---|
instanceName |
String |
A fully-qualified path representing a instance resources. |
matchInstanceFromSnapshotName(snapshotName) → {String}
Parse the snapshotName from a snapshot resource.
Parameters:
Name | Type | Description |
---|---|---|
snapshotName |
String |
A fully-qualified path representing a snapshot resources. |
matchInstanceFromTableName(tableName) → {String}
Parse the tableName from a table resource.
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String |
A fully-qualified path representing a table resources. |
matchProjectFromClusterName(clusterName) → {String}
Parse the clusterName from a cluster resource.
Parameters:
Name | Type | Description |
---|---|---|
clusterName |
String |
A fully-qualified path representing a cluster resources. |
matchProjectFromInstanceName(instanceName) → {String}
Parse the instanceName from a instance resource.
Parameters:
Name | Type | Description |
---|---|---|
instanceName |
String |
A fully-qualified path representing a instance resources. |
matchProjectFromSnapshotName(snapshotName) → {String}
Parse the snapshotName from a snapshot resource.
Parameters:
Name | Type | Description |
---|---|---|
snapshotName |
String |
A fully-qualified path representing a snapshot resources. |
matchProjectFromTableName(tableName) → {String}
Parse the tableName from a table resource.
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String |
A fully-qualified path representing a table resources. |
matchSnapshotFromSnapshotName(snapshotName) → {String}
Parse the snapshotName from a snapshot resource.
Parameters:
Name | Type | Description |
---|---|---|
snapshotName |
String |
A fully-qualified path representing a snapshot resources. |
matchTableFromTableName(tableName) → {String}
Parse the tableName from a table resource.
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String |
A fully-qualified path representing a table resources. |
modifyColumnFamilies(request, optionsopt, callbackopt) → {Promise}
Performs a series of column family modifications on the specified table. Either all or none of the modifications will occur before this method returns, but data requests received prior to that point may see a table where only some modifications have taken effect.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Table. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const modifications = [];
const request = {
name: formattedName,
modifications: modifications,
};
client.modifyColumnFamilies(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
setIamPolicy(request, optionsopt, callbackopt) → {Promise}
Sets the access control policy on a table resource. Replaces any existing policy.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Policy. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedResource = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const policy = {};
const request = {
resource: formattedResource,
policy: policy,
};
client.setIamPolicy(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
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 |
snapshotTable(request, optionsopt, callbackopt) → {Promise}
Creates a new snapshot in the specified cluster from the specified source table. The cluster and the table must be in the same instance.
Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is a gax.Operation object. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const cluster = '';
const snapshotId = '';
const description = '';
const request = {
name: formattedName,
cluster: cluster,
snapshotId: snapshotId,
description: description,
};
// Handle the operation using the promise pattern.
client.snapshotTable(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Operation#promise starts polling for the completion of the LRO.
return operation.promise();
})
.then(responses => {
const result = responses[0];
const metadata = responses[1];
const finalApiResponse = responses[2];
})
.catch(err => {
console.error(err);
});
const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const cluster = '';
const snapshotId = '';
const description = '';
const request = {
name: formattedName,
cluster: cluster,
snapshotId: snapshotId,
description: description,
};
// Handle the operation using the event emitter pattern.
client.snapshotTable(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Adding a listener for the "complete" event starts polling for the
// completion of the operation.
operation.on('complete', (result, metadata, finalApiResponse) => {
// doSomethingWith(result);
});
// Adding a listener for the "progress" event causes the callback to be
// called on any change in metadata when the operation is polled.
operation.on('progress', (metadata, apiResponse) => {
// doSomethingWith(metadata)
});
// Adding a listener for the "error" event handles any errors found during polling.
operation.on('error', err => {
// throw(err);
});
})
.catch(err => {
console.error(err);
});
const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const cluster = '';
const snapshotId = '';
const description = '';
const request = {
name: formattedName,
cluster: cluster,
snapshotId: snapshotId,
description: description,
};
// Handle the operation using the await pattern.
const [operation] = await client.snapshotTable(request);
const [response] = await operation.promise();
tablePath(project, instance, table) → {String}
Return a fully-qualified table resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
String | |
instance |
String | |
table |
String |
testIamPermissions(request, optionsopt, callbackopt) → {Promise}
Returns permissions that the caller has on the specified table resource.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing TestIamPermissionsResponse. |
Example
const admin = require('admin.v2');
const client = new admin.v2.BigtableTableAdminClient({
// optional auth parameters.
});
const formattedResource = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]');
const permissions = [];
const request = {
resource: formattedResource,
permissions: permissions,
};
client.testIamPermissions(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});