이전에는 Cloud Endpoints Frameworks를 Endpoints라고 불렀습니다. 두 버전을 구분하기 위해 이 페이지에서는 새 버전을 Endpoints Frameworks 버전 2.0으로, 이전 버전을 Endpoints 버전 1.0이라고 지칭합니다. 이 페이지에서는 Cloud Endpoints 버전 1.0을 Endpoints Frameworks 버전 2.0으로 이전하는 방법을 설명합니다.
이전을 위해 라이브러리와 애플리케이션 구성을 변경해야 하지만 코드를 변경할 필요는 없습니다.
이점
Endpoints 버전 2.0에는 다음과 같은 여러 가지 장점이 있습니다.
요청 지연 시간 감소
App Engine 기능(예: 커스텀 도메인)과의 통합 향상
새로운 API 관리 기능
Endpoints Frameworks 버전 2.0은 API 인터페이스에 영향을 미치지 않습니다. 기존 클라이언트는 이전 후에도 클라이언트 측 코드 변경 없이 계속 작동합니다.
기능 개요
이전 버전인 Endpoints 버전 1.0과 호환되는 기능은 다음과 같습니다.
모든 Google 클라이언트 라이브러리에서 사용되는 JSON-REST 프로토콜
검색 서비스
모든 기존 인증 기능(OAuth2/OpenID Connect)
생성된 클라이언트에 대한 클라이언트 라이브러리 지원
CORS(Google 자바스크립트 클라이언트 라이브러리를 사용하지 않는 자바스크립트 호출자용)
API 탐색기
트래픽 분할은 제공되지 않습니다.
현재 제외된 기능
제공되지 않는 기능은 다음과 같습니다. 이 중에서 필요한 기능이 있으면 기능 요청을 제출하세요.
API 버전 문자열을 확인합니다. @endpoints.api(version='v1', ...) 데코레이터에 지정된 버전 문자열이 API 경로에 표시됩니다.
SemVer 표준과 호환되는 버전 문자열을 지정하면 API를 배포할 때 API 경로에 주 버전 번호만 표시됩니다. 예를 들어 이름이 echo이고 버전은 2.1.0인 API의 경로는 /echo/v2와 같습니다. echo API를 버전 2.2.0으로 업데이트하고 이전 버전과 호환되는 변경 사항을 배포하면 경로는 /echo/v2로 유지됩니다.
따라서 클라이언트의 기존 경로를 유지하면서 이전 버전과 호환되는 변경을 수행하면 API 버전 번호를 업데이트할 수 있습니다.
하지만 echo API를 버전 3.0.0으로 업데이트하는 경우 브레이킹 체인지를 배포하는 것이기 때문에 경로가 /echo/v3으로 변경됩니다.
요청에 표시되는 경로가 /_ah/api로 시작되면 Endpoints Frameworks 버전 2.0이 API를 제공하고 있는 것입니다. 경로가 /_ah/spi로 시작되는 요청은 로그에 표시되지 않아야 합니다. 이러한 요청은 Endpoints 버전 1.0 프록시에서 여전히 요청을 처리하고 있음을 나타냅니다.
API 관리 추가
Endpoints Frameworks 버전 2.0은 다음을 포함한 API 관리 기능을 추가합니다.
이 섹션에서는 Endpoints 프레임워크 버전 2.0으로 마이그레이션할 때 일반적으로 나타나는 불안정한 동작과 추천 해결 방법을 설명합니다.
API에서 404 오류를 반환하되 API 탐색기에는 API 목록이 올바르게 표시됨
Endpoints Frameworks 버전 2.0으로 이전할 때는 이전 버전 1.0 Endpoints 구성을 삭제해야 합니다. 애플리케이션 구성에 이전 구성이 남아 있으면 Endpoints 서비스가 앱을 계속 버전 1.0 앱으로 취급합니다. 이러한 경우 /_ah/spi로 전송된 요청이 App Engine 로그에 나타날 수 있으며, 이로 인해 클라이언트에 HTTP 404 오류가 전송됩니다.
app.yaml 파일에 다음 줄이 있으면 삭제합니다.
handlers:-url:/_ah/spi/.*script:...
app.yaml 파일의 handlers 섹션에 다음과 같이 정확한 경로가 있는지 확인합니다.
handlers:# The endpoints handler must be mapped to /_ah/api.-url:/_ah/api/.*script:...
오류 메시지: ImportError: cannot import name locked_file
이 문제는 종속 항목에 App Engine과 호환되지 않는 oauth2client 라이브러리 버전이 포함된 경우 발생합니다. 알려진 문제를 참조하세요.
[[["이해하기 쉬움","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-09-04(UTC)"],[[["\u003cp\u003eEndpoints Frameworks version 2.0 is a migration from the older Endpoints version 1.0, requiring a library change and application configuration update, without needing code alterations.\u003c/p\u003e\n"],["\u003cp\u003eMigrating to Endpoints Frameworks version 2.0 offers benefits such as reduced request latency, improved App Engine integration, and new API management capabilities, while maintaining backward compatibility with existing client interfaces.\u003c/p\u003e\n"],["\u003cp\u003eThe migration process involves creating a \u003ccode\u003e/lib\u003c/code\u003e subfolder, installing the \u003ccode\u003egoogle-endpoints\u003c/code\u003e library, modifying the \u003ccode\u003eapp.yaml\u003c/code\u003e file to remove old Endpoints entries and include new library dependencies, and updating the \u003ccode\u003eurl\u003c/code\u003e directive to \u003ccode\u003e/_ah/api/.*\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEndpoints Frameworks version 2.0 supports various features like JSON-REST protocol, Discovery service, and OAuth2/OpenID Connect authentication, but excludes features like JSON-RPC protocol and automatic ETags.\u003c/p\u003e\n"],["\u003cp\u003eVerifying a successful migration to Endpoints Frameworks version 2.0 involves checking the Cloud Logging for requests with paths beginning with \u003ccode\u003e/_ah/api\u003c/code\u003e, confirming that no requests start with \u003ccode\u003e/_ah/spi\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Migrating to Cloud Endpoints Frameworks version 2.0\n\nCloud Endpoints Frameworks was formerly called Endpoints. To\ndistinguish between the two versions, this page refers to the new version as\nEndpoints Frameworks version 2.0, and the older version as\nEndpoints version 1.0. This page describes how to migrate an\nCloud Endpoints version 1.0 application to\n[Endpoints Frameworks version 2.0](/endpoints/docs/frameworks/python).\nThe migration consists of a library change and an application configuration\nchange, but you don't have to make any changes to your code.\n\nBenefits\n--------\n\nEndpoints version 2.0 brings a number of benefits, including:\n\n- Reduced request latency.\n- Better integration with App Engine features, such as custom domains.\n- New API management features.\n\nEndpoints Frameworks version 2.0 doesn't affect the interfaces to your\nAPI. Existing clients continue to work after migration without any client-side\ncode changes.\n\nFeature overview\n----------------\n\nThe following features are backward compatible with Endpoints\nversion 1.0:\n\n- JSON-REST protocol, which is used by all Google client libraries\n- Discovery service\n- All existing authentication features (OAuth2/OpenID Connect)\n- Client library support for generated clients\n- CORS (for JavaScript callers not using Google JavaScript client library)\n- API Explorer\n\nTraffic splitting is unavailable.\n\nCurrently excluded features\n---------------------------\n\nThe following features are unavailable. If you require any of these,\nplease submit a\n[feature request](https://github.com/cloudendpoints/endpoints-python/issues).\n\n- JSON-RPC protocol, which is required for legacy iOS clients. To create iOS clients for your Endpoints Frameworks version 2.0 API, we recommend that you use [Google APIs Objective-C client library for REST APIs](https://github.com/google/google-api-objectivec-client-for-rest/wiki).\n- Automatic ETags\n- Automatic `kind` fields\n- IDE integration\n- `fields` partial responses\n- Automatic PATCH API method creation\n\nMigrating from Endpoints version 1.0\n------------------------------------\n\n| **Important:** You must download the linked packages and import them into your application. You must remove the old dependencies.\n\nTo migrate from version 1.0:\n\n1. Create a subfolder named `/lib` in your application's main directory.\n\n2. Install the library from your application's main directory:\n\n pip install -t lib google-endpoints --ignore-installed\n\n3. Remove the `- name: endpoints` and `version 1.0` entries from your\n application's `app.yaml` file under the `libraries` section. For example:\n\n libraries:\n - name: endpoints #Remove\n version: 1.0 #Remove\n\n4. In the `libraries` section in the `app.yaml` file, add the following:\n\n libraries:\n - name: pycrypto\n version: 2.6\n - name: ssl\n version: 2.7.11\n\n Endpoints Frameworks requires these versions of the `pycrypto` and\n `ssl` libraries.\n5. In the `handlers` section in the `app.yaml` file, change the `url` directive\n from `- url: /_ah/spi/.*` to `- url: /_ah/api/.*`.\n\n6. In the root directory of your application, create or modify a file named\n `appengine_config.py` to include the following:\n\n from google.appengine.ext import vendor\n\n vendor.add('lib')\n\n7. Check your API version string. Your version string, specified in the\n `@endpoints.api(version='v1', ...)` decorator, appears in your API's path.\n If you specify a version string compatible with the\n [SemVer standard](https://semver.org/spec/v2.0.0.html),\n only the major version number appears in your API's path when you deploy\n your API. For example, an API called `echo` with version `2.1.0` would\n have a path such as `/echo/v2`. If you update the `echo` API to version\n `2.2.0` and deploy a backwards-compatible change, the path remains `/echo/v2`.\n This allows you to update the API version number when you make a\n backwards-compatible change without breaking existing paths for your clients.\n But if you update the `echo` API to version `3.0.0` (because you are\n deploying a breaking change), the path is changed to `/echo/v3`.\n\n8. Redeploy your Endpoints Frameworks application.\n\n | **Note** : When migrating, you must deploy to a new App Engine version. This is done automatically if you don't specify a version. See [Known Issues](/endpoints/docs/frameworks/known-issues#endpoints_frameworks_migration).\n\n \u003cbr /\u003e\n\n### Verifying a new deployment\n\nTo verify that the new framework is serving traffic:\n\n1. Send some requests to the new deployment.\n2. Visit the Cloud Logging page for your project. \n\n [Go to the Logs Explorer page](https://console.cloud.google.com/logs/query)\n3. If requests are shown with having paths beginning with `/_ah/api`, then Endpoints Frameworks version 2.0 is now serving your API. The logs shouldn't show any requests with paths beginning with `/_ah/spi`. These requests indicate that the Endpoints version 1.0 proxy is still serving requests.\n\nAdding API management\n---------------------\n\nEndpoints Frameworks version 2.0 adds API management features,\nincluding:\n\n- API key management\n- API sharing\n- User authentication\n- API metrics\n- API logs\n\nTo get started, go to the\n[Getting started with Endpoints Frameworks for Python](/endpoints/docs/frameworks/python)\npage.\n\nTroubleshooting\n---------------\n\nThis section describes common erratic behaviors when migrating to\nEndpoints Frameworks version 2.0 and suggested solutions.\n\n### API returns `404` errors, but API Explorer still lists APIs correctly\n\nYou are required to remove the old version 1.0 Endpoints\nconfiguration when migrating to Endpoints Frameworks version 2.0. If\nthe old configuration is still present in the application's configuration, the\nEndpoints service continues to treat the app as a version 1.0\napp. You might see requests in your App Engine logs sent to `/_ah/spi`,\nwhich result in `HTTP 404` errors sent to the client.\n\n1. Remove the following lines, from the `app.yaml` file if they are present:\n\n handlers:\n - url: /_ah/spi/.*\n script: ...\n\n2. Make sure the `handlers` section in your `app.yaml` file has the correct\n path:\n\n handlers:\n # The endpoints handler must be mapped to /_ah/api.\n - url: /_ah/api/.*\n script: ...\n\n### Error message: `ImportError: cannot import name locked_file`\n\nThis happens if your dependencies contain a version of the `oauth2client`\nlibrary that is incompatible with App Engine. See the\n[known issue](/endpoints/docs/frameworks/known-issues#error_message_importerror_cannot_import_name_locked_file)."]]