Skip to content
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

Storage: Support bucket.location_type #732

Closed
JesseLovelace opened this issue Jun 6, 2019 · 6 comments · Fixed by #766
Closed

Storage: Support bucket.location_type #732

JesseLovelace opened this issue Jun 6, 2019 · 6 comments · Fixed by #766
Assignees
Labels
api: storage Issues related to the googleapis/nodejs-storage API. external This issue is blocked on a bug with the actual product. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@JesseLovelace
Copy link
Contributor

Location type is a new read-only field for buckets. This corresponds to internal bug 130187277.

@JesseLovelace JesseLovelace changed the title Storage: Support storage.location_type Storage: Support bucket.location_type Jun 6, 2019
@crwilcox
Copy link
Contributor

crwilcox commented Jun 6, 2019

@JesseLovelace could you add a few more details here?

@JustinBeckwith JustinBeckwith transferred this issue from googleapis/google-cloud-node Jun 6, 2019
@JustinBeckwith JustinBeckwith added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Jun 6, 2019
@stephenplusplus
Copy link
Contributor

In absence of more details, I thought I'd add this suggestion in case it applies:

bucket.getMetadata((err, metadata) => {
  // metadata.locationType
})

@crwilcox
Copy link
Contributor

crwilcox commented Jun 7, 2019

@stephenplusplus that seems correct. Here is some more info to get you started.

Location type will be a new field added for Bucket resource. It will be populated on-the-fly for output path, and is a read-only field so patch/update/create will not have any effect on bucket resource.
Example

Google Cloud Storage Python client library feature request: Add location type on bucket

// Get bucket
storage_client = storage.Client()
bucket = storage_client.get_bucket("bucket-name")

// Get location type
location_type = bucket.location_type

// Request:
// GET https://www.googleapis.com/storage/v1/b/bucket-name?fields=locationType
// Response Body
// {
//   "locationType": "multi-region"
// }

@JesseLovelace
Copy link
Contributor Author

Note: The current location type values are "MULTI_REGION", "REGION", and" DUAL_REGION", however these were supposed to be "multi-region", "region", and "dual-region". They will be changed in the API after a rollout on June 26 and that should also be reflected here.

@crwilcox crwilcox assigned crwilcox and callmehiphop and unassigned crwilcox Jul 3, 2019
@callmehiphop
Copy link
Contributor

@JesseLovelace if this is changing what storageClass represents, does that mean we should deprecate our setStorageClass method?

As far as supporting the locationType property itself, we just store any Bucket response objects as a metadata field, so as soon as the feature goes live it will be available to users without a code change.

@JesseLovelace
Copy link
Contributor Author

Not quite, setStorageClass will and should still work, but the Regional and Multi-regional storage classes will be considered legacy/deprecated.

The feature is already live, so if it works without a code change then including it in tests and documentation should be sufficient

@bcoe bcoe added the external This issue is blocked on a bug with the actual product. label Jul 12, 2019
@bcoe bcoe added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Aug 1, 2019
@google-cloud-label-sync google-cloud-label-sync bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. external This issue is blocked on a bug with the actual product. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants