You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ga...@apache.org on 2017/05/08 18:10:48 UTC

[46/50] jclouds git commit: JCLOUDS-1259: Add GCS multi-regional and coldline

JCLOUDS-1259: Add GCS multi-regional and coldline


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/ca75641f
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/ca75641f
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/ca75641f

Branch: refs/heads/master
Commit: ca75641fc0c990aa4592d0ee195ae34593dead2b
Parents: 8e50fe6
Author: Andrew Gaul <ga...@apache.org>
Authored: Mon Mar 20 18:04:03 2017 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Mon Mar 20 18:42:32 2017 -0700

----------------------------------------------------------------------
 .../domain/DomainResourceReferences.java        |  6 +++-
 .../features/BucketApiLiveTest.java             | 38 ++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/ca75641f/providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java
----------------------------------------------------------------------
diff --git a/providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java b/providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java
index 36ab418..cc3b9dc 100644
--- a/providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java
+++ b/providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java
@@ -45,7 +45,11 @@ public final class DomainResourceReferences {
    }
 
    public enum StorageClass {
-      STANDARD, DURABLE_REDUCED_AVAILABILITY, NEARLINE;
+      COLDLINE,
+      DURABLE_REDUCED_AVAILABILITY,
+      MULTI_REGIONAL,
+      NEARLINE,
+      STANDARD;
    }
 
    public enum Projection {

http://git-wip-us.apache.org/repos/asf/jclouds/blob/ca75641f/providers/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java b/providers/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java
index 12226dc..c59a82f 100644
--- a/providers/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java
+++ b/providers/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java
@@ -58,6 +58,10 @@ public class BucketApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
 
    private static final String BUCKET_NAME_STANDARD = "jcloudstestbucketstandard" + (int) (Math.random() * 10000);
 
+   private static final String BUCKET_NAME_COLDLINE = "jcloudstestbucketcoldline" + (int) (Math.random() * 10000);
+
+   private static final String BUCKET_NAME_MULTI_REGIONAL = "jcloudstestbucketmultiregional" + (int) (Math.random() * 10000);
+
    private static final String BUCKET_NAME_NEARLINE = "jcloudstestbucketnearline" + (int) (Math.random() * 10000);
 
    private static final String BUCKET_NAME_WITHOPTIONS = "jcloudstestbucketoptions" + (int) (Math.random() * 10000);
@@ -121,6 +125,40 @@ public class BucketApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
    }
 
    @Test(groups = "live")
+   public void testCreateBucketColdline() {
+      BucketTemplate template = new BucketTemplate()
+               .name(BUCKET_NAME_COLDLINE)
+               .location(Location.US)
+               .storageClass(StorageClass.COLDLINE);
+
+      Bucket response = api().createBucket(PROJECT_NUMBER, template);
+
+      assertNotNull(response);
+      assertEquals(response.name(), BUCKET_NAME_COLDLINE);
+      assertEquals(response.location(), Location.US);
+      assertThat(response.storageClass()).isEqualTo(StorageClass.COLDLINE);
+
+      api().deleteBucket(BUCKET_NAME_COLDLINE);
+   }
+
+   @Test(groups = "live")
+   public void testCreateBucketMultiregional() {
+      BucketTemplate template = new BucketTemplate()
+               .name(BUCKET_NAME_MULTI_REGIONAL)
+               .location(Location.US)
+               .storageClass(StorageClass.MULTI_REGIONAL);
+
+      Bucket response = api().createBucket(PROJECT_NUMBER, template);
+
+      assertNotNull(response);
+      assertEquals(response.name(), BUCKET_NAME_MULTI_REGIONAL);
+      assertEquals(response.location(), Location.US);
+      assertThat(response.storageClass()).isEqualTo(StorageClass.MULTI_REGIONAL);
+
+      api().deleteBucket(BUCKET_NAME_NEARLINE);
+   }
+
+   @Test(groups = "live")
    public void testCreateBucketNearline() {
       BucketTemplate template = new BucketTemplate()
                .name(BUCKET_NAME_NEARLINE)