Skip to content

Commit a6d6fa3

Browse files
authored
Add a bit more to the readme (#625)
1. Put an index up (Note that we have to GAE Standard samples at the top level) 2. Add some info about credentials.
1 parent 914f778 commit a6d6fa3

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,41 @@
66

77
This is a repository that contains java code snippets on [Cloud Platform Documentation](https://cloud.google.com/docs/).
88

9+
The repo is organized as follows:
10+
11+
* [App Engine Standard](appengine)
12+
* [TaskQueue](taskqueue) <!-- shouldn't this be in appengien ?? -->
13+
* [Unit Tests](unittests)
14+
* [App Engine Flexible](flexible)
15+
* [Compute Engine](compute)
16+
17+
Technology Samples:
18+
19+
* [Bigquery](bigquery)
20+
* [Datastore](datastore)
21+
* [Endpoints](endpoints)
22+
* [Key Management Service](kms)
23+
* [Logging](logging)
24+
* [Monitoring](monitoring)
25+
* [Natural Language](language)
26+
* [PubSub](pubsub)
27+
* [Cloud Spanner](spanner)
28+
* [Speech](speech)
29+
* [Cloud Storage](storage)
30+
* [Translate](translate)
31+
* [Vision](vision)
32+
33+
## Credentials Example
34+
35+
The documentation for [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials).
36+
37+
`BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();`
38+
39+
The client library looks for credentials using the following rules:
40+
41+
1. `GOOGLE_APPLICATION_CREDENTIALS` environment variable, pointing to a service account key JSON file path.
42+
2. Cloud SDK credentials `gcloud auth application-default login`
43+
3. App Engine standard environment credentials.
44+
4. Compute Engine credentials.
45+
46+
You can override this behavior using setCredentials in `BigQueryOptions.newBuilder()` by adding `setCredentials(Credentials credentials)` from [ServiceOptions.builder](http://googlecloudplatform.github.io/google-cloud-java/0.12.0/apidocs/com/google/cloud/ServiceOptions.Builder.html#setCredentials-com.google.auth.Credentials-) and [Credentials](http://google.github.io/google-auth-library-java/releases/0.6.0/apidocs/com/google/auth/Credentials.html?is-external=true).

0 commit comments

Comments
 (0)