Python 2.7 has reached end of support
and will be deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Python
2.7 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you migrate to the latest supported version of Python.
Stay organized with collections
Save and categorize content based on your preferences.
google.appengine.api.capabilities package
Summary
Allows applications to identify API outages and scheduled downtime.
Example:
defStoreUploadedProfileImage(self):uploaded_image=self.request.get('img')# If the images API is unavailable, we'll just skip the resize.ifCapabilitySet('images').is_enabled():uploaded_image=images.resize(uploaded_image,64,64)store(uploaded_image)defRenderHTMLForm(self):datastore_readonly=CapabilitySet('datastore_v3',capabilities=['write'])ifdatastore_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 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().
Contents
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003egoogle.appengine.api.capabilities\u003c/code\u003e package allows applications to check for API outages and scheduled downtime, although it is not recommended due to the high availability of App Engine bundled services.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eis_enabled\u003c/code\u003e method within this API generally returns \u003ccode\u003etrue\u003c/code\u003e, with the exception of "Datastore write," which will return \u003ccode\u003efalse\u003c/code\u003e if Datastore is in read-only mode.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCapabilitySet\u003c/code\u003e objects are used to encapsulate one or more capabilities, either by explicitly naming them or inferring them from provided methods, or can also be used to check if an entire package is enabled.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ewill_remain_enabled_for\u003c/code\u003e method is deprecated and \u003ccode\u003eis_enabled\u003c/code\u003e is the preferred way to check if a capability is available.\u003c/p\u003e\n"],["\u003cp\u003eThe API provides an \u003ccode\u003eadmin_message\u003c/code\u003e method to retrieve any administrator notices related to the capabilities, returning an empty string if no message is available.\u003c/p\u003e\n"]]],[],null,[]]