3

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?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441

2 Answers2

2

You can't create a new bucket if you are using Spark Plan in FCS, but you access the default bucket to do an operation like Upload/Download.

default bucket will end in terms of (.appspot.com)

0

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

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • Hi doug i can create bucket on GCS but not on Firebase for that i should have to import the bucket on firebase cloud storage which one i dont need ... i want to create a bucket directly on firebase storage not on google storage – Charles Michel Nov 24 '20 at 04:13
  • Firebase storage buckets are the exact same thing as Google Cloud Storage buckets. They are the same product. Firebase just makes it possible to access the bucket directly from the mobile app using the provided SDKs. It's not possible to have a Firebase bucket that is not also seen in the Google Cloud console. – Doug Stevenson Nov 24 '20 at 04:23
  • 1
    Doug yes i know that Firebase buckets are the same as GCS buckets but here what i meant was i dont want to import the buckets manually from GCS to Firebase Storage. i wanted to create a bucket programmatically on Firebase Storage – Charles Michel Nov 24 '20 at 05:04
  • I dont want to import(manual import if we can programmatically then its fine ) the bucket from GCS to Firebase Cloud Storage.. – Charles Michel Nov 24 '20 at 05:07
  • I don't think that's possible. Contact Firebase support to file a feature request. https://support.google.com/firebase/contact/support – Doug Stevenson Nov 24 '20 at 05:20