ratnesh
ratnesh

Reputation: 569

from bucket url download blob object gcloud

is their a way to download gcloud bucket blob object from bucket url only using python One way which I know, is by using bucket_name and blob_name. But I want to download using url only is their any direct way from gcloud client. One other way is to parse url and get bucket name and blob name.

If their is any direct way, please guide, I am unable to find answers related to it

Upvotes: 1

Views: 220

Answers (1)

ratnesh
ratnesh

Reputation: 569

In [12]: url
Out[12]: 'https://storage.cloud.google.com/bucket_name/blob_name'

In [13]: url.split("/")[-2:]
Out[13]: ['bucket_name', 'blob_name']

using above details, I can now query gcp client to get details

Upvotes: 2

Related Questions