我正在发现Python和Google App Engine。 我首先遵循了https://cloud.google.com/endpoints/docs/openapi/get-started-app-engine#python
上的官方教程“ App Engine灵活环境中的Cloud Endpoints入门”我从那里了解到,为了部署端点,我还需要部署名为openapi-appengine.yaml的配置文件。
所以现在我想使用Flask部署python API,我不知道如何自动生成提到的openapi-appengine.yaml文档。
我有一个带有空终结点方法的简单类
import googleapiclient
import logging
from tensorflow.python.lib.io import file_io
from flask import Flask, jsonify, request
from tensorflow import keras
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
import os
import json
from flask_cors import cross_origin
from six.moves import http_client
app = Flask(__name__)
@app.route('/predict',methods=['GET'])
def predict_json():
return null
# if __name__ == '__main__':
# # This is used when running locally. Gunicorn is used to run the
# # application on Google App Engine. See entrypoint in app.yaml.
# app.run(host='127.0.0.1', port=8080, debug=True)
# [END gae_flex_quickstart]
```