gRPC remote service or OpenAPI wrapper for python flask based service

871 views
Skip to first unread message

ton...@gmail.com

unread,
Mar 11, 2017, 7:40:41 PM3/11/17
to Google Cloud Endpoints
From the document, it seems like to create endpoints service API, I need to create gRPC remote service and decorated with OpenAPI doc properties. Is it the only way to create endpoint API.

I have an existing python flask based service with OpenAPI interface, using connexion library to load swagger.yaml to connect to simple flask services. I can deploy the swagger.yaml file and see the API show up in endpoint portal. My flask service API deploys successfully to standard app engine. But the endpoint API can't connect to my app engine service.

Is it possible to have endpoints API point to existing OpenAPI flask service?
Any suggestions to migrate existing OpenAPI flask service into endpoint without too much or rewrite the code?

Thanks,
Tong

ton...@gmail.com

unread,
Mar 12, 2017, 8:14:23 PM3/12/17
to Google Cloud Endpoints, ton...@gmail.com
I did a few more tests.

Here is what I found:
1. This is a simple flask based example to make endpoints API works: https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/endpoints/getting-started. I tested with my API, it works fine as long as I use flexible configuration
2. With no change in the code, if I switch the project to app engine standard configuration, it wouldn't work. And all standard examples are using gRPC.

Please confirm if app engine standard only supports gRPC or there are some special configuration I need to deal with.

Thanks,
Tong

Sepehr Ebrahimzadeh

unread,
Mar 15, 2017, 2:27:02 PM3/15/17
to Google Cloud Endpoints, ton...@gmail.com
Hi Tong, 
This sample is for a Python REST API (using OpenAPI spec) and can only be deployed to GCE/GKE/GAE Flex:

To use Endpoints to build a gRPC API, you'd need to run on GCE or GKE I'm afraid. Samples here:

On GCE/GKE/GAE Flex, Endpoints works with the Extensible Service Proxy architecture described here:

To use Endpoints on GAE Standard (for REST APIs), please see Endpoints Frameworks. Samples here:

Does that answer your high level question?

Thanks,
Sep

ton...@gmail.com

unread,
Mar 16, 2017, 12:17:05 AM3/16/17
to Google Cloud Endpoints, ton...@gmail.com
Hi Sep,

Thank you for the summary! Very helpful!

I also find this document (https://cloud.google.com/endpoints/docs/frameworks-extensible-service-proxy) is very helpful with the following key points:
  1. Cloud Endpoints Frameworks is the only way to get API management functionality (monitoring, logging, API keys, etc) on App Engine Standard.
  2. The separation provided by the proxy means the REST or gRPC backend can be written with any language and use any framework that supports description in OpenAPI Spec or with gRPC.

Tong
Reply all
Reply to author
Forward
0 new messages