Client
(
project
=
None
,
credentials
=
None
,
read_only
=
False
,
admin
=
False
,
client_info
=
< google
.
api_core
.
gapic_v1
.
client_info
.
ClientInfo
object
> ,
client_options
=
None
,
admin_client_options
=
None
,
channel
=
None
)
Client for interacting with Google Cloud Bigtable API.
Parameters
Name | Description |
project
|
(Optional) The ID of the project which owns the instances, tables and data. If not provided, will attempt to determine from the environment. |
credentials
|
(Optional) The OAuth2 Credentials to use for this client. If not passed, falls back to the default inferred from the environment. |
read_only
|
bool
(Optional) Boolean indicating if the data scope should be for reading only (or for writing as well). Defaults to :data: |
admin
|
bool
(Optional) Boolean indicating if the client will be used to interact with the Instance Admin or Table Admin APIs. This requires the :const: |
client_options
|
(Optional) Client options used to set user options on the client. API Endpoint should be set through client_options. |
admin_client_options
|
(Optional) Client options used to set user options on the client. API Endpoint for admin operations should be set through admin_client_options. |
Properties
instance_admin_client
Getter for the gRPC stub used for the Table Admin API.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_instance_admin_client] :end-before: [END bigtable_instance_admin_client]
Type | Description |
---|---|
`ValueErro
|
Type | Description |
|
A BigtableInstanceAdmin instance. |
project_path
Project name to be used with Instance Admin API.
.. literalinclude:: snippets.py :start-after: [START bigtable_project_path] :end-before: [END bigtable_project_path]The project name is of the form
`"projects/{project}"`
Type | Description |
str
|
Return a fully-qualified project string. |
table_admin_client
Getter for the gRPC stub used for the Table Admin API.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_table_admin_client] :end-before: [END bigtable_table_admin_client]
Type | Description |
---|---|
`ValueErro
|
Type | Description |
|
A BigtableTableAdmin instance. |
table_data_client
Getter for the gRPC stub used for the Table Admin API.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_table_data_client] :end-before: [END bigtable_table_data_client]
Type | Description |
|
A BigtableClient object. |
Methods
instance
instance
(
instance_id
,
display_name
=
None
,
instance_type
=
None
,
labels
=
None
)
Factory to create a instance associated with this client.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_create_prod_instance] :end-before: [END bigtable_create_prod_instance]
Name | Description |
instance_id
|
str
The ID of the instance. |
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. |
instance_type
|
int
(Optional) The type of the instance. Possible values are represented by the following constants: :data: |
labels
|
dict
(Optional) Labels are a flexible and lightweight mechanism for organizing cloud resources into groups that reflect a customer's organizational needs and deployment strategies. They can be used to filter resources and aggregate metrics. Label keys must be between 1 and 63 characters long. Maximum 64 labels can be associated with a given resource. Label values must be between 0 and 63 characters long. Keys and values must both be under 128 bytes. |
Type | Description |
Instance
|
an instance owned by this client. |
list_clusters
list_clusters
()
List the clusters in the project.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_list_clusters_in_project] :end-before: [END bigtable_list_clusters_in_project]
Type | Description |
tuple
|
(clusters, failed_locations), where 'clusters' is list of Cluster , and 'failed_locations' is a list of strings representing locations which could not be resolved. |
list_instances
list_instances
()
List instances owned by the project.
For example:
.. literalinclude:: snippets.py :start-after: [START bigtable_list_instances] :end-before: [END bigtable_list_instances]
Type | Description |
tuple
|
(instances, failed_locations), where 'instances' is list of Instance , and 'failed_locations' is a list of locations which could not be resolved. |