Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fac54b9
updating 'PubSubExample' to latest api (#1808)
jabubake Mar 24, 2017
ed012ef
Pubsub update (#1818)
michaelbausor Mar 28, 2017
38bace4
Update spi classes (#1817)
shinfan Mar 28, 2017
6de41d5
Update README.md (#1825) [ci skip]
ttharuntej Mar 29, 2017
9012428
Add DURABLE_REDUCED_AVAILABILITY storage class (#1834)
jean-philippe-martin Mar 30, 2017
d726f41
logging: make flush wait for writes (#1815)
pongad Mar 31, 2017
e4acca8
use new PartitionKey implementation (#1841)
pongad Mar 31, 2017
6b0d5bd
Release 0.11.0
garrettjonesgoogle Mar 31, 2017
6af56e7
Updating version in README files. [ci skip]
garrettjonesgoogle Mar 31, 2017
8b3d64e
Update version to 0.11.1-SNAPSHOT (#1843)
garrettjonesgoogle Mar 31, 2017
5227eaa
Added a missing @Test annotation (#1842)
vkedia Mar 31, 2017
88eff83
pubsub: make Subscriber use ApiService (#1824)
pongad Apr 3, 2017
7d8cc9a
SPI: Adding @ExperimentalApi back to logging client classes (#1844)
garrettjonesgoogle Apr 3, 2017
fe142cf
Bumping NL, Translate to beta (#1848)
garrettjonesgoogle Apr 3, 2017
d28fc36
Release 0.11.1
garrettjonesgoogle Apr 3, 2017
acd9d77
Updating version in README files. [ci skip]
garrettjonesgoogle Apr 3, 2017
e5b3b78
Update version to 0.11.2-SNAPSHOT (#1852)
garrettjonesgoogle Apr 3, 2017
c42d5d3
pubsub: remove obsolete doc references (#1823)
pongad Apr 4, 2017
a7967f4
adding functions to manage life cycle of resources in ITComputeTest (…
neozwu Apr 4, 2017
3a03993
Add Speech v1. (#1858)
shinfan Apr 4, 2017
78346c3
Make logging overrides the default channel provider (#1820)
shinfan Apr 5, 2017
8b10099
Added more unit tests for SessionPool (#1862)
vkedia Apr 5, 2017
2745831
Rename Translate title to Translation [ci skip] (#1867)
shinfan Apr 5, 2017
03badf6
Release 0.11.2
michaelbausor Apr 5, 2017
ba7adcd
Updating version in README files. [ci skip]
michaelbausor Apr 5, 2017
38095d6
Update pom.xml version to 0.11.3-SNAPSHOT (#1870)
michaelbausor Apr 5, 2017
3717ac6
pubsub: acquire FlowController before releasing (#1831)
pongad Apr 6, 2017
32e2af2
Revert "pubsub: acquire FlowController before releasing (#1831)" (#1872)
pongad Apr 6, 2017
714bb6f
pubsub: make deprecated methods package-private (#1861)
pongad Apr 6, 2017
67874a7
pubsub: rename newBuilder to defaultBuilder (#1873)
pongad Apr 6, 2017
ed2ea41
GAE (Flex_Java/Flex_Custom/Flex_Compat/Std_Java8), GCE, GKE testing a…
vam-google Apr 6, 2017
7074c6d
Replace a constant of type Set with ImmutableSet (#1876)
vkedia Apr 6, 2017
d71d8c1
Language v1beta2 Release (#1878)
vam-google Apr 7, 2017
c531a0a
Regenerating SPI: use setEndpoint (#1879)
pongad Apr 7, 2017
c2fb49e
remove last use of setPort/setServiceAddress (#1880)
pongad Apr 7, 2017
3e5ae85
new code snippet for push subscription + cleanup of deprecated snipp…
jabubake Apr 7, 2017
bb6321f
Release 0.12.0
vam-google Apr 7, 2017
f51256a
Updating version in README files. [ci skip]
vam-google Apr 7, 2017
ceb587c
Merge pull request #1885 from vam-google/master
vam-google Apr 7, 2017
88aef0d
Update version to 0.12.1-SNAPSHOT (#1886)
vam-google Apr 7, 2017
58d7edf
Update version of google-auth-java to 0.6.1 (#1888)
vkedia Apr 7, 2017
1905cf8
Don't use `UrlFetchTransport` in App Engine Flex environment (#1893)
vam-google Apr 11, 2017
4576cd6
Add annotations to specify GCP launch stage (#1889)
rybosome Apr 11, 2017
e5e1925
Add Identity Access Management (IAM) to the Storage API (#1812)
rybosome Apr 7, 2017
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
57 changes: 30 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ This client supports the following Google Cloud Platform services at a [Beta](#v
- [Google Cloud Datastore](#google-cloud-datastore-beta) (Beta)
- [Google Cloud Storage](#google-cloud-storage-beta) (Beta)
- [Cloud Spanner](#cloud-spanner-beta) (Beta)
- [Google Cloud Translation](#google-translation-beta) (Beta)
- Cloud Vision (Beta)
- Cloud Natural Language (Beta)

This client supports the following Google Cloud Platform services at an [Alpha](#versioning) quality level:

- [Google Cloud Compute](#google-cloud-compute-alpha) (Alpha)
- [Google Cloud DNS](#google-cloud-dns-alpha) (Alpha)
- [Google Cloud Pub/Sub](#google-cloud-pubsub-alpha) (Alpha - Not working on App Engine Standard)
- [Google Cloud Resource Manager](#google-cloud-resource-manager-alpha) (Alpha)
- [Google Cloud Translate](#google-translate-alpha) (Alpha)

> Note: This client is a work-in-progress, and may occasionally
> make backwards-incompatible changes.
Expand All @@ -45,16 +46,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud</artifactId>
<version>0.10.0-alpha</version>
<version>0.12.0-alpha</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud:0.10.0-alpha'
compile 'com.google.cloud:google-cloud:0.12.0-alpha'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud" % "0.10.0-alpha"
libraryDependencies += "com.google.cloud" % "google-cloud" % "0.12.0-alpha"
```

For running on Google App Engine, see [more instructions here](./APPENGINE.md).
Expand Down Expand Up @@ -88,7 +89,7 @@ Example Applications
- Read more about using this application on the [`StorageExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/storage/StorageExample.html).
- [`TaskList`](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/datastore/src/main/java/com/google/datastore/snippets/TaskList.java) - A command line application that uses Cloud Datastore to manage a to-do list.
- Read about how to run the application on its [README page](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/datastore).
- [`TranslateExample`](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) - A simple command line interface providing some of Google Translate's functionality
- [`TranslateExample`](./google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java) - A simple command line interface providing some of Google Translation's functionality
- Read more about using this application on the [`TranslateExample` docs page](https://googlecloudplatform.github.io/google-cloud-java/apidocs/?com/google/cloud/examples/translate/TranslateExample.html).

Specifying a Project ID
Expand Down Expand Up @@ -585,29 +586,31 @@ Google Cloud Pub/Sub (Alpha)
Here is a code snippet showing a simple usage example from within Compute Engine/App Engine
Flexible. Note that you must [supply credentials](#authentication) and a project ID if running this
snippet elsewhere. Complete source code can be found at
[CreateSubscriptionAndPullMessages.java](./google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/CreateSubscriptionAndPullMessages.java).
[CreateTopicAndPublishMessages.java](./google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/CreateTopicAndPublishMessages.java).

```java
import com.google.cloud.pubsub.Message;
import com.google.cloud.pubsub.PubSub;
import com.google.cloud.pubsub.PubSub.MessageConsumer;
import com.google.cloud.pubsub.PubSub.MessageProcessor;
import com.google.cloud.pubsub.PubSubOptions;
import com.google.cloud.pubsub.Subscription;
import com.google.cloud.pubsub.SubscriptionInfo;

try (PubSub pubsub = PubSubOptions.getDefaultInstance().getService()) {
Subscription subscription =
pubsub.create(SubscriptionInfo.of("test-topic", "test-subscription"));
MessageProcessor callback = new MessageProcessor() {
@Override
public void process(Message message) throws Exception {
System.out.printf("Received message \"%s\"%n", message.getPayloadAsString());
}
};
// Create a message consumer and pull messages (for 60 seconds)
try (MessageConsumer consumer = subscription.pullAsync(callback)) {
Thread.sleep(60_000);
import com.google.api.gax.core.ApiFuture;
import com.google.cloud.pubsub.spi.v1.Publisher;
import com.google.cloud.pubsub.spi.v1.TopicAdminClient;
import com.google.protobuf.ByteString;
import com.google.pubsub.v1.PubsubMessage;
import com.google.pubsub.v1.TopicName;

TopicName topic = TopicName.create("test-project", "test-topic");
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
topicAdminClient.createTopic(topic);
}

Publisher publisher = null;
try {
publisher = Publisher.newBuilder(topic).build();
ByteString data = ByteString.copyFromUtf8("my message");
PubsubMessage pubsubMessage = PubsubMessage.newBuilder().setData(data).build();
ApiFuture<String> messageId = publisher.publish(pubsubMessage);
System.out.println("published with message ID: " + messageId.get());
} finally {
if (publisher != null) {
publisher.shutdown();
}
}
```
Expand Down Expand Up @@ -647,7 +650,7 @@ while (projectIterator.hasNext()) {
}
```

Google Translate (Alpha)
Google Translation (Beta)
----------------

- [API Documentation][translate-api]
Expand Down
64 changes: 28 additions & 36 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,44 +145,36 @@ uses the `RemoteLoggingHelper` to create a metric.

### Testing code that uses Pub/Sub

#### On your machine

You can test against a temporary local Pub/Sub by following these steps:

1. Start the local Pub/Sub emulator before running your tests using `LocalPubSubHelper`'s `create`
and `start` methods. This will bind a port for communication with the local Pub/Sub emulator.
```java
LocalPubSubHelper helper = LocalPubSubHelper.create();

helper.start(); // Starts the local Pub/Sub emulator in a separate process
```
You can test against a Pub/Sub emulator:

2. Create and use a `PubSub` object with the options given by the `LocalPubSubHelper` instance. For
example:
```java
PubSub localPubsub = helper.getOptions().getService();
```

3. Run your tests.
1. [Install Cloud SDK](https://cloud.google.com/sdk/downloads)

4. Stop the local Pub/Sub emulator by calling the `stop()` method, like so:
```java
helper.stop();
```

#### On a remote machine
2. Start the emulator:
```shell
$ gcloud beta emulators pubsub start
```

You can test against a remote Pub/Sub emulator as well. To do this, set the `PubSubOptions` project
endpoint to the hostname of the remote machine, like the example below.
To determine which host/port the emulator is running on:
```shell
$ gcloud beta emulators pubsub env-init
# Sample output:
# export PUBSUB_EMULATOR_HOST=localhost:8759
```

```java
PubSubOptions options = PubSubOptions.newBuilder()
.setProjectId("my-project-id") // must match project ID specified on remote machine
.setHost("<hostname of machine>:<port>")
.setCredentials(NoCredentials.getInstance())
.build();
PubSub localPubsub = options.getService();
```
3. Point your client to the emulator.
```java
ChannelProvider channelProvider =
// SubscriptionAdminSettings works too.
TopicAdminSettings.defaultChannelProviderBuilder()
.setEndpoint(System.getenv("PUBSUB_EMULATOR_HOST"))
.setCredentialsProvider(
FixedCredentialsProvider.create(NoCredentials.getInstance()))
.build();
TopicAdminClient topicClient = TopicAdminClient.create(
TopicAdminSettings.defaultBuilder().setChannelProvider(channelProvider).build());
Publisher publisher =
Publisher.newBuilder(topicName).setChannelProvider(channelProvider).build();
```

### Testing code that uses Resource Manager

Expand Down Expand Up @@ -241,10 +233,10 @@ Here is an example that clears the bucket created in Step 3 with a timeout of 5
RemoteStorageHelper.forceDelete(storage, bucket, 5, TimeUnit.SECONDS);
```

### Testing code that uses Translate
### Testing code that uses Translation

`RemoteTranslateHelper` contains convenience methods to make is easier to run tests against the
Google Translate service.
Google Translation service.

1. Create a test Google Cloud project.

Expand Down
6 changes: 3 additions & 3 deletions google-cloud-bigquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>0.10.0-beta</version>
<version>0.12.0-beta</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-bigquery:0.10.0-beta'
compile 'com.google.cloud:google-cloud-bigquery:0.12.0-beta'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "0.10.0-beta"
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "0.12.0-beta"
```

Example Application
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pom</artifactId>
<version>0.10.1-alpha-SNAPSHOT</version>
<version>0.12.1-alpha-SNAPSHOT</version>
</parent>
<properties>
<site.installationModule>google-cloud-bigquery</site.installationModule>
Expand Down
6 changes: 3 additions & 3 deletions google-cloud-compute/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-compute</artifactId>
<version>0.10.0-alpha</version>
<version>0.12.0-alpha</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-compute:0.10.0-alpha'
compile 'com.google.cloud:google-cloud-compute:0.12.0-alpha'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-compute" % "0.10.0-alpha"
libraryDependencies += "com.google.cloud" % "google-cloud-compute" % "0.12.0-alpha"
```

Example Application
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-compute/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pom</artifactId>
<version>0.10.1-alpha-SNAPSHOT</version>
<version>0.12.1-alpha-SNAPSHOT</version>
</parent>
<properties>
<site.installationModule>google-cloud-compute</site.installationModule>
Expand Down
Loading