how do you get a serving url for google cloud storage (gcs) object

509 views
Skip to first unread message

James Gilliam

unread,
Aug 23, 2015, 7:00:18 PM8/23/15
to Google App Engine
been googling and reading docs trying to find this out without luck.

i have created a gcs object and want to get a url for serving it (get_serving_url)

how do you do this?

also, is there a way to get a blobinfo for the gcs object ?

thanks


Ryan (Cloud Platform Support)

unread,
Aug 24, 2015, 9:58:46 AM8/24/15
to Google App Engine
Salutations James,

You need to run 'blobstore.create_gs_key' then pass the results to the get_serving_url. 

self.response.write("<img src='%s'>" % get_serving_url(blobstore.create_gs_key("/gs/bucket/image.png")))

Jim Gilliam

unread,
Aug 24, 2015, 11:53:43 AM8/24/15
to Google App Engine
Thanks Ryan.

It works.

Do you know where this is documented in GAE ?

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/ymGS2Nwjrqw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/30015186-f8a4-4a6e-935a-b2e001d60076%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ryan (Cloud Platform Support)

unread,
Aug 24, 2015, 12:26:40 PM8/24/15
to Google App Engine
Glad it works!

It is not explicitly documented. You have to read the constructors. The link on the main docs page has one to the get_serving_url that shows it needs a blob_key. Reading the section on Blobs and GCS you see how to get the key. We encourage Feedback on our docs. At the top of the page it has a 'Send feedback' button where you can express your wishes (such as clearer use of the get_serving_url).


On Monday, August 24, 2015 at 11:53:43 AM UTC-4, James Gilliam wrote:
Thanks Ryan.

It works.

Do you know where this is documented in GAE ?
On Mon, Aug 24, 2015 at 6:58 AM, Ryan (Cloud Platform Support) <rbru...@google.com> wrote:
Salutations James,

You need to run 'blobstore.create_gs_key' then pass the results to the get_serving_url. 

self.response.write("<img src='%s'>" % get_serving_url(blobstore.create_gs_key("/gs/bucket/image.png")))

On Sunday, August 23, 2015 at 7:00:18 PM UTC-4, James Gilliam wrote:
been googling and reading docs trying to find this out without luck.

i have created a gcs object and want to get a url for serving it (get_serving_url)

how do you do this?

also, is there a way to get a blobinfo for the gcs object ?

thanks


--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/ymGS2Nwjrqw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages