Support for Bucket.location setter
See original GitHub issueI was trying to change location of the bucket in Storage, but everything gets updated apart from location. It looks like the data is being sent through API, but are not persisted?
Code example
storage_client = StorageClient()
bucket = storage_client.create_bucket(name)
bucket.storage_class = 'MULTI_REGIONAL'
bucket.location = 'EU' # tried 'eu' as well
bucket.labels = {
'project': 'etl-transformer',
'group': 'etl',
}
bucket.patch()
# update_properties printed in _PropertyMixin:patch
{
'labels': {
'project': 'etl-transformer',
'group': 'etl'
},
'storageClass': 'MULTI_REGIONAL',
'location': 'EU'
}
# I checked here even dump in requests package to be sure it's being passed to the http object
# api_reponse
{
u 'labels': {
u 'project': u 'etl-transformer',
u 'group': u 'etl'
},
u 'location': u 'US',
u 'storageClass': u 'MULTI_REGIONAL'
}
I know that documentation doesn’t say that location
attribute is a setter, but under the hood it’s a _scalar_property
which is appended to changed properties and according to json API, location is writable:
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
GetBucketLocation - Amazon Simple Storage Service
Returns the Region the bucket resides in. You set the bucket's Region using the LocationConstraint request parameter in a CreateBucket request.
Read more >Class Bucket (2.7.0) | Python client library - Google Cloud
A sequence of mappings describing each CORS policy. data_locations. Retrieve the list of regional locations for custom dual-region buckets. See https://cloud.
Read more >AWS S3 input | Filebeat Reference [8.5] - Elastic
Key and S3.Bucket.Name properties must be set (using the provided setters). The other properties will be used as metadata in the resulting event...
Read more >Creating a bucket - Amazon Simple Storage Service
When you create a bucket, you must choose a bucket name and Region. You can optionally choose other storage management options for the...
Read more >Fake GPS location - Apps on Google Play
Teleport your phone to any place in the world with two clicks! This app sets up fake GPS location so every other app...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @gastlich,
Could you try the following instead:
Closed via #5808.