Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.

Python 2 is no longer supported by the community. We recommend that you migrate Python 2 apps to Python 3.

google.appengine.api.capabilities package


Allows applications to identify API outages and scheduled downtime.


def StoreUploadedProfileImage(self):
  uploaded_image = self.request.get('img')
  # If the images API is unavailable, we'll just skip the resize.
  if CapabilitySet('images').is_enabled():
    uploaded_image = images.resize(uploaded_image, 64, 64)

def RenderHTMLForm(self):
  datastore_readonly = CapabilitySet('datastore_v3', capabilities=['write'])
  if datastore_readonly.is_enabled():
    # ...render form normally...
    # self.response.out('<p>Not accepting submissions right now: %s</p>' %
    # ...render form with form elements disabled...

Individual API wrapper modules should expose CapabilitySet objects for users rather than relying on users to create them. They can also create convenience methods that delegate to the relevant CapabilitySet; for example, db.IsReadOnly().


class google.appengine.api.capabilities.CapabilitySet(package, capabilities=None, methods=None, stub_map=google.appengine.api.apiproxy_stub_map)source

Bases: object

Encapsulates one or more capabilities.

Capabilities can either be named explicitly, or inferred from the list of methods provided. If no capabilities or methods are provided, this will check whether the entire package is enabled.


Retrieves any administrator notice messages for these capabilities.


A string containing one or more administrator messages, or an empty string.


UnknownCapabilityError – If a specified capability was not recognized.


Tests whether the capabilities are currently enabled.


True if API calls that require these capabillities will succeed.


UnknownCapabilityError – If a specified capability was not recognized.


Returns whether a capability will remain enabled.

DEPRECATED: this method was never fully implemented and is considered deprecated. Use is_enabled() instead.


time – Number of seconds in the future to look when checking for scheduled downtime.


True if there is no scheduled downtime for the specified capability within the amount of time specified.


UnknownCapabilityError – If a specified capability was not recognized.

exception google.appengine.api.capabilities.UnknownCapabilityErrorsource

Bases: exceptions.Exception

An unknown capability was requested.