Here is the code segment:
Bucket newBucket = storage.buckets().insert("MyProject", new Bucket().setName("MyBucket").setLocation("US").setStorageClass("DURABLE_REDUCED_AVAILABILITY")).execute();
} catch (GoogleJsonResponseException e) {
System.out.println("Exception in tryCreateBucket: "+e);
throw e;
}
It throws: Exception in tryCreateBucket:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid Value",
"reason" : "invalid"
} ],
"message" : "Invalid Value"
}
Any thoughts on how to fix this problem?
Thanks /VK
bucket names must be lowercase. There are a number of other restrictions as well - please see https://developers.google.com/storage/docs/bucketnaming#requirements
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With