Python client library  |  Google Cloud (original) (raw)

Spanner Client

Parent client for calling the Cloud Spanner API.

This is the base from which all interactions with the API occur.

In the hierarchy of API concepts

class google.cloud.spanner_v1.client.Client(project=None, credentials=None, client_info=<google.api_core.gapic_v1.client_info.ClientInfo object>, client_options=None, query_options=None, route_to_leader_enabled=False)

Bases: google.cloud.client.ClientWithProject

Client for interacting with Cloud Spanner API.

NOTE: Since the Cloud Spanner API requires the gRPC transport, no_http argument is accepted by this class.

SCOPE(: Optional[Tuple[str, ...] = ('https://www.googleapis.com/auth/spanner.admin', )

The scopes required for Google Cloud Spanner.

copy()

Make a copy of this client.

Copies the local data stored as simple types but does not copy the current state of any open connections with the Cloud Bigtable API.

property credentials()

Getter for client’s credentials.

property database_admin_api()

Helper for session-related API calls.

instance(instance_id, configuration_name=None, display_name=None, node_count=None, labels=None, processing_units=None)

Factory to create a instance associated with this client.

property instance_admin_api()

Helper for session-related API calls.

list_instance_configs(page_size=None)

List available instance configurations for the client’s project.

See RPC docs.

list_instances(filter_='', page_size=None)

List instances for the client’s project.

Seehttps://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.InstanceAdmin.ListInstances

property project_name()

Project name to be used with Spanner APIs.

NOTE: This property will not change if project does not, but the return value is not cached.

The project name is of the form

"projects/{project}"

property route_to_leader_enabled()

Getter for if read-write or pdml requests will be routed to leader.