Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1259

Missing StorageClass for buckets

    XMLWordPrintableJSON

Details

    Description

      When calling BlobStore.putBlob the object is created but we receive an exception

      java.lang.IllegalArgumentException: No enum constant org.jclouds.googlecloudstorage.domain.DomainResourceReferences.StorageClass.MULTI_REGIONAL
      

      In the logs we see that the server replied with

      2017-03-20 14:45:12 DEBUG main wire:56 - << " "storageClass": "MULTI_REGIONAL",[\n]"
      

      The bucket itself is defined as a "Multi-Regional" storage class (other choices available are Nearline and Coldline)

      Here is the full exception we receive:

      java.lang.IllegalArgumentException: No enum constant org.jclouds.googlecloudstorage.domain.DomainResourceReferences.StorageClass.MULTI_REGIONAL
      	at java.lang.Enum.valueOf(Enum.java:238)
      	at org.jclouds.json.internal.EnumTypeAdapterThatReturnsFromValue.deserialize(EnumTypeAdapterThatReturnsFromValue.java:41)
      	at org.jclouds.json.internal.EnumTypeAdapterThatReturnsFromValue.deserialize(EnumTypeAdapterThatReturnsFromValue.java:32)
      	at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58)
      	at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:272)
      	at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:184)
      	at com.google.gson.Gson.fromJson(Gson.java:861)
      	at com.google.gson.Gson.fromJson(Gson.java:826)
      	at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:55)
      	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:82)
      	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:76)
      	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:61)
      	at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:41)
      	at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
      	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
      	at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
      	at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
      	at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
      	at com.sun.proxy.$Proxy65.multipartUpload(Unknown Source)
      	at org.jclouds.googlecloudstorage.blobstore.GoogleCloudStorageBlobStore.putBlob(GoogleCloudStorageBlobStore.java:240)
      	at org.jclouds.googlecloudstorage.blobstore.GoogleCloudStorageBlobStore.putBlob(GoogleCloudStorageBlobStore.java:212)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
      	at com.sun.proxy.$Proxy49.putBlob(Unknown Source)
      

      It looks like the list of [StorageClass enum](https://github.com/jclouds/jclouds-labs-google/blob/master/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java#L48) is incomplete

      EDIT: buckets created with Regional storage class are not working either

      Attachments

        Issue Links

          Activity

            People

              gaul Andrew Gaul
              frigo Francois Rigault
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: