Cloud Endpoints Frameworks

Cloud Endpoints Frameworks is a web framework for the App Engine standard Python 2.7 and Java 8 runtime environments. Cloud Endpoints Frameworks provides the tools and libraries that allow you to generate REST APIs and client libraries for your application.

Like other web frameworks, Endpoints Frameworks handles the low-level communication details of HTTP requests and responses for your application. When a client sends a request to your API, Endpoints Frameworks routes the request's URL to the function or method in your code that processes the request. Endpoints Frameworks converts the return value to JSON and sends the response. You add metadata (by using annotations in Java and decorators in Python) to your source code. The metadata defines the surface of the REST APIs for your application.

Java

@ApiMethod(name = "echo")
public Message echo(Message message, @Named("n") @Nullable Integer n) {
  return doEcho(message, n);
}

In the example code, the annotations begin with the @ character.

Python

@endpoints.method(
    # This method takes a ResourceContainer defined above.
    ECHO_RESOURCE,
    # This method returns an Echo message.
    EchoResponse,
    path='echo',
    http_method='POST',
    name='echo')
def echo(self, request):
    output_message = ' '.join([request.message] * request.n)
    return EchoResponse(message=output_message)

In the example code, the decorators begin with the @ character.

With Endpoints Frameworks, you don't have to deploy a third-party web server (such as Apache Tomcat or Gunicorn) with your application. You annotate or decorate the code and deploy your application as you normally would to the App Engine standard environment.

API management

The Extensible Service Proxy (ESP) provides API management features for Endpoints for OpenAPI and Endpoints for gRPC. ESP runs in a container alongside each instance of your backend.

Because the App Engine standard environment didn't support multi-container deployments when Endpoints Frameworks version 2 was under development, Endpoints Frameworks doesn't use ESP. Instead, Endpoints Frameworks includes a built-in API gateway that provides API management features that are comparable to the features that ESP provides for Endpoints for OpenAPI and Endpoints for gRPC.

Endpoints Frameworks 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 GCP Console.

You can use Endpoints Frameworks with or without API management functionality. Use of Endpoints Frameworks without API management functionality is offered at no charge. API management functionality is charged according to the Endpoints pricing page.

Limitations

  • Endpoints Frameworks is supported only on the App Engine standard Python 2.7 and Java 8 runtime environments.
  • Endpoints Frameworks doesn't support the Node.js, PHP, and Go runtime environments on the App Engine standard environment.
  • Endpoints Frameworks doesn't support the App Engine flexible environment.
  • Endpoints Frameworks doesn't support Cloud Functions, Compute Engine, and Google Kubernetes Engine.

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Endpoints Frameworks for App Engine
Need help? Visit our support page.