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

Ability to fetch a GCS file given a URL #21550

Open
sambostock opened this issue May 5, 2023 · 0 comments
Open

Ability to fetch a GCS file given a URL #21550

sambostock opened this issue May 5, 2023 · 0 comments
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

@sambostock
Copy link

Is your feature request related to a problem? Please describe.
Given a gs://bucket/path?generation=... URL, it would be nice to be able to fetch a file without needing to manually split the URL into pieces.

Describe the solution you'd like
A method could exist to do the splitting automatically and fetch the specified file. For example:

  • Google::Cloud::Storage#file_from_url
  • Google::Cloud::Storage::File.from_url

Describe alternatives you've considered
The current approach involves manually extracting the pieces of the URL to construct

bucket, path, options = split_url_please(gs_url)
Google::Cloud::Storage.new(project_id: '...').bucket(bucket).file(path, **options)
@dazuma dazuma 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 May 17, 2023
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

3 participants