Skip to content

Commit 388730e

Browse files
committed
---
yaml --- r: 7215 b: refs/heads/tswast-patch-1 c: 90894b3 h: refs/heads/master i: 7213: 4284cdb 7211: 2d4419b 7207: c57fee6 7199: 18c4459
1 parent 8c2f8cf commit 388730e

13 files changed

Lines changed: 503 additions & 1 deletion

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 766a76df8cd2e90890b4bc34b2fde39d7e79dc19
60+
refs/heads/tswast-patch-1: 90894b3fba4a7df743322d024dfb3b0d01d9deec
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
Google Cloud Java Client for Compute (Alpha)
2+
====================================
3+
4+
Java idiomatic client for [Google Cloud Compute] (https://cloud.google.com/compute).
5+
6+
[![Build Status](https://travis-ci.org/GoogleCloudPlatform/gcloud-java.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/gcloud-java)
7+
[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master)
8+
<!-- TODO(mziccard): add in the maven shield once the artifact is pushed to maven -->
9+
[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/gcloud-java)
10+
[![Dependency Status](https://www.versioneye.com/user/projects/56bd8ee72a29ed002d2b0969/badge.svg?style=flat)](https://www.versioneye.com/user/projects/56bd8ee72a29ed002d2b0969)
11+
12+
- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
13+
<!-- TODO(mziccard): add link to API documentatin -->
14+
15+
> Note: This client is a work-in-progress, and may occasionally
16+
> make backwards-incompatible changes.
17+
18+
Quickstart
19+
----------
20+
If you are using Maven, add this to your pom.xml file
21+
<!-- TODO(mziccard): add maven dependency code -->
22+
If you are using Gradle, add this to your dependencies
23+
<!-- TODO(mziccard): add gradle dependency code -->
24+
If you are using SBT, add this to your dependencies
25+
<!-- TODO(mziccard): add sbt dependency code -->
26+
27+
Example Application
28+
-------------------
29+
<!-- TODO(mziccard): add example application -->
30+
31+
Authentication
32+
--------------
33+
34+
See the [Authentication](https://github.com/GoogleCloudPlatform/gcloud-java#authentication) section in the base directory's README.
35+
36+
About Google Cloud BigQuery
37+
--------------------------
38+
39+
[Google Cloud Compute][cloud-compute] delivers virtual machines running in Google's innovative data
40+
centers and worldwide fiber network. Compute Engine's tooling and workflow support enable scaling
41+
from single instances to global, load-balanced cloud computing. Compute Engine's VMs boot quickly,
42+
come with persistent disk storage, deliver consistent performance and are available in many
43+
configurations.
44+
45+
Be sure to activate the Google Cloud Compute API on the Developer's Console to use Compute from
46+
your project.
47+
48+
See the ``gcloud-java`` API [compute documentation][compute-api] to learn how to interact
49+
with Google Cloud Compute using this Client Library.
50+
51+
Getting Started
52+
---------------
53+
<!-- TODO(mziccard): add code snippet -->
54+
55+
Troubleshooting
56+
---------------
57+
58+
To get help, follow the `gcloud-java` links in the `gcloud-*`[shared Troubleshooting document](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/troubleshooting/readme.md#troubleshooting).
59+
60+
Java Versions
61+
-------------
62+
63+
Java 7 or above is required for using this client.
64+
65+
Testing
66+
-------
67+
68+
This library has tools to help make tests for code using Cloud BigQuery.
69+
70+
See [TESTING] to read more about testing.
71+
72+
Versioning
73+
----------
74+
75+
This library follows [Semantic Versioning] (http://semver.org/).
76+
77+
It is currently in major version zero (``0.y.z``), which means that anything
78+
may change at any time and the public API should not be considered
79+
stable.
80+
81+
Contributing
82+
------------
83+
84+
Contributions to this library are always welcome and highly encouraged.
85+
86+
See [CONTRIBUTING] for more information on how to get started.
87+
88+
License
89+
-------
90+
91+
Apache 2.0 - See [LICENSE] for more information.
92+
93+
94+
[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/CONTRIBUTING.md
95+
[LICENSE]: https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/LICENSE
96+
[TESTING]: https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/TESTING.md#testing-code-that-uses-compute
97+
[cloud-platform]: https://cloud.google.com/
98+
99+
[cloud-compute]: https://cloud.google.com/compute/
100+
[compute-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/compute/package-summary.html
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>gcloud-java-compute</artifactId>
5+
<packaging>jar</packaging>
6+
<name>GCloud Java compute</name>
7+
<description>
8+
Java idiomatic client for Google Cloud Compute Engine.
9+
</description>
10+
<parent>
11+
<groupId>com.google.gcloud</groupId>
12+
<artifactId>gcloud-java-pom</artifactId>
13+
<version>0.1.5-SNAPSHOT</version>
14+
</parent>
15+
<properties>
16+
<site.installationModule>gcloud-java-compute</site.installationModule>
17+
</properties>
18+
<dependencies>
19+
<dependency>
20+
<groupId>${project.groupId}</groupId>
21+
<artifactId>gcloud-java-core</artifactId>
22+
<version>${project.version}</version>
23+
</dependency>
24+
<dependency>
25+
<groupId>com.google.apis</groupId>
26+
<artifactId>google-api-services-compute</artifactId>
27+
<version>v1-rev93-1.21.0</version>
28+
<scope>compile</scope>
29+
<exclusions>
30+
<exclusion>
31+
<groupId>com.google.guava</groupId>
32+
<artifactId>guava-jdk5</artifactId>
33+
</exclusion>
34+
</exclusions>
35+
</dependency>
36+
<dependency>
37+
<groupId>junit</groupId>
38+
<artifactId>junit</artifactId>
39+
<version>4.12</version>
40+
<scope>test</scope>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.easymock</groupId>
44+
<artifactId>easymock</artifactId>
45+
<version>3.4</version>
46+
<scope>test</scope>
47+
</dependency>
48+
</dependencies>
49+
</project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.compute;
18+
19+
import com.google.gcloud.Service;
20+
21+
/**
22+
* An interface for Google Cloud Compute Engine.
23+
*
24+
* @see <a href="https://cloud.google.com/compute/docs/">Google Cloud Compute Engine</a>
25+
*/
26+
public interface Compute extends Service<ComputeOptions> {
27+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.compute;
18+
19+
import com.google.common.collect.ImmutableSet;
20+
import com.google.gcloud.BaseServiceException;
21+
import com.google.gcloud.RetryHelper.RetryHelperException;
22+
import com.google.gcloud.RetryHelper.RetryInterruptedException;
23+
24+
import java.io.IOException;
25+
import java.util.Set;
26+
27+
/**
28+
* Compute Engine service exception.
29+
*/
30+
public class ComputeException extends BaseServiceException {
31+
32+
private static final Set<Error> RETRYABLE_ERRORS = ImmutableSet.of(new Error(500, null));
33+
private static final long serialVersionUID = -8039359778707845810L;
34+
35+
public ComputeException(int code, String message) {
36+
super(code, message, null, true);
37+
}
38+
39+
public ComputeException(IOException exception) {
40+
super(exception, true);
41+
}
42+
43+
@Override
44+
protected Set<Error> retryableErrors() {
45+
return RETRYABLE_ERRORS;
46+
}
47+
48+
/**
49+
* Translate RetryHelperException to the ComputeException that caused the error. This method will
50+
* always throw an exception.
51+
*
52+
* @throws ComputeException when {@code ex} was caused by a {@code ComputeException}
53+
* @throws RetryInterruptedException when {@code ex} is a {@code RetryInterruptedException}
54+
*/
55+
static BaseServiceException translateAndThrow(RetryHelperException ex) {
56+
BaseServiceException.translateAndPropagateIfPossible(ex);
57+
throw new ComputeException(UNKNOWN_CODE, ex.getMessage());
58+
}
59+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.compute;
18+
19+
import com.google.gcloud.ServiceFactory;
20+
21+
/**
22+
* An interface for Compute factories.
23+
*/
24+
public interface ComputeFactory extends ServiceFactory<Compute, ComputeOptions> {
25+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.compute;
18+
19+
import com.google.gcloud.BaseService;
20+
import com.google.gcloud.spi.ComputeRpc;
21+
22+
final class ComputeImpl extends BaseService<ComputeOptions> implements Compute {
23+
24+
private final ComputeRpc computeRpc;
25+
26+
ComputeImpl(ComputeOptions options) {
27+
super(options);
28+
computeRpc = options.rpc();
29+
}
30+
}

0 commit comments

Comments
 (0)