问题
I'm a python developer.we use GCS (Google cloud storage) to store our images for past we months which is good but for android it requires to import all the buckets to Firebase Cloud Storage(FCS) for accessing it. We dont want any manual integration. we heard that if we create a bucket on FCS which automatically reflect on GCS which is good and there is no import required.
We trying to create bucket directly on firebase cloud storage. may i know is that posstible by programmtically?
回答1:
You can use the create_bucket function as described in the API documentation. There is also information in the product documentation:
from google.cloud import storage
def create_bucket_class_location(bucket_name):
"""Create a new bucket in specific location with storage class"""
# bucket_name = "your-new-bucket-name"
storage_client = storage.Client()
bucket = storage_client.bucket(bucket_name)
bucket.storage_class = "COLDLINE"
new_bucket = storage_client.create_bucket(bucket, location="us")
来源:https://stackoverflow.com/questions/64968685/how-can-i-create-bucket-on-firebase-cloud-storage