Constructor
new Cluster(instance, id)
Parameters:
| Name | Type | Description |
|---|---|---|
instance |
Instance |
The parent instance of this cluster. |
id |
string |
Id of the cluster. |
Methods
backup(id) → {Backup}
Get a reference to a Bigtable Cluster.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string |
The backup name or id. |
Returns:
| Type | Description |
|---|---|
| Backup |
create(optionsopt, callbackopt)
Create a cluster.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
|||||||||||||
callback |
function |
<optional> |
The callback function. Properties
|
Example
include:samples/api-reference-doc-snippets/cluster.js
region_tag:bigtable_api_create_cluster
createBackup(id, config, callbackopt) → {void|Promise.<CreateBackupResponse>}
Backup a table from this cluster.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
string |
A unique ID for the backup. |
|||||||||||||||||||||
config |
object |
Configuration object. Properties
|
|||||||||||||||||||||
callback |
CreateBackupCallback |
<optional> |
The callback function. Properties
|
Returns:
| Type | Description |
|---|---|
| void | Promise.<CreateBackupResponse> |
Example
include:samples/api-reference-doc-snippets/backups.create.js
region_tag:bigtable_api_create_backup
delete(gaxOptionsopt, callbackopt)
Delete the cluster.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gaxOptions |
object |
<optional> |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||||||||
callback |
function |
<optional> |
The callback function. Properties
|
Example
include:samples/api-reference-doc-snippets/cluster.js
region_tag:bigtable_api_delete_cluster
exists(gaxOptionsopt, callback)
Check if a cluster exists.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gaxOptions |
object |
<optional> |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||||||||
callback |
function |
The callback function. Properties
|
Example
include:samples/api-reference-doc-snippets/cluster.js
region_tag:bigtable_api_exists_cluster
get(gaxOptionsopt, callback)
Get a cluster if it exists.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gaxOptions |
object |
<optional> |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||||||||
callback |
function |
The callback function. Properties
|
getBackups(optionsOrCallbackopt, callbackopt) → {void|Promise.<ListBackupsResponse>}
Get Cloud Bigtable Backup instances within this cluster. This returns both completed and pending backups.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
optionsOrCallback |
GetBackupsOptions | GetBackupsCallback |
<optional> |
|||||||||||||||||
callback |
GetBackupsResponse |
<optional> |
The callback function. Properties
|
Returns:
| Type | Description |
|---|---|
| void | Promise.<ListBackupsResponse> |
Example
include:samples/api-reference-doc-snippets/backups.list.js
region_tag:bigtable_api_list_backups
getBackupsStream(optionsopt) → {ReadableStream.<Backup>}
Lists Cloud Bigtable backups within this cluster. Provides both completed and pending backups as a readable object stream.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
options |
GetBackupsOptions |
<optional> |
Configuration object. See Cluster#getBackups for a complete list of options. |
Returns:
| Type | Description |
|---|---|
| ReadableStream.<Backup> |
Example
```
const {Bigtable} = require('@google-cloud/bigtable');
const bigtable = new Bigtable();
const instance = bigtable.instance('my-instance');
const cluster = instance.cluster('my-cluster');
cluster.getBackupsStream()
.on('error', console.error)
.on('data', function(backup) {
// backup is a Backup object.
})
.on('end', () => {
// All backups retrieved.
});
//-
// If you anticipate many results, you can end a stream early to prevent
// unnecessary processing and API requests.
//-
cluster.getBackupsStream()
.on('data', function(backup) {
this.end();
});
```
getMetadata(gaxOptionsopt, callback)
Get the cluster metadata.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gaxOptions |
object |
<optional> |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||||||||||||
callback |
function |
The callback function. Properties
|
Example
include:samples/api-reference-doc-snippets/cluster.js
region_tag:bigtable_api_cluster_get_meta
setMetadata(metadata, gaxOptionsopt, callback)
Set the cluster metadata.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
metadata |
object |
See Instance#createCluster for the available metadata options. |
|||||||||||||||||
gaxOptions |
object |
<optional> |
Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||||||||||||
callback |
function |
The callback function. Properties
|