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) store(uploaded_image) def RenderHTMLForm(self): datastore_readonly = CapabilitySet('datastore_v3', capabilities=['write']) if datastore_readonly.is_enabled(): # ...render form normally... else: # self.response.out('<p>Not accepting submissions right now: %s</p>' % datastore_readonly.admin_message()) # ...render form with form elements disabled...
Individual API wrapper modules should expose
for users rather than relying on users to create them. They can
also create convenience methods that delegate to the relevant
- class google.appengine.api.capabilities.CapabilitySet(package, capabilities=None, methods=None, stub_map=google.appengine.api.apiproxy_stub_map)source
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.
Returns whether a capability will remain enabled.
DEPRECATED: this method was never fully implemented and is considered deprecated. UseParameters
time -- Number of seconds in the future to look when checking for scheduled downtime.Returns
Trueif 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
An unknown capability was requested.