Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a bit more to the readme #625

Merged
merged 1 commit into from
Apr 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,41 @@

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

The repo is organized as follows:

* [App Engine Standard](appengine)
* [TaskQueue](taskqueue) <!-- shouldn't this be in appengien ?? -->
* [Unit Tests](unittests)
* [App Engine Flexible](flexible)
* [Compute Engine](compute)

Technology Samples:

* [Bigquery](bigquery)
* [Datastore](datastore)
* [Endpoints](endpoints)
* [Key Management Service](kms)
* [Logging](logging)
* [Monitoring](monitoring)
* [Natural Language](language)
* [PubSub](pubsub)
* [Cloud Spanner](spanner)
* [Speech](speech)
* [Cloud Storage](storage)
* [Translate](translate)
* [Vision](vision)

## Credentials Example

The documentation for [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials).

`BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();`

The client library looks for credentials using the following rules:

1. `GOOGLE_APPLICATION_CREDENTIALS` environment variable, pointing to a service account key JSON file path.
2. Cloud SDK credentials `gcloud auth application-default login`
3. App Engine standard environment credentials.
4. Compute Engine credentials.

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).