I'm trying to get a list of buckets in a project, using python like this:
from google.cloud import storage
storage_client = storage.Client(project='[project-id]')
bucket = storage_client.get_bucket([bucket-name])
blobs = bucket.list_blobs()
for blob in blobs:
print(blob.name)
But i get an error:
[service-account-ID]-compute@developer.gserviceaccount.com does not have storage.buckets.get access to [bucket-name]
Anyways if i try using gsutil (using the same service account):
gsutil ls gs://[bucket-name]
I can get the list of objects in the bucket... So i dont understand what is happening, any clue about what should i do?