Go 1.11 has reached end of support
and will be deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Go 1.11
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Go
1.11 applications will continue to run and receive traffic after their
deprecation date. We
recommend that you migrate to the latest supported version of Go.
Stay organized with collections
Save and categorize content based on your preferences.
With the Capabilities API, your application can detect outages and scheduled
downtime for specific API capabilities. You can use
this API to reduce downtime in your application by detecting when a capability
is unavailable and then bypassing it. To view the contents of
the capability package, see the
capability package reference.
.
For example, if you use the Datastore API, you can use the Capabilities API to
detect when the Datastore API is unavailable and report an error to the user:
funchandler(whttp.ResponseWriter,r*http.Request){ctx:=appengine.NewContext(r)// Check if the Datastore API is availableif!capability.Enabled(ctx,"datastore_v3","*"){http.Error(w,"This service is currently unavailable.",503)return}// do Datastore lookup ...}
You can separately query for the availability of Datastore reads and writes. The
following sample shows how to detect the availability of Datastore writes and,
during downtime, provide a message to users:
funccheckDatastoreMode(whttp.ResponseWriter,r*http.Request){ctx:=appengine.NewContext(r)// Check if the Datastore service is in read-only mode.if!capability.Enabled(ctx,"datastore_v3","write"){// Datastore is in read-only mode.}}
Using the Capabilities API in Go 1.11
The capability.Enabled
function returns true if the provided API and capability are available. You must
pass either a capability name (such as "write") or the wildcard "*" to query
all capabilities of the API.
Supported capabilities
The API currently supports the following capabilities:
[[["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-09-04 UTC."],[[["\u003cp\u003eThe Capabilities API allows applications to detect outages and scheduled downtime for specific API capabilities, helping to reduce downtime by identifying when a capability is unavailable and bypassing it.\u003c/p\u003e\n"],["\u003cp\u003eThis API is designed for first-generation runtimes and remains usable when upgrading to corresponding second-generation runtimes, although those upgrading to Go 1.12+ should consult the migration guide.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecapability.Enabled\u003c/code\u003e function verifies the availability of a given API and capability, and requires a capability name like \u003ccode\u003e"write"\u003c/code\u003e or the wildcard \u003ccode\u003e"*"\u003c/code\u003e for querying all API capabilities.\u003c/p\u003e\n"],["\u003cp\u003eDatastore writes are the only exception to the usual behavior, with the API returning \u003ccode\u003eDISABLED\u003c/code\u003e when Datastore is in read-only mode, whereas other statuses return \u003ccode\u003eENABLED\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSupported capabilities include the availability of the blobstore, Datastore reads and writes, Mail service, Memcache service, Task Queue service, and URL Fetch service.\u003c/p\u003e\n"]]],[],null,["# Capabilities API for legacy bundled services\n\nWith the Capabilities API, your application can detect outages and scheduled\ndowntime for specific [API capabilities](#Supported_capabilities). You can use\nthis API to reduce downtime in your application by detecting when a capability\nis unavailable and then bypassing it. To view the contents of\nthe `capability` package, see the\n[`capability` package reference](/appengine/docs/legacy/standard/go111/reference/latest/capability).\n.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n| Every status request to this API always returns `ENABLED` except\n| for the \"Datastore writes\" capability, which returns `DISABLED` if\n| Datastore is in read-only mode for your app.\n\nFor example, if you use the Datastore API, you can use the Capabilities API to\ndetect when the Datastore API is unavailable and report an error to the user: \n\n func handler(w http.ResponseWriter, r *http.Request) {\n \tctx := appengine.NewContext(r)\n \t// Check if the Datastore API is available\n \tif !capability.Enabled(ctx, \"datastore_v3\", \"*\") {\n \t\thttp.Error(w, \"This service is currently unavailable.\", 503)\n \t\treturn\n \t}\n \t// do Datastore lookup ...\n }\n\nYou can separately query for the availability of Datastore reads and writes. The\nfollowing sample shows how to detect the availability of Datastore writes and,\nduring downtime, provide a message to users: \n\n func checkDatastoreMode(w http.ResponseWriter, r *http.Request) {\n \tctx := appengine.NewContext(r)\n \t// Check if the Datastore service is in read-only mode.\n \tif !capability.Enabled(ctx, \"datastore_v3\", \"write\") {\n \t\t// Datastore is in read-only mode.\n \t}\n\n }\n\nUsing the Capabilities API in Go 1.11\n-------------------------------------\n\nThe [`capability.Enabled`](/appengine/docs/legacy/standard/go111/reference/latest/capability#google_golang_org_appengine_capability_Enabled)\nfunction returns true if the provided API and capability are available. You must\npass either a capability name (such as `\"write\"`) or the wildcard `\"*\"` to query\nall capabilities of the API.\n\nSupported capabilities\n----------------------\n\nThe API currently supports the following capabilities:"]]