m1m6 / java-docs-samples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

License:Apache License 2.0


Languages

Language:Java 94.9%Language:Shell 1.7%Language:HTML 1.5%Language:JavaScript 1.1%Language:Batchfile 0.4%Language:CSS 0.3%Language:Python 0.1%Language:XSLT 0.0%