I am writing an application that will be running on GCE and am using the google-api-go-client from https://code.google.com/p/google-api-go-client/ to store data in GCS.
I have a GAE application running as well that the GCE application communicates with.
I can run my GCE application locally and communicate with the live GCS servers and store files and retrieve them.
Now I am trying to locally store files in GCS so that I can run a test environment.
I see that devappserver supports simulating GCS via blobstore. However I can't seem to figure out how to point my GCE application at the local devappserver for GCS storage.
I am running a devappserver through 'goapp serve' with my GAE application.
I have tried setting the basepath and that results in 500 errors from the devappserver.
service, err := storage.New(httpClient)
service.BasePath = "http://localhost:8080/_ah/gcs/"
results in
ERROR 2014-10-23 19:14:08,692 module.py:727] Request to '/_ah/gcs/b/default/o/6051711999279104' failed
Traceback (most recent call last):
File "/home/ben/go_appengine/google/appengine/tools/devappserver2/module.py", line 723, in _handle_request
return handler.handle(match, environ, wrapped_start_response)
File "/home/ben/go_appengine/google/appengine/tools/devappserver2/wsgi_handler.py", line 59, in handle
return self._wsgi_app(environ, start_response)
File "/home/ben/go_appengine/google/appengine/tools/devappserver2/gcs_server.py", line 56, in __call__
status_message = httplib.responses.get(e.args[1], '')
IndexError: tuple index out of range
INFO 2014-10-23 19:14:08,693 module.py:652] default: "GET /_ah/gcs/b/default/o/6051711999279104?alt=json HTTP/1.1" 500 -
I can point my browser to this URL
http://localhost:8080/_ah/gcs/bucket
and get an XML result:
<ListBucketResult xmlns="http://doc.s3.amazonaws.com/2006-03-01">
<IsTruncated>False</IsTruncated>
</ListBucketResult>
I have seen several posts about using GCS locally but I can't seem to get it working correctly. Is there something I am doing wrong here? Or does devappserver not support GCS or maybe its just the json api it doesn't support?