GitHunt
NN

nnegrey/java-docs-samples

java-docs-samples

Circle-CI Build Status
ghit.me
Coverage Status

This is a repository that contains java code snippets on Cloud Platform Documentation.

The repo is organized as follows:

Technology Samples:

Credentials Example

The documentation for 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 and Credentials.

Languages

Java94.3%Shell1.8%HTML1.7%JavaScript1.1%Batchfile0.4%CSS0.3%Protocol Buffer0.3%Python0.1%XSLT0.1%
Apache License 2.0
Created September 21, 2017
Updated September 21, 2017