アプリケーションで Capabilities API を使用すると、特定の API 機能の停止や予定されているダウンタイムを検出できます。この API を使用すると、機能が利用できなくなる時間帯を検出してバイパスできるので、アプリケーションのダウンタイムを短縮できます。.
たとえば、Images API を使用して画像のサイズを変更する場合は、次のように Capabilities API を使用して、Images API が利用できないことを検出したらサイズ変更をスキップできます。
fromgoogle.appengine.apiimportcapabilitiesdefStoreUploadedProfileImage(self):uploaded_image=self.request.get('img')# If the images API is unavailable, we'll just skip the resize.ifcapabilities.CapabilitySet('images').is_enabled():uploaded_image=images.resize(uploaded_image,64,64)store(uploaded_image)
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-19 UTC。"],[[["The Capabilities API allows applications to detect outages and scheduled downtime for specific API capabilities, helping to reduce application downtime by bypassing unavailable features."],["This API supports first-generation runtimes and can be utilized when upgrading to corresponding second-generation runtimes, with specific migration guidance for the App Engine Python 3 runtime."],["While `is_enabled` generally returns `true`, the \"Datastore writes\" capability returns `false` if Datastore is in read-only mode."],["The API can be used by explicitly naming capabilities or by inferring them from the `CapabilitySet` class methods."],["The API currently supports capabilities like blobstore, Datastore reads and writes, Images, Mail, Memcache, Task Queue, and URL Fetch services."]]],[]]