Send feedback Class Cluster (6.0.0) Stay organized with collections Save and categorize content based on your preferences. Version latestkeyboard_arrow_down Create a cluster object to interact with your cluster.
Package @google-cloud/bigtable Example
const { Bigtable } = require ( '@google-cloud/bigtable ' ); const bigtable = new Bigtable (); const instance = bigtable . instance ( 'my-instance' ); const cluster = instance . cluster ( 'my-cluster' ); Constructors (constructor)(instance, id)
constructor ( instance : Instance , id : string ); Constructs a new instance of theCluster class
Parameters Name Description instanceInstance idstring
Properties bigtable id instance metadata name Methods backup(id)
backup ( id : string ) : Backup ; Get a reference to a Bigtable Cluster.
Parameter Name Description idstring The backup name or id.
Returns Type Description Backup {Backup}
create()
create () : Promise<CreateClusterResponse> ; create(options)
create ( options : CreateClusterOptions ) : Promise<CreateClusterResponse> ; create(callback)
create ( callback : CreateClusterCallback ) : void ; Returns Type Description void
create(options, callback)
create ( options : CreateClusterOptions , callback : CreateClusterCallback ) : void ; Returns Type Description void
createBackup(id, config)
createBackup ( id : string , config : CreateBackupConfig ) : Promise<CreateBackupResponse> ; Parameters Name Description idstring configCreateBackupConfig
createBackup(id, config, callback)
createBackup ( id : string , config : CreateBackupConfig , callback : CreateBackupCallback ) : void ; Returns Type Description void
delete()
delete () : Promise<ApiResponse> ; delete(gaxOptions)
delete ( gaxOptions : CallOptions ) : Promise<ApiResponse> ; Parameter Name Description gaxOptionsCallOptions
delete(callback)
delete ( callback : DeleteClusterCallback ) : void ; Returns Type Description void
delete(gaxOptions, callback)
delete ( gaxOptions : CallOptions , callback : DeleteClusterCallback ) : void ; Returns Type Description void
exists()
exists () : Promise<BooleanResponse> ; exists(gaxOptions)
exists ( gaxOptions : CallOptions ) : Promise<BooleanResponse> ; Parameter Name Description gaxOptionsCallOptions
exists(callback)
exists ( callback : ExistsClusterCallback ) : void ; Returns Type Description void
exists(gaxOptions, callback)
exists ( gaxOptions : CallOptions , callback : ExistsClusterCallback ) : void ; Returns Type Description void
get()
get () : Promise<GetClusterResponse> ; get(gaxOptions)
get ( gaxOptions : CallOptions ) : Promise<GetClusterResponse> ; Parameter Name Description gaxOptionsCallOptions
get(callback)
get ( callback : GetClusterCallback ) : void ; Returns Type Description void
get(gaxOptions, callback)
get ( gaxOptions : CallOptions , callback : GetClusterCallback ) : void ; Returns Type Description void
getBackups(options)
getBackups ( options ?: GetBackupsOptions ) : Promise<GetBackupsResponse> ; getBackups(options, callback)
getBackups ( options : GetBackupsOptions , callback : GetBackupsCallback ) : void ; Returns Type Description void
getBackups(callback)
getBackups ( callback : GetBackupsCallback ) : void ; Returns Type Description void
getBackupsStream(options)
getBackupsStream ( options ?: GetBackupsOptions ) : NodeJS . ReadableStream ; Lists Cloud Bigtable backups within this cluster. Provides both completed and pending backups as a readable object stream.
Parameter Name Description optionsGetBackupsOptions Configuration object. See for a complete list of options.
Returns Type Description NodeJS.ReadableStream {ReadableStream
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 (); }); getLocation_(project, location)
static getLocation_ ( project : string , location : string ) : string ; Parameters Name Description projectstring The project ID.
locationstring The zone location.
Returns Type Description string {string}
Example
Cluster . getLocation_ ( 'my-project' , 'us-central1-b' ); // 'projects/my-project/locations/us-central1-b' getMetadata()
getMetadata () : Promise<GetClusterMetadataResponse> ; getMetadata(gaxOptions)
getMetadata ( gaxOptions : CallOptions ) : Promise<GetClusterMetadataResponse> ; Parameter Name Description gaxOptionsCallOptions
getMetadata(callback)
getMetadata ( callback : GetClusterMetadataCallback ) : void ; Returns Type Description void
getMetadata(gaxOptions, callback)
getMetadata ( gaxOptions : CallOptions , callback : GetClusterMetadataCallback ) : void ; Returns Type Description void
getStorageType_(type)
static getStorageType_ ( type : string ) : number ; Maps the storage type to the proper integer.
Parameter Name Description typestring The storage type (hdd, ssd).
Returns Type Description number {number}
Example
Cluster . getStorageType_ ( 'ssd' ); // 1 setMetadata(metadata, gaxOptions)
setMetadata ( metadata : SetClusterMetadataOptions , gaxOptions ?: CallOptions ) : Promise<SetClusterMetadataResponse> ; Parameters Name Description metadataSetClusterMetadataOptions gaxOptionsCallOptions
setMetadata(metadata, callback)
setMetadata ( metadata : SetClusterMetadataOptions , callback : SetClusterMetadataCallback ) : void ; Returns Type Description void
setMetadata(metadata, gaxOptions, callback)
setMetadata ( metadata : SetClusterMetadataOptions , gaxOptions : CallOptions , callback : SetClusterMetadataCallback ) : void ; Returns Type Description void
Send feedback
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License , and code samples are licensed under theApache 2.0 License . For details, see theGoogle Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.
Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]