-
Notifications
You must be signed in to change notification settings - Fork 167
Closed
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
I have created a Google bucket with "Fine-grained access control" and a few users have uploaded files to it. Using the python API I can't seem to get any information on who uploaded each. The blob.owner property just returns None:
sclient = storage.Client(project=GCLOUD_PROJECT)
bucket = storage.bucket.Bucket(client=sclient, name=GCLOUD_BUCKET)
blob = bucket.get_blob('foo.bar')
blob.reload()
print(blob.owner)
I'm calling reload() there because the documentation states it's required to pull some attributes from the server. All other properties I try print fine (size, updated, etag, md5_hash, etc.).
How can I recover the uploader identification?
Environment details
- OS type and version: Ubuntu 18.04
- Python version: 3.7.0
- pip version: 18.1
google-cloud-storageversion: 1.20.0
Steps to reproduce
- Place file in google bucket
- Attempt to use API to get owner information from the blob
Code example
bucket = storage.bucket.Bucket(client=sclient, name=GCLOUD_BUCKET)
blob = bucket.get_blob('foo.bar')
blob.reload()
print(blob.owner)
Stack trace
Doesn't error - just returns None
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.