hep-gc / dynafed_storagestats

Apache License 2.0
2 stars 2 forks source link

Add support for Google Cloud Storage #4

Open ffgalindo opened 6 years ago

ffgalindo commented 6 years ago

Add support for Google Cloud Storage

ffgalindo commented 6 years ago

Possible method on how to obtain storages used per blob.

https://stackoverflow.com/questions/39784244/google-cloud-storage-python-list-blob-not-printing-object-list

def list_blobs(bucket_name):
    """Lists all the blobs in the bucket."""
    storage_client = storage.Client()
    bucket = storage_client.get_bucket(bucket_name)

    blobs = bucket.list_blobs()

    for blob in blobs:
        print(blob.name)

The blob object should have size attribute somewhere