Skip to content

Commit bec9816

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 1311 b: refs/heads/resource-manager c: e3ca489 h: refs/heads/master i: 1309: b41db53 1307: 3d4e53c 1303: b8f8666 1295: 6db91d9 1279: 4d166d8 v: v3
1 parent 469b32c commit bec9816

73 files changed

Lines changed: 1269 additions & 2254 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: d1b373c30c176edc08692348167bec3a244bb823
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
66
refs/heads/pubsub-alpha: dea33f5d017ff85c14573b4a06c6b1f2c4bbe2b0
7-
refs/heads/resource-manager: ea56c11b8cc8117ad110808f483af32fc13fae31
7+
refs/heads/resource-manager: e3ca489ed3c01cb94f21f417e109fe3a8e922dfa

branches/resource-manager/README.md

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,14 @@ This client supports the following Google Cloud Platform services:
2020
2121
Quickstart
2222
----------
23-
If you are using Maven, add this to your pom.xml file
23+
Add this to your pom.xml file
2424
```xml
2525
<dependency>
2626
<groupId>com.google.gcloud</groupId>
2727
<artifactId>gcloud-java</artifactId>
28-
<version>0.0.11</version>
28+
<version>0.0.10</version>
2929
</dependency>
3030
```
31-
If you are using Gradle, add this to your dependencies
32-
```Groovy
33-
compile 'com.google.gcloud:gcloud-java:jar:0.0.11'
34-
```
35-
If you are using SBT, add this to your dependencies
36-
```Scala
37-
libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.0.11"
38-
```
3931

4032
Example Applications
4133
--------------------
@@ -45,61 +37,15 @@ Example Applications
4537
- [`StorageExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java) - A simple command line interface providing some of Cloud Storage's functionality
4638
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/StorageExample.html).
4739

48-
Specifying a Project ID
49-
-----------------------
50-
51-
Most `gcloud-java` libraries require a project ID. There are multiple ways to specify this project ID.
52-
53-
1. When using `gcloud-java` libraries from within Compute/App Engine, there's no need to specify a project ID. It is automatically inferred from the production environment.
54-
2. When using `gcloud-java` elsewhere, you can do one of the following:
55-
* Supply the project ID when building the service options. For example, to use Datastore from a project with ID "PROJECT_ID", you can write:
56-
57-
```java
58-
Datastore datastore = DatastoreOptions.builder().projectId("PROJECT_ID").build().service();
59-
```
60-
* Specify the environment variable `GCLOUD_PROJECT` to be your desired project ID.
61-
* Set the project ID using the [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en). To use the SDK, [download the SDK](https://cloud.google.com/sdk/?hl=en) if you haven't already, and set the project ID from the command line. For example:
62-
63-
```
64-
gcloud config set project PROJECT_ID
65-
```
66-
67-
`gcloud-java` determines the project ID from the following sources in the listed order, stopping once it finds a value:
68-
69-
1. Project ID supplied when building the service options
70-
2. Project ID specified by the environment variable `GCLOUD_PROJECT`
71-
3. App Engine project ID
72-
4. Compute Engine project ID
73-
5. Google Cloud SDK project ID
74-
7540
Authentication
7641
--------------
7742

7843
There are multiple ways to authenticate to use Google Cloud services.
7944

8045
1. When using `gcloud-java` libraries from within Compute/App Engine, no additional authentication steps are necessary.
8146
2. When using `gcloud-java` libraries elsewhere, there are two options:
82-
* [Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). After downloading that key, you must do one of the following:
83-
* Define the environment variable GOOGLE_APPLICATION_CREDENTIALS to be the location of the key. For example:
84-
```bash
85-
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/key.json
86-
```
87-
* Supply the JSON credentials file when building the service options. For example, this Storage object has the necessary permissions to interact with your Google Cloud Storage data:
88-
```java
89-
Storage storage = StorageOptions.builder()
90-
.authCredentials(AuthCredentials.createForJson(new FileInputStream("/path/to/my/key.json"))
91-
.build()
92-
.service();
93-
```
94-
* If running locally for development/testing, you can use use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login` in command line). Be sure to set your project ID as described above.
95-
96-
`gcloud-java` looks for credentials in the following order, stopping once it finds credentials:
97-
98-
1. Credentials supplied when building the service options
99-
2. App Engine credentials
100-
3. Key file pointed to by the GOOGLE_APPLICATION_CREDENTIALS environment variable
101-
4. Google Cloud SDK credentials
102-
5. Compute Engine credentials
47+
* [Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). Supply a path to the downloaded JSON credentials file when building the options supplied to datastore/storage constructor.
48+
* If running locally for development/testing, you can use use [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en). To use the SDK authentication, [download the SDK](https://cloud.google.com/sdk/?hl=en) if you haven't already. Then login using the SDK (`gcloud auth login` in command line), and set your current project using `gcloud config set project PROJECT_ID`.
10349

10450
Google Cloud Datastore
10551
----------------------
@@ -121,7 +67,7 @@ import com.google.gcloud.datastore.Entity;
12167
import com.google.gcloud.datastore.Key;
12268
import com.google.gcloud.datastore.KeyFactory;
12369

124-
Datastore datastore = DatastoreOptions.defaultInstance().service();
70+
Datastore datastore = DatastoreOptions.getDefaultInstance().service();
12571
KeyFactory keyFactory = datastore.newKeyFactory().kind(KIND);
12672
Key key = keyFactory.newKey(keyName);
12773
Entity entity = datastore.get(key);

branches/resource-manager/gcloud-java-core/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,14 @@ This module provides common functionality required by service-specific modules o
1212

1313
Quickstart
1414
----------
15-
If you are using Maven, add this to your pom.xml file
15+
Add this to your pom.xml file
1616
```xml
1717
<dependency>
1818
<groupId>com.google.gcloud</groupId>
1919
<artifactId>gcloud-java-core</artifactId>
20-
<version>0.0.11</version>
20+
<version>0.0.10</version>
2121
</dependency>
2222
```
23-
If you are using Gradle, add this to your dependencies
24-
```Groovy
25-
compile 'com.google.gcloud:gcloud-java-core:jar:0.0.11'
26-
```
27-
If you are using SBT, add this to your dependencies
28-
```Scala
29-
libraryDependencies += "com.google.gcloud" % "gcloud-java-core" % "0.0.11"
30-
```
3123

3224
Java Versions
3325
-------------

branches/resource-manager/gcloud-java-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.google.gcloud</groupId>
1313
<artifactId>gcloud-java-pom</artifactId>
14-
<version>0.0.12-SNAPSHOT</version>
14+
<version>0.0.11-SNAPSHOT</version>
1515
</parent>
1616
<properties>
1717
<site.installationModule>gcloud-java-core</site.installationModule>

branches/resource-manager/gcloud-java-core/src/main/java/com/google/gcloud/AuthCredentials.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public boolean equals(Object obj) {
252252
@Override
253253
protected HttpRequestInitializer httpRequestInitializer(HttpTransport transport,
254254
Set<String> scopes) {
255-
return new HttpCredentialsAdapter(googleCredentials.createScoped(scopes));
255+
return new HttpCredentialsAdapter(googleCredentials);
256256
}
257257

258258
@Override

branches/resource-manager/gcloud-java-core/src/main/java/com/google/gcloud/BaseServiceException.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

branches/resource-manager/gcloud-java-core/src/main/java/com/google/gcloud/ExceptionHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ void verifyCaller(Callable<?> callable) {
231231
}
232232
}
233233

234-
public Set<Class<? extends Exception>> retriableExceptions() {
234+
public Set<Class<? extends Exception>> getRetriableExceptions() {
235235
return retriableExceptions;
236236
}
237237

238-
public Set<Class<? extends Exception>> nonRetriableExceptions() {
238+
public Set<Class<? extends Exception>> getNonRetriableExceptions() {
239239
return nonRetriableExceptions;
240240
}
241241

@@ -262,7 +262,7 @@ boolean shouldRetry(Exception ex) {
262262
/**
263263
* Returns an instance which retry any checked exception and abort on any runtime exception.
264264
*/
265-
public static ExceptionHandler defaultInstance() {
265+
public static ExceptionHandler getDefaultInstance() {
266266
return DEFAULT_INSTANCE;
267267
}
268268

branches/resource-manager/gcloud-java-core/src/main/java/com/google/gcloud/Page.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)