@@ -17,34 +17,12 @@ Setup
17
17
Authentication
18
18
++++++++++++++
19
19
20
- Authentication is typically done through `Application Default Credentials `_,
21
- which means you do not have to change the code to authenticate as long as
22
- your environment has credentials. You have a few options for setting up
23
- authentication:
20
+ This sample requires you to have authentication setup. Refer to the
21
+ `Authentication Getting Started Guide `_ for instructions on setting up
22
+ credentials for applications.
24
23
25
- #. When running locally, use the `Google Cloud SDK `_
26
-
27
- .. code-block :: bash
28
-
29
- gcloud auth application-default login
30
-
31
-
32
- #. When running on App Engine or Compute Engine, credentials are already
33
- set-up. However, you may need to configure your Compute Engine instance
34
- with `additional scopes `_.
35
-
36
- #. You can create a `Service Account key file `_. This file can be used to
37
- authenticate to Google Cloud Platform services from any environment. To use
38
- the file, set the ``GOOGLE_APPLICATION_CREDENTIALS `` environment variable to
39
- the path to the key file, for example:
40
-
41
- .. code-block :: bash
42
-
43
- export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account.json
44
-
45
- .. _Application Default Credentials : https://cloud.google.com/docs/authentication#getting_credentials_for_server-centric_flow
46
- .. _additional scopes : https://cloud.google.com/compute/docs/authentication#using
47
- .. _Service Account key file : https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount
24
+ .. _Authentication Getting Started Guide :
25
+ https://cloud.google.com/docs/authentication/getting-started
48
26
49
27
Install Dependencies
50
28
++++++++++++++++++++
@@ -83,7 +61,7 @@ To run this sample:
83
61
84
62
usage: snippets.py [-h] [--database-id DATABASE_ID]
85
63
instance_id
86
- {create_database,insert_data,query_data,read_data,add_column,update_data,query_data_with_new_column,read_write_transaction,read_only_transaction,add_index,query_data_with_index,read_data_with_index,add_storing_index,read_data_with_storing_index}
64
+ {create_database,insert_data,query_data,read_data,read_stale_data, add_column,update_data,query_data_with_new_column,read_write_transaction,read_only_transaction,add_index,query_data_with_index,read_data_with_index,add_storing_index,read_data_with_storing_index}
87
65
...
88
66
89
67
This application demonstrates how to do basic operations using Cloud
@@ -93,13 +71,15 @@ To run this sample:
93
71
94
72
positional arguments:
95
73
instance_id Your Cloud Spanner instance ID.
96
- {create_database,insert_data,query_data,read_data,add_column,update_data,query_data_with_new_column,read_write_transaction,read_only_transaction,add_index,query_data_with_index,read_data_with_index,add_storing_index,read_data_with_storing_index}
74
+ {create_database,insert_data,query_data,read_data,read_stale_data, add_column,update_data,query_data_with_new_column,read_write_transaction,read_only_transaction,add_index,query_data_with_index,read_data_with_index,add_storing_index,read_data_with_storing_index}
97
75
create_database Creates a database and tables for sample data.
98
76
insert_data Inserts sample data into the given database. The
99
77
database and table must already exist and can be
100
78
created using ` create_database` .
101
79
query_data Queries sample data from the database using SQL.
102
80
read_data Reads sample data from the database.
81
+ read_stale_data Reads sample data from the database. The data is
82
+ exactly 10 seconds stale.
103
83
add_column Adds a new column to the Albums table in the example
104
84
database.
105
85
update_data Updates sample data in the database. This updates the
0 commit comments