Send feedback
Class Cluster (4.0.5) Stay organized with collections
Save and categorize content based on your preferences.
Version 4.0.5 keyboard_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 the Cluster
class
Parameters
Properties
bigtable
id
instance
name
Methods
backup(id)
backup
(
id
:
string
)
:
Backup
;
Get a reference to a Bigtable Cluster.
Parameter Name
Description
id
string
The backup name or id.
Returns
create()
create
()
:
Promise<CreateClusterResponse>
;
Returns
create(options)
create
(
options
:
CreateClusterOptions
)
:
Promise<CreateClusterResponse>
;
Parameter
Returns
create(callback)
create
(
callback
:
CreateClusterCallback
)
:
void
;
Parameter
Returns
create(options, callback)
create
(
options
:
CreateClusterOptions
,
callback
:
CreateClusterCallback
)
:
void
;
Parameters
Returns
createBackup(id, config)
createBackup
(
id
:
string
,
config
:
CreateBackupConfig
)
:
Promise<CreateBackupResponse>
;
Parameters
Returns
createBackup(id, config, callback)
createBackup
(
id
:
string
,
config
:
CreateBackupConfig
,
callback
:
CreateBackupCallback
)
:
void
;
Parameters
Returns
delete()
delete
()
:
Promise<ApiResponse>
;
Returns
delete(gaxOptions)
delete
(
gaxOptions
:
CallOptions
)
:
Promise<ApiResponse>
;
Parameter
Returns
delete(callback)
delete
(
callback
:
DeleteClusterCallback
)
:
void
;
Parameter
Returns
delete(gaxOptions, callback)
delete
(
gaxOptions
:
CallOptions
,
callback
:
DeleteClusterCallback
)
:
void
;
Parameters
Returns
exists()
exists
()
:
Promise<BooleanResponse>
;
Returns
exists(gaxOptions)
exists
(
gaxOptions
:
CallOptions
)
:
Promise<BooleanResponse>
;
Parameter
Returns
exists(callback)
exists
(
callback
:
ExistsClusterCallback
)
:
void
;
Parameter
Returns
exists(gaxOptions, callback)
exists
(
gaxOptions
:
CallOptions
,
callback
:
ExistsClusterCallback
)
:
void
;
Parameters
Returns
get()
get
()
:
Promise<GetClusterResponse>
;
Returns
get(gaxOptions)
get
(
gaxOptions
:
CallOptions
)
:
Promise<GetClusterResponse>
;
Parameter
Returns
get(callback)
get
(
callback
:
GetClusterCallback
)
:
void
;
Parameter
Returns
get(gaxOptions, callback)
get
(
gaxOptions
:
CallOptions
,
callback
:
GetClusterCallback
)
:
void
;
Parameters
Returns
getBackups(options)
getBackups
(
options
?:
GetBackupsOptions
)
:
Promise<GetBackupsResponse>
;
Parameter
Returns
getBackups(options, callback)
getBackups
(
options
:
GetBackupsOptions
,
callback
:
GetBackupsCallback
)
:
void
;
Parameters
Returns
getBackups(callback)
getBackups
(
callback
:
GetBackupsCallback
)
:
void
;
Parameter
Returns
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
options
GetBackupsOptions
Configuration object. See for a complete list of options.
Returns
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
project
string
The project ID.
location
string
The zone location.
Returns
Example Cluster
.
getLocation_
(
'my-project'
,
'us-central1-b'
);
// 'projects/my-project/locations/us-central1-b'
getMetadata
()
:
Promise<GetClusterMetadataResponse>
;
Returns
getMetadata
(
gaxOptions
:
CallOptions
)
:
Promise<GetClusterMetadataResponse>
;
Parameter
Returns
getMetadata
(
callback
:
GetClusterMetadataCallback
)
:
void
;
Parameter
Returns
getMetadata
(
gaxOptions
:
CallOptions
,
callback
:
GetClusterMetadataCallback
)
:
void
;
Parameters
Returns
getStorageType_(type)
static
getStorageType_
(
type
:
string
)
:
number
;
Maps the storage type to the proper integer.
Parameter Name
Description
type
string
The storage type (hdd, ssd).
Returns
Example Cluster
.
getStorageType_
(
'ssd'
);
// 1
setMetadata
(
metadata
:
SetClusterMetadataOptions
,
gaxOptions
?:
CallOptions
)
:
Promise<SetClusterMetadataResponse>
;
Parameters Name
Description
metadata
SetClusterMetadataOptions
gaxOptions
CallOptions
Returns
setMetadata
(
metadata
:
SetClusterMetadataOptions
,
callback
:
SetClusterMetadataCallback
)
:
void
;
Parameters
Returns
setMetadata
(
metadata
:
SetClusterMetadataOptions
,
gaxOptions
:
CallOptions
,
callback
:
SetClusterMetadataCallback
)
:
void
;
Parameters
Returns
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-04 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-09-04 UTC."],[],[],null,[]]