Skip to content

Storage: fetch specific object version #5546

Closed

Description

@thakursc1-zz

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?

Activity

  1. changed the title [-]Cloud Storage:[Feature Request] [/-] [+]Storage: fetch specific object version[/+] on Jun 27, 2018
  2. added
    type: feature request
    api: storage
    on Jun 27, 2018
  3. tseaver commented on Jun 27, 2018

    @tseaver
    Contributor

    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

Metadata

Metadata

Assignees

Labels

api: storagetype: feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions