Cluster(
cluster_id,
instance,
location_id=None,
serve_nodes=None,
default_storage_type=None,
_state=None,
)
Representation of a Google Cloud Bigtable Cluster.
We can use a Cluster
to:
reload
itselfcreate
itselfupdate
itselfdelete
itself
Parameters
Name | Description |
cluster_id |
str
The ID of the cluster. |
instance |
Instance
The instance where the cluster resides. |
location_id |
str
(Creation Only) The location where this cluster's nodes and storage reside . For best performance, clients should be located as close as possible to this cluster. For list of supported locations refer to https://cloud.google.com/bigtable/docs/locations |
serve_nodes |
int
(Optional) The number of nodes in the cluster. |
default_storage_type |
int
(Optional) The type of storage Possible values are represented by the following constants: :data: |
_state |
int
( |
Properties
name
Cluster name used in requests.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_cluster_name] :end-before: [END bigtable_cluster_name] :dedent: 4
The cluster name is of the form
`"projects/{project}/instances/{instance}/clusters/{cluster_id}"`
Type | Description |
str | The cluster name. |
state
google.cloud.bigtable.enums.Cluster.State: state of cluster.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_cluster_state] :end-before: [END bigtable_cluster_state] :dedent: 4
Methods
create
create()
Create this cluster.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_create_cluster] :end-before: [END bigtable_create_cluster] :dedent: 4
Type | Description |
| The long-running operation corresponding to the create operation. |
delete
delete()
Delete this cluster.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_delete_cluster] :end-before: [END bigtable_delete_cluster] :dedent: 4
Marks a cluster and all of its tables for permanent deletion in 7 days.
Immediately upon completion of the request:
- Billing will cease for all of the cluster's reserved resources.
- The cluster's
delete_time
field will be set 7 days in the future.
Soon afterward:
- All tables within the cluster will become unavailable.
At the cluster's delete_time
:
- The cluster and all of its tables will immediately and irrevocably disappear from the API, and their data will be permanently deleted.
exists
exists()
Check whether the cluster already exists.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_check_cluster_exists] :end-before: [END bigtable_check_cluster_exists] :dedent: 4
Type | Description |
bool | True if the table exists, else False. |
from_pb
from_pb(cluster_pb, instance)
Creates an cluster instance from a protobuf.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_cluster_from_pb] :end-before: [END bigtable_cluster_from_pb] :dedent: 4
Name | Description |
cluster_pb |
An instance protobuf object. |
instance |
Instance
The instance that owns the cluster. |
Type | Description |
`ValueErro |
Type | Description |
| The Cluster parsed from the protobuf response. |
reload
reload()
Reload the metadata for this cluster.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_reload_cluster] :end-before: [END bigtable_reload_cluster] :dedent: 4
update
update()
Update this cluster.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_update_cluster] :end-before: [END bigtable_update_cluster] :dedent: 4
Type | Description |
| The long-running operation corresponding to the update operation. |