I'm having issues downloading files on my google bucket I followed this Google tutorial(using a client library & service account)
Here is the python code I use (from google example) : import json from httplib2 import Http from oauth2client.client import SignedJwtAssertionCredentials from apiclient.discovery import build
client_email = '[email protected]'
json_file = 'resources/Google/myproject-anumber.json' ## <---- JSON provided when i created the service account
cloud_storage_bucket = 'mybucketname'
report_to_download = 'path/to/my/file.zip'
private_key = json.loads(open(json_file).read())['private_key']
credentials = SignedJwtAssertionCredentials(client_email, private_key,
'https://www.googleapis.com/auth/devstorage.read_only')
storage = build('storage', 'v1', http=credentials.authorize(Http()))
report = storage.objects().get(bucket = cloud_storage_bucket, object =
report_to_download).execute()
I thought i would have then to output 'report' to a file, but no, as described here, report is only a dict object :
I tried then to use the selfLink attribute or mediaLink, but with no success. Same for 'https://cloud.google.com/storage/docs/json_api/v1/objects/get' which returns the ACL aswell
Thank you in advance,