Cloud Endpoints Frameworks는 Extensible Service Proxy(ESP)가 Cloud Endpoints에 제공하는 기능과 비슷한 API 관리 기능을 제공합니다. Endpoints Frameworks에는 요청을 API 백엔드로 전달하기 전에 모든 요청을 가로채고 필요한 검사(예: 인증)를 수행하는 기본 제공 API 게이트웨이가 포함되어 있습니다. 백엔드가 응답하면 Endpoints Frameworks는 원격 분석 데이터를 수집하고 보고합니다. API의 측정항목은Google Cloud 콘솔의 Endpoints > 서비스 페이지에서 확인할 수 있습니다.
Endpoints를 통해 API를 관리하려면 OpenAPI 사양 버전 2.0을 사용하여 API를 설명하는 OpenAPI 문서를 배포해야 합니다.
이 페이지에서는 API를 관리하도록 Endpoints를 사용 설정하는 OpenAPI 문서를 생성하고 배포하는 방법을 설명합니다.
API 관리를 추가하지 않으면 API는 계속해서 요청을 처리하지만Google Cloud 콘솔의 Endpoints > 서비스 페이지에 API가 표시되지 않고 Endpoints에서 제공하는 기능(예: 로깅, 모니터링, 할당량 설정)을 사용할 수 없습니다.
API에 API 관리를 추가하려면 다음 단계를 따르세요.
빌드 파일 구성에 설명된 대로 Maven pom.xml 파일 또는 Gradle build.gradle 파일을 설정합니다.
빌드 파일에 Google Cloud 프로젝트 ID를 설정해야 합니다.
Maven
<endpoints.project.id>를 검색하고 YOUR_PROJECT_ID를 Google Cloud 프로젝트 ID로 바꿉니다. 예를 들면 다음과 같습니다.
[[["이해하기 쉬움","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\u003eCloud Endpoints Frameworks provides API management features, including an API gateway that handles authentication and other checks before routing requests to the API backend, similar to the Extensible Service Proxy (ESP).\u003c/p\u003e\n"],["\u003cp\u003eEndpoints Frameworks offers API management features such as monitoring, logging, quotas, and a developer portal, all accessible through the Google Cloud console's Endpoints Services page.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize API management with Endpoints, you must deploy an OpenAPI document (version 2.0) that defines your API.\u003c/p\u003e\n"],["\u003cp\u003eAdding API management involves configuring build files (Maven or Gradle), setting the Google Cloud project ID, adding servlet filter configurations in \u003ccode\u003eweb.xml\u003c/code\u003e, and modifying dependencies and the build configuration.\u003c/p\u003e\n"],["\u003cp\u003eAfter building the API and generating the OpenAPI document, you have to deploy it and redeploy the application, to then view the API metrics in the Google Cloud console.\u003c/p\u003e\n"]]],[],null,["# Adding API management\n\nCloud Endpoints Frameworks provides API management features that are comparable to\nthe features that the\n[Extensible Service Proxy (ESP)](/endpoints/docs/frameworks/glossary#extensible_service_proxy)\nprovides for Cloud Endpoints. Endpoints Frameworks includes a\nbuilt-in\n[API gateway](https://en.wikipedia.org/wiki/API_management)\nthat intercepts all requests and performs any necessary checks, such as\nauthentication, before forwarding the request to the API backend. When the backend\nresponds, Endpoints Frameworks gathers and reports telemetry. You can\nview metrics for your API on the **Endpoints** \\\u003e **Services** page in the\nGoogle Cloud console.\n\nThe API management features available in Endpoints Frameworks include:\n\n- [Monitoring](/endpoints/docs/frameworks/monitoring-your-api)\n- [Logging](/endpoints/docs/frameworks/monitoring-your-api#logs)\n- [Quotas](/endpoints/docs/openapi/quotas-overview)\n- [Developer portal](/endpoints/docs/openapi/dev-portal-overview)\n\nFor your API to be managed by Endpoints, you must deploy\nan OpenAPI document that describes your API using version 2.0 of the\n[OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md).\nThis page describes how to generate and deploy an OpenAPI document that\nenables Endpoints to manage your API.\n\nIf you don't add API management, your API still serves requests, but your\nAPI doesn't appear on the **Endpoints** \\\u003e **Services** page in the\nGoogle Cloud console, and the functionality provided by\nEndpoints, such as logging, monitoring, and setting quotas, isn't\navailable.\n\nTo add API management to your API:\n\n1. Set up your Maven `pom.xml` file or your Gradle `build.gradle` file as\n described in\n [Configuring the build files](/endpoints/docs/frameworks/java/set-up-environment#configuring_the_build_files).\n\n2. Make sure that you set the Google Cloud project ID in the\n build files.\n\n ### Maven\n\n Search for `\u003cendpoints.project.id\u003e`, and replace\n \u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e with your\n Google Cloud project ID. For example:\n\n `\u003cendpoints.project.id\u003eexample-project-12345\u003c/endpoints.project.id\u003e`\n\n\n \u003cendpoints.project.id\u003eYOUR_PROJECT_ID\u003c/endpoints.project.id\u003e\n\n \u003cbr /\u003e\n\n ### Gradle\n\n 1. Search for `def projectId`, and replace \u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e with your Google Cloud project ID. For example:\n\n `def projectId = 'example-project-12345'`\n 2. Make sure your `build.gradle` file contains the `replaceProjectId` task, which sets the project ID in the `appengine-web.xml` and `web.xml` files.\n\n\n task replaceProjectId(type: Copy) {\n from 'src/main/webapp/WEB-INF/'\n include '*.xml'\n into \"build/exploded-${archivesBaseName}/WEB-INF\"\n expand(endpoints:[project:[id:projectId]])\n filteringCharset = 'UTF-8'\n }\n\n \u003cbr /\u003e\n\n3. In your API project's `web.xml` file, add the API management servlet filter\n configuration:\n\n \u003c!-- Add a filter that fetches the service config from service management. --\u003e\n \u003cfilter\u003e\n \u003cfilter-name\u003eendpoints-api-configuration\u003c/filter-name\u003e\n \u003cfilter-class\u003ecom.google.api.control.ServiceManagementConfigFilter\u003c/filter-class\u003e\n \u003c/filter\u003e\n\n \u003c!-- Add a filter that performs Endpoints logging and monitoring. --\u003e\n \u003cfilter\u003e\n \u003cfilter-name\u003eendpoints-api-controller\u003c/filter-name\u003e\n \u003cfilter-class\u003ecom.google.api.control.extensions.appengine.GoogleAppEngineControlFilter\u003c/filter-class\u003e\n \u003cinit-param\u003e\n \u003cparam-name\u003eendpoints.projectId\u003c/param-name\u003e\n \u003cparam-value\u003e${endpoints.project.id}\u003c/param-value\u003e\n \u003c/init-param\u003e\n \u003cinit-param\u003e\n \u003cparam-name\u003eendpoints.serviceName\u003c/param-name\u003e\n \u003cparam-value\u003e${endpoints.project.id}.appspot.com\u003c/param-value\u003e\n \u003c/init-param\u003e\n \u003c/filter\u003e\n\n \u003cfilter-mapping\u003e\n \u003cfilter-name\u003eendpoints-api-configuration\u003c/filter-name\u003e\n \u003cservlet-name\u003eEndpointsServlet\u003c/servlet-name\u003e\n \u003c/filter-mapping\u003e\n\n \u003cfilter-mapping\u003e\n \u003cfilter-name\u003eendpoints-api-controller\u003c/filter-name\u003e\n \u003cservlet-name\u003eEndpointsServlet\u003c/servlet-name\u003e\n \u003c/filter-mapping\u003e\n\n4. Modify your API project's build configuration:\n\n ### Maven\n\n 1. Add the API management dependencies:\n\n \u003cdependency\u003e\n \u003cgroupId\u003ecom.google.endpoints\u003c/groupId\u003e\n \u003cartifactId\u003eendpoints-management-control-appengine-all\u003c/artifactId\u003e\n \u003cversion\u003e1.0.14\u003c/version\u003e\n \u003c/dependency\u003e\n\n 2. Include the plugin that you can use to generate client libraries\n and the OpenAPI document, `openapi.json`:\n\n \u003cplugin\u003e\n \u003cgroupId\u003ecom.google.cloud.tools\u003c/groupId\u003e\n \u003cartifactId\u003eendpoints-framework-maven-plugin\u003c/artifactId\u003e\n \u003cversion\u003e2.1.0\u003c/version\u003e\n \u003cconfiguration\u003e\n \u003c!-- plugin configuration --\u003e\n \u003chostname\u003e${endpoints.project.id}.appspot.com\u003c/hostname\u003e\n \u003c/configuration\u003e\n \u003c/plugin\u003e\n\n ### Gradle\n\n 1. Add the API management dependencies:\n\n compile 'com.google.endpoints:endpoints-management-control-appengine:1.0.14'\n compile 'com.google.endpoints:endpoints-framework-auth:1.0.14'\n\n 2. Declare the external dependency so that the plugin is\n retrieved from Maven Central:\n\n classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:2.1.0'\n\n 3. Use the server-side Endpoints Frameworks Gradle plugin,\n which generates the OpenAPI document:\n\n apply plugin: 'com.google.cloud.tools.endpoints-framework-server'\n\n 4. Configure the name of your Endpoints service:\n\n endpointsServer {\n // Endpoints Framework Plugin server-side configuration\n hostname = \"${projectId}.appspot.com\"\n }\n\n5. After modifying dependencies, clean your project and then build your API:\n\n ### Maven\n\n ```bash\n mvn clean\n mvn package\n ```\n\n ### Gradle\n\n ```bash\n gradle clean\n gradle build\n ```\n6. Generate the OpenAPI document, `openapi.json`:\n\n ### Maven\n\n ```bash\n mvn endpoints-framework:openApiDocs\n ```\n\n ### Gradle\n\n ```bash\n gradle endpointsOpenApiDocs\n ```\n7. Deploy the OpenAPI document:\n\n gcloud endpoints services deploy openapi.json\n\n The first time you deploy `openapi.json`, a new Endpoints\n service is created with the name\n \u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e`.appspot.com`. On\n successful completion, a line similar to the following displays\n the service configuration ID and the service name:\n\n \u003cbr /\u003e\n\n ```\n Service Configuration 2017-02-13r0 uploaded for service example-project-12345.appspot.com\n ```\n\n In the preceding example, `2017-02-13r0` is the service configuration\n ID. The service configuration ID consists of a date stamp followed by a\n revision number. If you deploy `openapi.json` again, the revision number is\n incremented in the service configuration ID.\n\n If you need to display the service configuration ID again, run the following\n command, but replace \u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e with the\n project ID of your Google Cloud project: \n\n ```\n gcloud endpoints configs list --service=YOUR_PROJECT_ID.appspot.com\n ```\n\n You can create your own OpenAPI document and deploy it, rather than\n using a generated one. Simply replace `openapi.json` above with the path to\n your OpenAPI document. For more information on writing an OpenAPI document,\n see\n [OpenAPI overview](/endpoints/docs/openapi/openapi-overview).\n8. Edit your `appengine-web.xml` file to set the value for an environment\n variable:\n\n \u003cenv-variables\u003e\n \u003cenv-var name=\"ENDPOINTS_SERVICE_NAME\" value=\"${endpoints.project.id}.appspot.com\" /\u003e\n \u003c/env-variables\u003e\n\n Replace `${endpoints.project.id}` with your Google Cloud project ID.\n For example: \n\n \u003cenv-var name=\"ENDPOINTS_SERVICE_NAME\" value=\"example-project-12345.appspot.com\" /\u003e\n\n9. Redeploy your application.\n\n \u003cbr /\u003e\n\n ### Maven\n\n ```java\n mvn appengine:deploy\n ```\n\n ### Gradle\n\n ```java\n gradle appengineDeploy\n ```\n\n \u003cbr /\u003e\n\n10. Test your API by making some requests to it.\n\n11. To\n [view your API metrics](/endpoints/docs/frameworks/monitoring-your-api),\n open the **Endpoints** \\\u003e **Services** page in the Google Cloud console for your project: \n\n\n [Go to the Endpoints Services page](https://console.cloud.google.com/endpoints)\n\n \u003cbr /\u003e"]]