A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/endpoints/docs/frameworks/java/adding-api-management below:

Adding API management | Cloud Endpoints Frameworks for App Engine

Skip to main content Adding API management

Stay organized with collections Save and categorize content based on your preferences.

Cloud Endpoints Frameworks provides API management features that are comparable to the features that the Extensible Service Proxy (ESP) provides for Cloud Endpoints. Endpoints Frameworks includes a built-in API gateway that intercepts all requests and performs any necessary checks, such as authentication, before forwarding the request to the API backend. When the backend responds, Endpoints Frameworks gathers and reports telemetry. You can view metrics for your API on the Endpoints > Services page in the Google Cloud console.

The API management features available in Endpoints Frameworks include:

For your API to be managed by Endpoints, you must deploy an OpenAPI document that describes your API using version 2.0 of the OpenAPI Specification. This page describes how to generate and deploy an OpenAPI document that enables Endpoints to manage your API.

If you don't add API management, your API still serves requests, but your API doesn't appear on the Endpoints > Services page in the Google Cloud console, and the functionality provided by Endpoints, such as logging, monitoring, and setting quotas, isn't available.

To add API management to your API:

  1. Set up your Maven pom.xml file or your Gradle build.gradle file as described in Configuring the build files.

  2. Make sure that you set the Google Cloud project ID in the build files.

    Maven

    Search for <endpoints.project.id>, and replace YOUR_PROJECT_ID with your Google Cloud project ID. For example:

    <endpoints.project.id>example-project-12345</endpoints.project.id>

    Gradle
    1. Search for def projectId, and replace YOUR_PROJECT_ID with your Google Cloud project ID. For example:

      def projectId = 'example-project-12345'

    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.
  3. In your API project's web.xml file, add the API management servlet filter configuration:

  4. Modify your API project's build configuration:

    Maven
    1. Add the API management dependencies:

    2. Include the plugin that you can use to generate client libraries and the OpenAPI document, openapi.json:

    Gradle
    1. Add the API management dependencies:

    2. Declare the external dependency so that the plugin is retrieved from Maven Central:

    3. Use the server-side Endpoints Frameworks Gradle plugin, which generates the OpenAPI document:

    4. Configure the name of your Endpoints service:

  5. After modifying dependencies, clean your project and then build your API:

    Maven
        mvn clean
        mvn package
    Gradle
        gradle clean
        gradle build
  6. Generate the OpenAPI document, openapi.json:

    Maven
    mvn endpoints-framework:openApiDocs
    Gradle
    gradle endpointsOpenApiDocs
  7. Deploy the OpenAPI document:

     gcloud endpoints services deploy openapi.json
    

    The first time you deploy openapi.json, a new Endpoints service is created with the name YOUR_PROJECT_ID.appspot.com. On successful completion, a line similar to the following displays the service configuration ID and the service name:

    Service Configuration 2017-02-13r0 uploaded for service example-project-12345.appspot.com
    

    In the preceding example, 2017-02-13r0 is the service configuration ID. The service configuration ID consists of a date stamp followed by a revision number. If you deploy openapi.json again, the revision number is incremented in the service configuration ID.

    If you need to display the service configuration ID again, run the following command, but replace YOUR_PROJECT_ID with the project ID of your Google Cloud project:

    gcloud endpoints configs list --service=YOUR_PROJECT_ID.appspot.com
    

    You can create your own OpenAPI document and deploy it, rather than using a generated one. Simply replace openapi.json above with the path to your OpenAPI document. For more information on writing an OpenAPI document, see OpenAPI overview.

  8. Edit your appengine-web.xml file to set the value for an environment variable:

    Replace ${endpoints.project.id} with your Google Cloud project ID. For example:

    <env-var name="ENDPOINTS_SERVICE_NAME" value="example-project-12345.appspot.com" />
    
  9. Redeploy your application.

    Maven
    mvn appengine:deploy
    Gradle
    gradle appengineDeploy
  10. Test your API by making some requests to it.

  11. To view your API metrics, open the Endpoints > Services page in the Google Cloud console for your project:

    Go to the Endpoints Services page

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["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-08-07 UTC."],[[["Cloud 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)."],["Endpoints 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."],["To utilize API management with Endpoints, you must deploy an OpenAPI document (version 2.0) that defines your API."],["Adding API management involves configuring build files (Maven or Gradle), setting the Google Cloud project ID, adding servlet filter configurations in `web.xml`, and modifying dependencies and the build configuration."],["After 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."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4