Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the serving URL for Google Cloud Storage file objects on App Engine dev server?

I have a python App Engine app and save files using the Google Cloud Storage API. However I need to get the serving URL for each file.

On production it is easy to figure out what the serving URL is as I prepend http://commondatastorage.googleapis.com to /bucket/path/to/file.txt as I already have the bucket name and path to my file.

How do I figure out what the serving URL is on the dev server?

It seems straight forward enough to do this with images using images.get_serving_url which can now take either blobstore or Cloud Storage references.

How can I figure out the serving URL for all files, not just images in a way that is compatible with both the development and production App Engine environments?

like image 768
Dan Avatar asked Dec 31 '13 03:12

Dan


People also ask

How do I get signed URL for Google Cloud Storage?

Options for generating a signed URL Simply specify Cloud Storage resources, point to the host storage.googleapis.com , and use Google HMAC credentials in the process of generating the signed URL.

What is the URL for the Google Cloud Platform?

All requests to the storage.cloud.google.com URI require authentication.

Can I upload files to Google Cloud Storage from URL?

Uploading files to Google Cloud Storage from a URL is possible, but there are a few things to keep in mind. First, you'll need to create a Google Cloud Storage bucket and give it a name. Next, you'll need to create a file object in the bucket and provide the URL of the file you want to upload.


1 Answers

You can use GCS via the blobstore API. See this section for how to set up a serving handler for a GCS key:

https://developers.google.com/appengine/docs/python/blobstore/#Python_Using_the_Blobstore_API_with_Google_Cloud_Storage

like image 142
jterrace Avatar answered Oct 19 '22 23:10

jterrace