User friendly container for Google Cloud Bigtable Instance.

class, client, location_id='see-existing-cluster', display_name=None, serve_nodes=3)[source]#

Bases: object

Representation of a Google Cloud Bigtable Instance.

We can use a Instance to:


For now, we leave out the default_storage_type (an enum) which if not sent will end up as data_v2_pb2.STORAGE_SSD.

  • instance_id (str) – The ID of the instance.
  • client (Client) – The client that owns the instance. Provides authorization and a project ID.
  • location_id (str) – ID of the location in which the instance will be created. Required for instances which do not yet exist.
  • display_name (str) – (Optional) The display name for the instance in the Cloud Console UI. (Must be between 4 and 30 characters.) If this value is not set in the constructor, will fall back to the instance ID.
  • serve_nodes (int) – (Optional) The number of nodes in the instance’s cluster; used to set up the instance’s cluster.
cluster(cluster_id, serve_nodes=3)[source]#

Factory to create a cluster associated with this client.

  • cluster_id (str) – The ID of the cluster.
  • serve_nodes (int) – (Optional) The number of nodes in the cluster. Defaults to 3.
Return type:



The cluster owned by this client.


Make a copy of this instance.

Copies the local data stored as simple types and copies the client attached to this instance.

Return type:Instance
Returns:A copy of the current instance.

Create this instance.


Uses the project and instance_id on the current Instance in addition to the display_name. To change them before creating, reset the values via

instance.display_name = 'New display name'
instance.instance_id = 'i-changed-my-mind'

before calling create().

Return type:Operation
Returns:The long-running operation corresponding to the create operation.

Delete this instance.

Marks a instance and all of its tables for permanent deletion in 7 days.

Immediately upon completion of the request:

  • Billing will cease for all of the instance’s reserved resources.
  • The instance’s delete_time field will be set 7 days in the future.

Soon afterward:

  • All tables within the instance will become unavailable.

At the instance’s delete_time:

  • The instance and all of its tables will immediately and irrevocably disappear from the API, and their data will be permanently deleted.
classmethod from_pb(instance_pb, client)[source]#

Creates a instance instance from a protobuf.

  • instance_pb (instance_pb2.Instance) – A instance protobuf object.
  • client (Client) – The client that owns the instance.
Return type:



The instance parsed from the protobuf response.


ValueError if the instance name does not match projects/{project}/instances/{instance_id} or if the parsed project ID does not match the project ID on the client.


Lists clusters in this instance.

Return type:tuple
Returns:A pair of results, the first is a list of Cluster s returned and the second is a list of strings (the failed locations in the request).

List the tables in this instance.

Return type:list of Table
Returns:The list of tables owned by the instance.
Raises:ValueError if one of the returned tables has a name that is not of the expected format.

Instance name used in requests.


This property will not change if instance_id does not, but the return value is not cached.

The instance name is of the form

Return type:str
Returns:The instance name.

Reload the metadata for this instance.


Factory to create a table associated with this instance.

Parameters:table_id (str) – The ID of the table.
Return type:Table
Returns:The table owned by this instance.

Update this instance.


Updates the display_name. To change that value before updating, reset its values via

instance.display_name = 'New display name'

before calling update().