GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Create bucket in specific location (and region) · Issue #723 · googleapis/google-cloud-node

Create bucket in specific location (and region) #723

New issue
Copy link
New issue
Copy link
Closed
Closed
Create bucket in specific location (and region)#723
Copy link
Assignees
stephenplusplus
Labels
api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Description

@akashkrishnan
akashkrishnan
opened on Jul 15, 2015
Issue body actions

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?

Activity

Next
  1. jgeewax
    added
    type: questionRequest for information or clarification. Not an issue.
    api: storageIssues related to the Cloud Storage API.
    on Jul 15, 2015
  2. akashkrishnan
    changed the title [-]Create bucket in specific region[/-] [+]Create bucket in specific location (and region)[/+] on Jul 15, 2015
  3. stephenplusplus commented on Jul 16, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 16, 2015
    Contributor
    More actions

    Yes, although we should add an example in our docs, since it's not very clear. Your call to createBucket lets you provide an object that we pass up to what the API here expects (under "Request body").

    storage.createBucket('your-new-bucket', {
      location: 'ASIA-EAST1',
      storageClass: 'DURABLE_REDUCED_AVAILABILITY'
    }, function(err, bucket, apiResponse) {
      // bucket.metadata.location = 'ASIA-EAST1
    });
  4. stephenplusplus
    self-assigned this
    on Jul 16, 2015
  5. jgeewax commented on Jul 16, 2015

    @jgeewax
    jgeewax
    on Jul 16, 2015
    Contributor
    More actions
    1. Is this documented anywhere ? Seems like a common request...
    2. Is the location case sensitive?
    3. Should we make those constants variables to avoid typos?
    4. Ditto for storage class...?
  6. stephenplusplus commented on Jul 16, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 16, 2015
    Contributor
    More actions

    Is the location case sensitive?

    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.


    Should we make those constants variables to avoid typos?
    Ditto for storage class...?

    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 location property deflect to another thorough doc site:

    location string The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list.


    Is this documented anywhere ?

    Not currently, but I intend to. In that example, it will link out to the places I linked above to complete the story.


    Seems like a common request...

    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, storage.locations.ASIAEAST1 doesn't seem easier to remember or more developer friendly than just accepting a string 'ASIA-EAST1`.


    @akashkrishnan feel free to chime in with any thoughts on the way you would prefer creating a bucket in a location to look like :)

  7. jgeewax commented on Jul 16, 2015

    @jgeewax
    jgeewax
    on Jul 16, 2015
    Contributor
    More actions

    I'd rather pass them onto the official JSON API docs

    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.

    Not currently, but I intend to.

    Cool.

  8. stephenplusplus commented on Jul 22, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 22, 2015
    Contributor
    More actions

    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")

    :( Not helpful:

    screen shot 2015-07-22 at 4 48 59 pm

    https://cloud.google.com/storage/docs/regional-buckets has a list of regional locations:

    • ASIA-EAST1 - Eastern Asia-Pacific
    • US-CENTRAL1 - Central United States
    • US-CENTRAL2 - Central United States
    • US-EAST1 - Eastern United States
    • US-EAST2 - Eastern United States
    • US-EAST3 - Eastern United States
    • US-WEST1 - Western United States

    Should we check the provided location against this list? I'm more in favor of

    1. wishing that responsibility on the upstream API
    2. trusting users know which value is likely to be wrong. If confused, they can get more clarity from our yet to be elaborted docs that link to the list of locations above
  9. callmehiphop
    closed this as completedin #735on Jul 23, 2015
  10. akashkrishnan commented on Jul 23, 2015

    @akashkrishnan
    akashkrishnan
    on Jul 23, 2015
    Author
    More actions

    @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.

  11. sofisl
    added a commit that references this issue on Nov 17, 2022

    fix: better support for fallback mode (#768)

    ef4e0b3
  12. miguelvelezsa
    added a commit that references this issue on Jul 23, 2025

    build: add GitHub actions config for unit tests (#723)

    2e6b72b
  13. miguelvelezsa
    added 2 commits that reference this issue on Jan 14, 2026

    chore(main): release 5.0.1 (#723)

    30ed800

    chore(main): release 5.0.1 (#723)

    13becbe
  14. 4 remaining items

  15. sofisl
    added 6 commits that reference this issue on Jan 28, 2026

    chore: release 4.1.1 (#723)

    767c525

    chore: release 4.1.1 (#723)

    47dddd0

    chore: release 4.1.1 (#723)

    daa5884

    chore: release 4.1.1 (#723)

    fa96deb

    migrate code from googleapis/cloud-profiler-nodejs (#7087)

    288deb4

    chore(main): release 5.0.1 (#723)

    70c28f2
  16. sofisl
    added a commit that references this issue on Feb 25, 2026

    test: async is still used in tests (#723)

    3a65629
  17. GautamSharda
    added 2 commits that reference this issue on Mar 5, 2026

    fix(docs): documentation for overloaded methods (#725)

    This issue will close once commit b30b800 is merged into the 'main' branch.
    b30b800

    chore(main): release 3.9.0 (#723)

    This issue will close once commit d76c287 is merged into the 'main' branch.
    d76c287
  18. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    test: async is still used in tests (googleapis#723)

    7d1ce9d
  19. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    fix(deps): update dependency uuid to v8 (#723)

    1aed848

    fix(deps): update dependency uuid to v8 (#723)

    6952750
  20. feywind
    added a commit that references this issue on Mar 27, 2026

    docs: update batch publish sample (#723)

    6fd4cfc
  21. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    fix(deps): update dependency uuid to v8 (#723)

    585b408
  22. thiyaguk09
    added a commit that references this issue on May 5, 2026

    fix(deps): update dependency uuid to v8 (googleapis#723)

    2dff424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.