Skip to main content

clusters

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

Overview

Nameclusters
TypeResource
Idgoogle.bigtableadmin.clusters

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe unique name of the cluster. Values are of the form projects/{project}/instances/{instance}/clusters/a-z*.
clusterConfigobjectConfiguration for this cluster. (id: ClusterConfig)
defaultStorageTypestringImmutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden.
encryptionConfigobjectImmutable. The encryption configuration for CMEK-protected clusters. (id: EncryptionConfig)
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}.
nodeScalingFactorstringImmutable. The node scaling factor of this cluster.
serveNodesinteger (int32)The 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

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, instancesId, clustersIdGets information about a cluster.
listselectprojectsId, instancesIdpageTokenLists information about clusters in an instance.
createinsertprojectsId, instancesIdclusterIdCreates 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.
updatereplaceprojectsId, instancesId, clustersIdUpdates 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.
deletedeleteprojectsId, instancesId, clustersIdDeletes a cluster from an instance.
partial_update_clusterexecprojectsId, instancesId, clustersIdupdateMaskPartially 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
clustersIdstring
instancesIdstring
projectsIdstring
clusterIdstring
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets information about a cluster.

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

INSERT examples

Creates 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.

INSERT INTO google.bigtableadmin.clusters (
data__name,
data__location,
data__serveNodes,
data__nodeScalingFactor,
data__clusterConfig,
data__defaultStorageType,
data__encryptionConfig,
projectsId,
instancesId,
clusterId
)
SELECT
'{{ name }}',
'{{ location }}',
{{ serveNodes }},
'{{ nodeScalingFactor }}',
'{{ clusterConfig }}',
'{{ defaultStorageType }}',
'{{ encryptionConfig }}',
'{{ projectsId }}',
'{{ instancesId }}',
'{{ clusterId }}'
RETURNING
name,
done,
error,
metadata,
response
;

REPLACE examples

Updates 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.

REPLACE google.bigtableadmin.clusters
SET
data__name = '{{ name }}',
data__location = '{{ location }}',
data__serveNodes = {{ serveNodes }},
data__nodeScalingFactor = '{{ nodeScalingFactor }}',
data__clusterConfig = '{{ clusterConfig }}',
data__defaultStorageType = '{{ defaultStorageType }}',
data__encryptionConfig = '{{ encryptionConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND clustersId = '{{ clustersId }}' --required
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a cluster from an instance.

DELETE FROM google.bigtableadmin.clusters
WHERE projectsId = '{{ projectsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND clustersId = '{{ clustersId }}' --required;

Lifecycle Methods

Partially 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.

EXEC google.bigtableadmin.clusters.partial_update_cluster 
@projectsId='{{ projectsId }}' --required,
@instancesId='{{ instancesId }}' --required,
@clustersId='{{ clustersId }}' --required,
@updateMask='{{ updateMask }}'
@@json=
'{
"name": "{{ name }}",
"location": "{{ location }}",
"serveNodes": {{ serveNodes }},
"nodeScalingFactor": "{{ nodeScalingFactor }}",
"clusterConfig": "{{ clusterConfig }}",
"defaultStorageType": "{{ defaultStorageType }}",
"encryptionConfig": "{{ encryptionConfig }}"
}';