참고: Python 2.7은 2024년 1월 31일 지원 종료됩니다. 기존 Python 2.7 애플리케이션을 계속 실행하고 트래픽을 받을 수 있습니다. 그러나 지원 종료 날짜 이후에는 해당 런타임을 사용하는 애플리케이션의 재배포를 App Engine에서 차단할 수 있습니다.
지원되는 최신 Python 버전으로 마이그레이션하는 것이 좋습니다.
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)
Datastore API는 Datastore 읽기 및 쓰기 기능을 위한 편의 래퍼를 제공합니다. 기능 이름을 CapabilitySet()에 대한 인수로 제공하여 기능을 간단히 테스트할 수 있지만 이 경우에는 db.READ_CAPABILITY 및 db.WRITE_CAPABILITY 편의 CapabilitySet 객체를 사용할 수도 있습니다. 다음 샘플은 편의 래퍼를 사용하여 Datastore 쓰기 가능 여부를 감지하는 방법을 보여주며 다운타임 중 사용자에게 메시지를 제공합니다.
fromgoogle.appengine.extimportdbdefRenderHTMLForm(self):ifnotdb.WRITE_CAPABILITY.is_enabled():# Datastore is in read-only mode.
Python 2에서 Capabilities API 사용
CapabilitySet 클래스는 이 API에 사용할 수 있는 모든 메서드를 정의합니다. 기능 이름을 명시적으로 지정하거나 이 클래스에서 제공하는 메서드에서 추론할 수 있습니다. 이 API에서 현재 사용 설정된 서비스 목록은 아래를 참조하세요.
[[["이해하기 쉬움","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)"],[[["\u003cp\u003eThe Capabilities API allows applications to detect outages and scheduled downtime for specific API capabilities, helping to reduce application downtime by bypassing unavailable features.\u003c/p\u003e\n"],["\u003cp\u003eThis 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.\u003c/p\u003e\n"],["\u003cp\u003eWhile \u003ccode\u003eis_enabled\u003c/code\u003e generally returns \u003ccode\u003etrue\u003c/code\u003e, the "Datastore writes" capability returns \u003ccode\u003efalse\u003c/code\u003e if Datastore is in read-only mode.\u003c/p\u003e\n"],["\u003cp\u003eThe API can be used by explicitly naming capabilities or by inferring them from the \u003ccode\u003eCapabilitySet\u003c/code\u003e class methods.\u003c/p\u003e\n"],["\u003cp\u003eThe API currently supports capabilities like blobstore, Datastore reads and writes, Images, Mail, Memcache, Task Queue, and URL Fetch services.\u003c/p\u003e\n"]]],[],null,[]]