New Google Cloud Endpoints

On August 25th I’ve got email from Google Cloud Platform inviting me to fill out survey regarding Google Cloud Endpoints. It took me approximately one hour, since I used that time to dig deeper and collect all my wisdom and experience, frustration and kindly fill out survey :)

Current situation

Then I look at Endpoints issues and noticed there are 63 issues all in status Acknowledged or Accepted (no Closed in Progress or similar). So I acknowledged situation and continued with life.

I was even more surprised to read blog post regardingGoogle Cloud Endpointspublished on September 1st. Just few days after survey they managed to fix and improve everything :)?

 

If somebody asked you few days ago what Google Cloud Endpoints are you would say something like: “Google Cloud Endpoints is library to create APIs and deploy them in Google App Engine and possibility to generate client libraries for iOS, Android or use JavaScript client in web browser." These Google Cloud Endpoints are based on Discovery format, i.e. it’s the same way how Google manages its public APIs, you can see more examples here https://developers.google.com/apis-explorer/

 

New Google Cloud Endpoints

New Google Cloud Endpoints (currently in beta) are built on previous version but my initial feeling is that it has not much to do with previous version. I feel (emphasizing word feel) they totally redone Endpoints Service with much bigger functionality and yet kept old version usable, although now old endpoints are just tiny part of this new offering.

Most notable changes:

  • Use of Google Service Control & Management to see request logs, request frequency, latency, error ratio. In old version, everything was integrated in Google App Engine, now it is as separe service. Using Google Service has some other (good) consequences, see next points.
  • In main menu of Google Cloud Console under Tools, there is new submenu Endpoints where you can view info/graphs. 
  • Possibility to deploy APIs on Google Compute Engine and also Google Container Engine (and of course Google App Engine both Standard and Flexible Environment)
  • Handling of authentication from Google, Auth0, Firebase, validating API keys or custom
  • Support for OpenAPI. OpenAPI is initiative to create standard of how REST API are described. It’s build based on Swagger project (http://swagger.io). In brief, you describe your APIs in YAML or JSON (although first is more readable) and implement API methods. With Google App Engine swagger.yaml file is deployed automatically, in Google Compute Engine it needs to be deployed separately. There are many possibilities to generate both server and clients in different languages so with this language/frameworks supports gets bigger.
  • Reduced latency with hacks that only Google can do :) 
  • Yes, custom domains!!! #1 feature request for Endpoints since beggining of the service

 

I am using “old” Endpoints what’s here for me?

Good thing is that there is possibility to convert old endpoints definitions both from Python and Java endpoints framework (I’ve tried both, but Python version didn’t work for me with provided examples) to Swagger definition and deploy. When you deploy new version of endpoints, you can still use Discovery service and API Explorer, so there should be no changes. You should checkout following documents:

Migrating Python

https://cloud.google.com/appengine/docs/python/endpoints/migrating

Migrating Java

https://cloud.google.com/appengine/docs/java/endpoints/migrating

You should read carefully what is working there and what not (most notably iOS client doesn't work with new endpoints which are migrated from old ones)
 
Quickstart examples are on github:
 
Like I wrote conversion from old to new endpoints didn't work for me in Python, it feels that this is still beta where some things (code, documentation) are not synced. Nevertheless, we can look forward to create API on Google Cloud Platform and wonder what pricing will be for this service when it gets out of beta.
 
blog comments powered by Disqus