Google Cloud Storage API: How do you call `create_bucket()` with storage class and location options?

89 Views Asked by At

I want to create a bucket equivalent to this

gsutil mb -c regional -l us-east1 gs://my-bucket:

how do I do that with the python API?

bucket = client.create_bucket('my-bucket')
assert isinstance(bucket, Bucket)
# <Bucket: my-bucket>

see: https://googlecloudplatform.github.io/google-cloud-python/latest/storage/client.html

1

There are 1 best solutions below

0
Patrick W On BEST ANSWER

There is no way to set the region or the storage class through the python API. I recommend creating a feature request for this.