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

feat(storage): fetch file and bucket details from url #27322

Merged

Conversation

shubhangi-google
Copy link
Contributor

@shubhangi-google shubhangi-google commented Sep 12, 2024

Description

from_gs_url is a method to fetch bucket details and file details from a provided Google Storage (gs) URL.

Implementation Example

# @example Fetch bucketName and fileName from a gs URL:
   require "google/cloud/storage"
   gs_url = "gs://my-todo-app/avatars/heidi.jpeg"
   file = Google::Cloud::Storage::File
   file.from_gs_url(gs_url)
   =>
   {"bucket_name" => "my-todo-app", "file_path" => "avatars/heidi.jpeg"}

closes: #21550

@shubhangi-google shubhangi-google marked this pull request as ready for review September 12, 2024 06:35
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Sep 12, 2024
Copy link
Contributor

@bajajneha27 bajajneha27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Just two comments.

Copy link
Contributor

@bajajneha27 bajajneha27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one tiny comment. Post that, we should be able to merge it.

google-cloud-storage/lib/google/cloud/storage/file.rb Outdated Show resolved Hide resolved
@bajajneha27 bajajneha27 merged commit 805ca25 into googleapis:main Sep 21, 2024
11 of 13 checks passed
@github-actions github-actions bot added the release-please:force-run To run release-please label Sep 22, 2024
@release-please release-please bot removed the release-please:force-run To run release-please label Sep 22, 2024
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to fetch a GCS file given a URL
2 participants