Cluster#
User friendly container for Google Cloud Bigtable Cluster.
-
class
google.cloud.bigtable.cluster.
Cluster
(cluster_id, instance, serve_nodes=3)[source]# Bases:
object
Representation of a Google Cloud Bigtable Cluster.
We can use a
Cluster
to:Note
For now, we leave out the
default_storage_type
(an enum) which if not sent will end up asdata_v2_pb2.STORAGE_SSD
.Parameters: - cluster_id (str) – The ID of the cluster.
- instance (
instance.Instance
) – The instance where the cluster resides. - serve_nodes (int) – (Optional) The number of nodes in the cluster.
Defaults to
DEFAULT_SERVE_NODES
.
-
copy
()[source]# Make a copy of this cluster.
Copies the local data stored as simple types and copies the client attached to this instance.
Return type: Cluster
Returns: A copy of the current cluster.
-
create
()[source]# Create this cluster.
Note
Uses the
project
,instance
andcluster_id
on the currentCluster
in addition to theserve_nodes
. To change them before creating, reset the values viacluster.serve_nodes = 8 cluster.cluster_id = 'i-changed-my-mind'
before calling
create()
.Return type: Operation
Returns: The long-running operation corresponding to the create operation.
-
delete
()[source]# Delete this cluster.
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.
-
classmethod
from_pb
(cluster_pb, instance)[source]# Creates a cluster instance from a protobuf.
Parameters: - cluster_pb (
instance_pb2.Cluster
) – A cluster protobuf object. - instance (
instance.Instance>
) – The instance that owns the cluster.
Return type: Returns: The cluster parsed from the protobuf response.
Raises: ValueError
if the cluster name does not matchprojects/{project}/instances/{instance}/clusters/{cluster_id}
or if the parsed project ID does not match the project ID on the client.- cluster_pb (
-
google.cloud.bigtable.cluster.
DEFAULT_SERVE_NODES
= 3# Default number of nodes to use when creating a cluster.