-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create bucket in specific location (and region) #723
Comments
Yes, although we should add an example in our docs, since it's not very clear. Your call to storage.createBucket('your-new-bucket', {
location: 'ASIA-EAST1',
storageClass: 'DURABLE_REDUCED_AVAILABILITY'
}, function(err, bucket, apiResponse) {
// bucket.metadata.location = 'ASIA-EAST1
}); |
|
It is. This is the format the upstream API expects. We leave this window open so we don't have to design custom support for every use case.
The more we localize, the more likely we are to go stale as the upstream moves forward or makes changes. To know what we've made constants, the user would have to hit our docs. I'd rather pass them onto the official JSON API docs and let them do the explaining: https://cloud.google.com/storage/docs/json_api/v1/buckets/insert As an example of doc modularity, the insert docs themselves for the
Not currently, but I intend to. In that example, it will link out to the places I linked above to complete the story.
While I went off on all my reasons not to localize and blah blah, we do want to make exceptions for really common cases. If you think this is one of them, can you think of a way we can make it easier than docs & links? Maybe a way other libraries have done it? I'm specifically afraid of making constants out of locations that may change. Also, @akashkrishnan feel free to chime in with any thoughts on the way you would prefer creating a bucket in a location to look like :) |
That's a fair point, but it means also that instead of getting a "variable not found" you get a "bad request". I'd be fine with this so long as the error message the user gets is helpful and says more than "bad request" (maybe "the zone provided (us-aisa-1a) wasn't valid") If it doesn't today, we should create an issue for that.
Cool. |
:( Not helpful: https://cloud.google.com/storage/docs/regional-buckets has a list of regional locations:
Should we check the provided location against this list? I'm more in favor of
|
@stephenplusplus Yes, your response and update to the documentation make sense, and it is exactly what I was expecting---just needed it written out in the documentation for clarity. As for the location and region constants, I would also lean towards points 1 and 2, just because it would make it easier to maintain this API. |
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: googleapis/googleapis@873ab45 Source-Link: googleapis/googleapis-gen@cb6f37a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 feat: Update Compute Engine API to revision 20220720 (#723) Source-Link: googleapis/googleapis@60a0fa7 Source-Link: googleapis/googleapis-gen@ba1df1b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmExZGYxYmU5M2Y1YTFhYTVjNjQ3ZmMyZjE5NWQ0MWIwMDc1YWE5MyJ9
I did a quick search in the issues (and documentation) and did not find a way to create buckets in specific locations and regions. Does the API support this?
The text was updated successfully, but these errors were encountered: