Viewing Data in AppScale (remote_api)

Chris Donati edited this page Mar 14, 2017 · 9 revisions

This document describes how to view data of your application in AppScale. AppScale uses the remote API shell in order to do this, so viewing data is actually just one of the many things that can be done. This feature is available as of 1.14.0. For more information see how to use the remote API shell in GAE here.

Application Requirements

Make sure that you have the remote_api builtins enabled in your app.yaml. Here is an example for the guestbook sample application:

application: guestbook
version: 1
runtime: python
api_version: 1
- remote_api: on
- url: /.*

If you are running a java application then you need to update your web.xml to contain the following in your web-app xml tags:

        <display-name>Remote API Servlet</display-name>

Connect to the Remote Shell

Log into an AppScale node. From where your AppScalefile is located you can do the following:

local# appscale ssh
appscale-image0# cd /root/appscale/AppServer/google/appengine/tools
appscale-image0# python -s <head_node_ip>:<application_port>
# Log in as your AppScale user

In Java

AppScale 2.1 and beyond has support for remote API on the Java client side. Use the appengine-remote-api.jar found in


and replace the default on. This modified jar uses AppScale's authentication system, rather than Google's.

Add the following in your web.xml:



And then follow the directions given by Google here:


To query on certain entity kinds, the entity in question must be imported. You can import this into the shell directly, or import a file that has the Model definition. The following example explains this.


root@appscale-image0:~/appscale/AppServer/google/appengine/tools# python -s
App Engine remote_api shell
Python 2.7.3 (default, Sep 26 2013, 20:03:06) 
[GCC 4.6.3]
The db, ndb, users, urlfetch, and memcache modules are imported.
guestbook27> class Greeting(ndb.Model):
...   author = ndb.UserProperty()
...   content = ndb.TextProperty()
...   date = ndb.DateTimeProperty(auto_now_add=True)
guestbook27> ndb.gql("SELECT * FROM Greeting")
Query(kind='Greeting', default_options=QueryOptions(offset=0))
guestbook27> query = ndb.gql("SELECT * FROM Greeting")
guestbook27> print query.fetch()
[Greeting(key=Key('Guestbook', 'default_guestbook', 'Greeting', 1), author=None, content=u'testtest', date=datetime.datetime(2014, 1, 22, 17, 21, 1, 13485))]
guestbook27> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
guestbook27> exit()