clusters
Creates, updates, deletes, gets or lists a clusters
resource.
Overview
Name | clusters |
Type | Resource |
Id | google.bigtableadmin.clusters |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The unique name of the cluster. Values are of the form projects/{project}/instances/{instance}/clusters/a-z* . |
clusterConfig | object | Configuration for this cluster. (id: ClusterConfig) |
defaultStorageType | string | Immutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden. |
encryptionConfig | object | Immutable. The encryption configuration for CMEK-protected clusters. (id: EncryptionConfig) |
location | string | Immutable. 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} . |
nodeScalingFactor | string | Immutable. The node scaling factor of this cluster. |
serveNodes | integer (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. |
state | string | Output only. The current state of the cluster. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The unique name of the cluster. Values are of the form projects/{project}/instances/{instance}/clusters/a-z* . |
clusterConfig | object | Configuration for this cluster. (id: ClusterConfig) |
defaultStorageType | string | Immutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden. |
encryptionConfig | object | Immutable. The encryption configuration for CMEK-protected clusters. (id: EncryptionConfig) |
location | string | Immutable. 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} . |
nodeScalingFactor | string | Immutable. The node scaling factor of this cluster. |
serveNodes | integer (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. |
state | string | Output only. The current state of the cluster. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , instancesId , clustersId | Gets information about a cluster. | |
list | select | projectsId , instancesId | pageToken | Lists information about clusters in an instance. |
create | insert | projectsId , instancesId | clusterId | 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. |
update | replace | projectsId , instancesId , clustersId | 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. | |
delete | delete | projectsId , instancesId , clustersId | Deletes a cluster from an instance. | |
partial_update_cluster | exec | projectsId , instancesId , clustersId | updateMask | 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. |
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.
Name | Datatype | Description |
---|---|---|
clustersId | string | |
instancesId | string | |
projectsId | string | |
clusterId | string | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
Lists information about clusters in an instance.
SELECT
name,
clusterConfig,
defaultStorageType,
encryptionConfig,
location,
nodeScalingFactor,
serveNodes,
state
FROM google.bigtableadmin.clusters
WHERE projectsId = '{{ projectsId }}' -- required
AND instancesId = '{{ instancesId }}' -- required
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: clusters
props:
- name: projectsId
value: string
description: Required parameter for the clusters resource.
- name: instancesId
value: string
description: Required parameter for the clusters resource.
- name: name
value: string
description: >
The unique name of the cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/a-z*`.
- name: location
value: string
description: >
Immutable. 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}`.
- name: serveNodes
value: integer
description: >
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.
- name: nodeScalingFactor
value: string
description: >
Immutable. The node scaling factor of this cluster.
valid_values: ['NODE_SCALING_FACTOR_UNSPECIFIED', 'NODE_SCALING_FACTOR_1X', 'NODE_SCALING_FACTOR_2X']
- name: clusterConfig
value: object
description: >
Configuration for this cluster.
- name: defaultStorageType
value: string
description: >
Immutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden.
valid_values: ['STORAGE_TYPE_UNSPECIFIED', 'SSD', 'HDD']
- name: encryptionConfig
value: object
description: >
Immutable. The encryption configuration for CMEK-protected clusters.
- name: clusterId
value: string
REPLACE
examples
- update
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
- delete
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
- partial_update_cluster
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 }}"
}';