Cloud Endpoints

Prajwal Moon
5 min readJan 7, 2022

What are Cloud Endpoints? How does it work? What are its application? To know that first we need a basic knowledge about APIs.

Let’s talk about APIs. So, an Application programming interface (API) is a connection between computers or between computer programs. It’s a type of software interface that provides a service to other programs. An application programming interface connects computers or pieces of software to each other, as opposed to a user interface, which connects a computer to a person. An API is frequently composed of various components that serve as tools or services to the programmer. A programmer who employs one of these components is said to call that portion of the API. The API calls are also known as subroutines, methods, requests, or endpoints.

So there are different API Platforms like Maps Platform, API Analytics, API Monetization, Developer Portal, Apigee API Platform, Service Infrastructure, Apigee Sense and Cloud Endpoints (An NGINX-based proxy to deploy and manage APIs).

Cloud Endpoints

Google Cloud Endpoints is a Google solution.Endpoints is a distributed API management system. It provides an API console, hosting, logging, monitoring, and other features to help you create, share, maintain, and secure your APIs.

Developing a REST API with Endpoints for OpenAPI: Endpoints is language independent. You can manage and monitor your APIs on the Endpoints Services page in the Google Cloud Console. Endpoints uses Service Infrastructure to manage APIs and report logs and metrics. It lets you configure your API to require an API key for any call and validates the API key.

Endpoints also enable creating a web backend for web clients and mobile clients like Android or Apple’s iOS much easier.

Cloud endpoints components:

  • Extensible Service Proxy (ESP) or Extensible Service Proxy V2 (ESPv2) — for injecting Endpoints functionality.
  • Service Control — for applying API management rules.
  • Service Management — for configuring API management rules.
  • Cloud SDK — for deploying and management.
  • Google Cloud Console — for logging, monitoring and sharing.

a)ESP

ESP is an NGINX-based proxy that runs in front of the backend, providing Endpoints features like authentication, monitoring, and logging. ESP support platforms like

  • App Engine flexible environment
  • Compute Engine
  • Google Kubernetes Engine
  • Kubernetes

ESPv2

ESPv2 is an Envoy-based high-performance, scalable proxy that runs in front of an OpenAPI or gRPC API backend. ESPv2 supports version 2 of the OpenAPI Specification and gRPC Specifications. You can use it with:

  • App Engine standard environment
  • Compute Engine
  • Google Kubernetes Engine
  • Kubernetes
  • Cloud Run
  • Cloud Run for Anthos
  • Cloud Functions

b)Service Control

At runtime, Service Control applies API management rules such as key authentication, monitoring, and logging. The methods listed below are provided by Service Control.

  • Check — verifies authentication and API keys and determines whether a call should be allowed
  • Report — notifies the systems of record for logging and monitoring

c)Service Management

You use the OpenAPI specification to clarify the surface and behavior of your API. You deploy the Endpoints configuration to Service Management by using the Cloud SDK, which configures the API management rules. Other configuration related tasks also happen here, like sharing your API with other developers, enabling or disabling the API in numerous projects, and generating API keys.

d)The Cloud SDK

The gcloud command-line tool is that the primary CLI tool to make and manage Google Cloud resources. you’ll be able to use this tool to perform many common platform tasks either from the instruction or in scripts and other automations. We use gcloud the command-line tool to deploy your Endpoints configuration to Service Management.

e)Google Cloud Console

The Google Cloud Console provides a web-based, graphical interface that you just can use to manage your Google Cloud projects and resources. Endpoints uses the Cloud Console to show monitoring and logging data that are sent from ESP or ESPv2 and recorded by Service Control and share APIs with other developers, and for them to come up with API keys to call the API.

How do I use cloud endpoints?

To use Endpoints to manage an API, you deploy the API’s OpenAPI configuration file to Service Management. Endpoints uses the host field in the OpenAPI configuration file to identify the service. Endpoints requires the following Google services to be enabled: Service Management APIservicecontrol.googleapis.com. It takes several minutes to deploy the API to App Engine. In Cloud Shell, you can send requests to the API by running the following script:./query_api.sh. The output is:curl “https://example-project.appspot.com/airportName?iataCode=SFO". The API now has a limit of 5 requests per minute. You can use quotas to protect your API from excessive usage by a single client. This feature is covered by the Pre-GA Offerings Terms of the Google Cloud Terms of Service. For more information, see the launch stage descriptions.

What is difference between API and endpoint?

An API is a set of tools that allow two applications to communicate. An Endpoint is a URL that enables the API to access resources on a server, often through a RESTful API interface. These APIs operate through responses and requests — that is you make a request and the API makes a response.

A simple example of this is this particular Websites and article, and your browser makes a request for the content. The Websites is Medium, and your Web Browser makes a request for the content. The Endpoint is obtained by the browser making a GET request.

What are the specifications that cloud endpoints supports?

Endpoints supports version 2 of the OpenAPI Specification (formerly known as the Swagger spec) — the industry standard for defining REST APIs.
Supported compute platforms

  • App Engine flexible environment.
  • Compute Engine.
  • Kubernetes, including Google Kubernetes Engine.
  • A Linux or macOS computer or another platform.

Is cloud endpoints an API gateway?

Cloud Endpoints is an API management system that helps you secure, monitor, analyze, and set quotas on your APIs. Endpoints uses the Extensible Service Proxy (ESP) to host your OpenAPI specs. API Gateway supports the same OpenAPI spec definition format and options as Endpoints for OpenAPI. You can use the same security, quota, and other definitions from Endpoints to define an API in API Gateway. For Endpoints, you must first deploy ESP to be able to set the value of the host property.

The only difference between Endpoints and API Gateway is how they process the host property in the OpenAPI spec definition: In Endpoints, set the host property to the hostname portion of the URL created when you deployed ESP, where ESP is the service used to host your Endpoints API.

Cloud Endpoints is crucial part of cloud computing. We saw that Cloud Endpoints are built with a goal to manage all your APIs. Endpoints is API management gateway which helps you develop, deploy, and manage APIs on any Google Cloud backend.

--

--