Skip to content

Commit dd0b186

Browse files
committed
Rename package com.google.gcloud to com.google.cloud
1 parent d77974a commit dd0b186

132 files changed

Lines changed: 1104 additions & 1178 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.

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ Example Applications
5151

5252
- [`BigQueryExample`](./gcloud-java-examples/src/main/java/com/google/cloud/examples/bigquery/BigQueryExample.java) - A simple command line interface providing some of Cloud BigQuery's functionality
5353
- Read more about using this application on the [`BigQueryExample` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/cloud/examples/bigquery/BigQueryExample.html).
54-
- [`ComputeExample`](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/compute/ComputeExample.java) - A simple command line interface providing some of Cloud Compute's functionality
55-
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/compute/ComputeExample.html).
54+
- [`ComputeExample`](./gcloud-java-examples/src/main/java/com/google/cloud/examples/compute/ComputeExample.java) - A simple command line interface providing some of Cloud Compute's functionality
55+
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/cloud/examples/compute/ComputeExample.html).
5656
- [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/bookshelf) - An App Engine app that manages a virtual bookshelf.
5757
- This app uses `gcloud-java` to interface with Cloud Datastore and Cloud Storage. It also uses Cloud SQL, another Google Cloud Platform service.
5858
- [`DatastoreExample`](./gcloud-java-examples/src/main/java/com/google/cloud/examples/datastore/DatastoreExample.java) - A simple command line interface for Cloud Datastore
@@ -189,15 +189,15 @@ you must [supply credentials](#authentication) and a project ID if running this
189189
190190
The first snippet shows how to create a snapshot from an existing disk. Complete source code can be
191191
found at
192-
[CreateSnapshot.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/compute/snippets/CreateSnapshot.java).
192+
[CreateSnapshot.java](./gcloud-java-examples/src/main/java/com/google/cloud/examples/compute/snippets/CreateSnapshot.java).
193193
194194
```java
195-
import com.google.gcloud.compute.Compute;
196-
import com.google.gcloud.compute.ComputeOptions;
197-
import com.google.gcloud.compute.Disk;
198-
import com.google.gcloud.compute.DiskId;
199-
import com.google.gcloud.compute.Operation;
200-
import com.google.gcloud.compute.Snapshot;
195+
import com.google.cloud.compute.Compute;
196+
import com.google.cloud.compute.ComputeOptions;
197+
import com.google.cloud.compute.Disk;
198+
import com.google.cloud.compute.DiskId;
199+
import com.google.cloud.compute.Operation;
200+
import com.google.cloud.compute.Snapshot;
201201
202202
Compute compute = ComputeOptions.defaultInstance().service();
203203
DiskId diskId = DiskId.of("us-central1-a", "disk-name");
@@ -216,19 +216,19 @@ if (disk != null) {
216216
```
217217
The second snippet shows how to create a virtual machine instance. Complete source code can be found
218218
at
219-
[CreateInstance.java](./gcloud-java-examples/src/main/java/com/google/gcloud/examples/compute/snippets/CreateInstance.java).
219+
[CreateInstance.java](./gcloud-java-examples/src/main/java/com/google/cloud/examples/compute/snippets/CreateInstance.java).
220220
```java
221-
import com.google.gcloud.compute.AttachedDisk;
222-
import com.google.gcloud.compute.Compute;
223-
import com.google.gcloud.compute.ComputeOptions;
224-
import com.google.gcloud.compute.ImageId;
225-
import com.google.gcloud.compute.Instance;
226-
import com.google.gcloud.compute.InstanceId;
227-
import com.google.gcloud.compute.InstanceInfo;
228-
import com.google.gcloud.compute.MachineTypeId;
229-
import com.google.gcloud.compute.NetworkId;
230-
import com.google.gcloud.compute.NetworkInterface;
231-
import com.google.gcloud.compute.Operation;
221+
import com.google.cloud.compute.AttachedDisk;
222+
import com.google.cloud.compute.Compute;
223+
import com.google.cloud.compute.ComputeOptions;
224+
import com.google.cloud.compute.ImageId;
225+
import com.google.cloud.compute.Instance;
226+
import com.google.cloud.compute.InstanceId;
227+
import com.google.cloud.compute.InstanceInfo;
228+
import com.google.cloud.compute.MachineTypeId;
229+
import com.google.cloud.compute.NetworkId;
230+
import com.google.cloud.compute.NetworkInterface;
231+
import com.google.cloud.compute.Operation;
232232
233233
Compute compute = ComputeOptions.defaultInstance().service();
234234
ImageId imageId = ImageId.of("debian-cloud", "debian-8-jessie-v20160329");
@@ -533,4 +533,4 @@ Apache 2.0 - See [LICENSE] for more information.
533533
534534
[cloud-compute]: https://cloud.google.com/compute/
535535
[cloud-compute-docs]: https://cloud.google.com/compute/docs/overview
536-
[compute-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/compute/package-summary.html
536+
[compute-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/cloud/compute/package-summary.html

gcloud-java-compute/README.md

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,37 @@ Java idiomatic client for [Google Cloud Compute](https://cloud.google.com/comput
1010
[![Dependency Status](https://www.versioneye.com/user/projects/56bd8ee72a29ed002d2b0969/badge.svg?style=flat)](https://www.versioneye.com/user/projects/56bd8ee72a29ed002d2b0969)
1111

1212
- [Homepage](https://googlecloudplatform.github.io/gcloud-java/)
13-
- [API Documentation](http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/compute/package-summary.html)
13+
- [API Documentation](http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/cloud/compute/package-summary.html)
1414

1515
> Note: This client is a work-in-progress, and may occasionally
1616
> make backwards-incompatible changes.
1717
1818
Quickstart
1919
----------
2020
If you are using Maven, add this to your pom.xml file
21-
<!-- TODO(mziccard): add maven dependency code -->
21+
```xml
22+
<dependency>
23+
<groupId>com.google.cloud</groupId>
24+
<artifactId>gcloud-java-compute</artifactId>
25+
<version>0.2.0</version>
26+
</dependency>
27+
```
2228
If you are using Gradle, add this to your dependencies
23-
<!-- TODO(mziccard): add gradle dependency code -->
29+
```Groovy
30+
compile 'com.google.cloud:gcloud-java-compute:0.2.0'
31+
```
2432
If you are using SBT, add this to your dependencies
25-
<!-- TODO(mziccard): add sbt dependency code -->
33+
```Scala
34+
libraryDependencies += "com.google.cloud" % "gcloud-java-compute" % "0.2.0"
35+
```
2636

2737
Example Application
2838
-------------------
2939

30-
[`ComputeExample`](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/compute/ComputeExample.java)
40+
[`ComputeExample`](../gcloud-java-examples/src/main/java/com/google/cloud/examples/compute/ComputeExample.java)
3141
is a simple command line interface that provides some of Google Cloud Compute Engine's
3242
functionality. Read more about using the application on the
33-
[`ComputeExample` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/compute/ComputeExample.html).
43+
[`ComputeExample` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/cloud/examples/compute/ComputeExample.html).
3444

3545
Authentication
3646
--------------
@@ -75,8 +85,8 @@ These credentials are automatically inferred from your environment, so you only
7585
code to create your service object:
7686

7787
```java
78-
import com.google.gcloud.compute.Compute;
79-
import com.google.gcloud.compute.ComputeOptions;
88+
import com.google.cloud.compute.Compute;
89+
import com.google.cloud.compute.ComputeOptions;
8090

8191
Compute compute = ComputeOptions.defaultInstance().service();
8292
```
@@ -92,9 +102,9 @@ Engine. In this code snippet, we will create a new external region address.
92102
Add the following imports at the top of your file:
93103

94104
```java
95-
import com.google.gcloud.compute.AddressInfo;
96-
import com.google.gcloud.compute.Operation;
97-
import com.google.gcloud.compute.RegionAddressId;
105+
import com.google.cloud.compute.AddressInfo;
106+
import com.google.cloud.compute.Operation;
107+
import com.google.cloud.compute.RegionAddressId;
98108
```
99109

100110
Then add the following code to create an address. Most Compute Engine calls return an `Operation`
@@ -126,10 +136,10 @@ a publicly-available image.
126136
Add the following imports at the top of your file:
127137

128138
```java
129-
import com.google.gcloud.compute.DiskInfo;
130-
import com.google.gcloud.compute.DiskId;
131-
import com.google.gcloud.compute.ImageDiskConfiguration;
132-
import com.google.gcloud.compute.ImageId;
139+
import com.google.cloud.compute.DiskInfo;
140+
import com.google.cloud.compute.DiskId;
141+
import com.google.cloud.compute.ImageDiskConfiguration;
142+
import com.google.cloud.compute.ImageId;
133143
```
134144

135145
Then add the following code to create a disk and wait for disk creation to terminate.
@@ -161,15 +171,15 @@ boot disk the disk we have just created and assigning to it the just created IP
161171
Add the following imports at the top of your file:
162172

163173
```java
164-
import com.google.gcloud.compute.AttachedDisk;
165-
import com.google.gcloud.compute.AttachedDisk.PersistentDiskConfiguration;
166-
import com.google.gcloud.compute.InstanceId;
167-
import com.google.gcloud.compute.InstanceInfo;
168-
import com.google.gcloud.compute.MachineTypeId;
169-
import com.google.gcloud.compute.NetworkConfiguration;
170-
import com.google.gcloud.compute.NetworkConfiguration.AccessConfig;
171-
import com.google.gcloud.compute.NetworkId;
172-
import com.google.gcloud.compute.NetworkInterface;
174+
import com.google.cloud.compute.AttachedDisk;
175+
import com.google.cloud.compute.AttachedDisk.PersistentDiskConfiguration;
176+
import com.google.cloud.compute.InstanceId;
177+
import com.google.cloud.compute.InstanceInfo;
178+
import com.google.cloud.compute.MachineTypeId;
179+
import com.google.cloud.compute.NetworkConfiguration;
180+
import com.google.cloud.compute.NetworkConfiguration.AccessConfig;
181+
import com.google.cloud.compute.NetworkId;
182+
import com.google.cloud.compute.NetworkInterface;
173183
```
174184

175185
Then add the following code to create an instance and wait for instance creation to terminate.
@@ -203,7 +213,7 @@ if (operation.errors() == null) {
203213
#### Complete source code
204214

205215
In
206-
[CreateAddressDiskAndInstance.java](../gcloud-java-examples/src/main/java/com/google/gcloud/examples/compute/snippets/CreateAddressDiskAndInstance.java)
216+
[CreateAddressDiskAndInstance.java](../gcloud-java-examples/src/main/java/com/google/cloud/examples/compute/snippets/CreateAddressDiskAndInstance.java)
207217
we put together all the code shown above into one program. The program assumes that you are
208218
running on Compute Engine or from your own desktop. To run the example on App Engine, simply move
209219
the code from the main method to your application's servlet class and change the print statements to
@@ -254,4 +264,4 @@ Apache 2.0 - See [LICENSE] for more information.
254264
[cloud-platform]: https://cloud.google.com/
255265

256266
[cloud-compute]: https://cloud.google.com/compute/
257-
[compute-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/compute/package-summary.html
267+
[compute-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/cloud/compute/package-summary.html

gcloud-java-compute/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
Java idiomatic client for Google Cloud Compute Engine.
1010
</description>
1111
<parent>
12-
<groupId>com.google.gcloud</groupId>
12+
<groupId>com.google.cloud</groupId>
1313
<artifactId>gcloud-java-pom</artifactId>
14-
<version>0.1.5-SNAPSHOT</version>
14+
<version>0.2.1-SNAPSHOT</version>
1515
</parent>
1616
<properties>
1717
<site.installationModule>gcloud-java-compute</site.installationModule>

gcloud-java-compute/src/main/java/com/google/gcloud/compute/Address.java renamed to gcloud-java-compute/src/main/java/com/google/cloud/compute/Address.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.gcloud.compute;
17+
package com.google.cloud.compute;
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

21+
import com.google.cloud.compute.Compute.AddressOption;
22+
import com.google.cloud.compute.Compute.OperationOption;
23+
2124
import java.io.IOException;
2225
import java.io.ObjectInputStream;
2326
import java.util.Objects;
@@ -122,7 +125,7 @@ public Address build() {
122125
* @throws ComputeException upon failure
123126
*/
124127
public boolean exists() {
125-
return reload(Compute.AddressOption.fields()) != null;
128+
return reload(AddressOption.fields()) != null;
126129
}
127130

128131
/**
@@ -133,7 +136,7 @@ public boolean exists() {
133136
* @return an {@code Address} object with latest information or {@code null} if not found
134137
* @throws ComputeException upon failure
135138
*/
136-
public Address reload(Compute.AddressOption... options) {
139+
public Address reload(AddressOption... options) {
137140
return compute.getAddress(addressId(), options);
138141
}
139142

@@ -144,7 +147,7 @@ public Address reload(Compute.AddressOption... options) {
144147
* the address was not found
145148
* @throws ComputeException upon failure
146149
*/
147-
public Operation delete(Compute.OperationOption... options) {
150+
public Operation delete(OperationOption... options) {
148151
return compute.deleteAddress(addressId(), options);
149152
}
150153

gcloud-java-compute/src/main/java/com/google/gcloud/compute/AddressId.java renamed to gcloud-java-compute/src/main/java/com/google/cloud/compute/AddressId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.gcloud.compute;
17+
package com.google.cloud.compute;
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

gcloud-java-compute/src/main/java/com/google/gcloud/compute/AddressInfo.java renamed to gcloud-java-compute/src/main/java/com/google/cloud/compute/AddressInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.gcloud.compute;
17+
package com.google.cloud.compute;
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

gcloud-java-compute/src/main/java/com/google/gcloud/compute/AttachedDisk.java renamed to gcloud-java-compute/src/main/java/com/google/cloud/compute/AttachedDisk.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.gcloud.compute;
17+
package com.google.cloud.compute;
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

gcloud-java-compute/src/main/java/com/google/gcloud/compute/Compute.java renamed to gcloud-java-compute/src/main/java/com/google/cloud/compute/Compute.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.gcloud.compute;
17+
package com.google.cloud.compute;
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

21+
import com.google.cloud.Page;
22+
import com.google.cloud.Service;
23+
import com.google.cloud.compute.AttachedDisk.PersistentDiskConfiguration;
24+
import com.google.cloud.compute.NetworkInterface.AccessConfig;
25+
import com.google.cloud.compute.spi.ComputeRpc;
2126
import com.google.common.base.Joiner;
2227
import com.google.common.base.MoreObjects;
2328
import com.google.common.collect.Sets;
24-
import com.google.gcloud.Page;
25-
import com.google.gcloud.Service;
26-
import com.google.gcloud.compute.AttachedDisk.PersistentDiskConfiguration;
27-
import com.google.gcloud.compute.NetworkInterface.AccessConfig;
28-
import com.google.gcloud.compute.spi.ComputeRpc;
2929

3030
import java.io.Serializable;
3131
import java.util.Objects;

gcloud-java-compute/src/main/java/com/google/gcloud/compute/ComputeException.java renamed to gcloud-java-compute/src/main/java/com/google/cloud/compute/ComputeException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.gcloud.compute;
17+
package com.google.cloud.compute;
1818

19+
import com.google.cloud.BaseServiceException;
20+
import com.google.cloud.RetryHelper.RetryHelperException;
21+
import com.google.cloud.RetryHelper.RetryInterruptedException;
1922
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;
2323

2424
import java.io.IOException;
2525
import java.util.Set;

gcloud-java-compute/src/main/java/com/google/gcloud/compute/ComputeFactory.java renamed to gcloud-java-compute/src/main/java/com/google/cloud/compute/ComputeFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.gcloud.compute;
17+
package com.google.cloud.compute;
1818

19-
import com.google.gcloud.ServiceFactory;
19+
import com.google.cloud.ServiceFactory;
2020

2121
/**
2222
* An interface for Compute factories.

0 commit comments

Comments
 (0)