Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage: fetch specific object version #5546

Closed
thakursc1-zz opened this issue Jun 27, 2018 · 1 comment
Closed

Storage: fetch specific object version #5546

thakursc1-zz opened this issue Jun 27, 2018 · 1 comment
Assignees
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@thakursc1-zz
Copy link

thakursc1-zz commented Jun 27, 2018

Is there a way to query a specific version of an object from cloud storage?

def get_file_from_bucket(kind, id, ver:str)->dict:
    bucket = "bucket123"
    blob_path = "records" + "/" + kind + "/" + id+"#"+ver
    print("{}".format(blob_path))
    cred_file = Path(os.path.dirname((os.path.dirname(os.path.abspath(__file__)))),"service_file")
    storage_client = storage.Client.from_service_account_json(cred_file)
    bucket = storage_client.get_bucket(bucket)
    b = bucket.get_blob(blob_path)
    return b

>> None

The above function returns None, but when I remove the version I get the respective object. Is there a way to retrieve an object with specified version?

@tseaver tseaver changed the title Cloud Storage:[Feature Request] Storage: fetch specific object version Jun 27, 2018
@tseaver tseaver added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: storage Issues related to the Cloud Storage API. labels Jun 27, 2018
@tseaver
Copy link
Contributor

tseaver commented Jun 27, 2018

This is basically a duplicate of #4490. We do not have support for fetching specific generations / metagenerations of blobs / objects, but have future plans to add that support.

/cc @frankyn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants