Skip to main content

clusters

Creates, updates, deletes, gets or lists a clusters resource.

Overview

Nameclusters
TypeResource
Idgoogle.bigtableadmin.clusters

Fields

NameDatatypeDescription
namestringThe unique name of the cluster. Values are of the form projects/{project}/instances/{instance}/clusters/a-z*.
clusterConfigobjectConfiguration for a cluster.
defaultStorageTypestringImmutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden.
encryptionConfigobjectCloud Key Management Service (Cloud KMS) settings for a CMEK-protected cluster.
locationstringImmutable. The location where this cluster's nodes and storage reside. For best performance, clients should be located as close as possible to this cluster. Currently only zones are supported, so values should be of the form projects/{project}/locations/{zone}.
serveNodesintegerThe number of nodes in the cluster. If no value is set, Cloud Bigtable automatically allocates nodes based on your data footprint and optimized for 50% storage utilization.
statestringOutput only. The current state of the cluster.

Methods

NameAccessible byRequired ParamsDescription
getSELECTclustersId, instancesId, projectsIdGets information about a cluster.
listSELECTinstancesId, projectsIdLists information about clusters in an instance.
createINSERTinstancesId, projectsIdCreates a cluster within an instance. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.
deleteDELETEclustersId, instancesId, projectsIdDeletes a cluster from an instance.
updateREPLACEclustersId, instancesId, projectsIdUpdates a cluster within an instance. Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster.
partial_update_clusterEXECclustersId, instancesId, projectsIdPartially updates a cluster within a project. This method is the preferred way to update a Cluster. To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the update_mask. To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask.

SELECT examples

Lists information about clusters in an instance.

SELECT
name,
clusterConfig,
defaultStorageType,
encryptionConfig,
location,
serveNodes,
state
FROM google.bigtableadmin.clusters
WHERE instancesId = '{{ instancesId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new clusters resource.

/*+ create */
INSERT INTO google.bigtableadmin.clusters (
instancesId,
projectsId,
name,
location,
serveNodes,
clusterConfig,
defaultStorageType,
encryptionConfig
)
SELECT
'{{ instancesId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ location }}',
'{{ serveNodes }}',
'{{ clusterConfig }}',
'{{ defaultStorageType }}',
'{{ encryptionConfig }}'
;

REPLACE example

Replaces all fields in the specified clusters resource.

/*+ update */
REPLACE google.bigtableadmin.clusters
SET
name = '{{ name }}',
location = '{{ location }}',
serveNodes = '{{ serveNodes }}',
clusterConfig = '{{ clusterConfig }}',
defaultStorageType = '{{ defaultStorageType }}',
encryptionConfig = '{{ encryptionConfig }}'
WHERE
clustersId = '{{ clustersId }}'
AND instancesId = '{{ instancesId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified clusters resource.

/*+ delete */
DELETE FROM google.bigtableadmin.clusters
WHERE clustersId = '{{ clustersId }}'
AND instancesId = '{{ instancesId }}'
AND projectsId = '{{ projectsId }}';