From e725d766b8f8a7d88f15261d8486a48041b46201 Mon Sep 17 00:00:00 2001 From: Sai Cheemalapati Date: Wed, 17 Aug 2016 11:59:07 -0700 Subject: [PATCH 1/2] Add basic README --- .../endpoints-frameworks-v2/backend/README.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 appengine/standard/endpoints-frameworks-v2/backend/README.md diff --git a/appengine/standard/endpoints-frameworks-v2/backend/README.md b/appengine/standard/endpoints-frameworks-v2/backend/README.md new file mode 100644 index 000000000000..794c729d7ff7 --- /dev/null +++ b/appengine/standard/endpoints-frameworks-v2/backend/README.md @@ -0,0 +1,38 @@ +## Endpoints Frameworks v2 Python Sample + +This demonstrates how to use Google Cloud Endpoints Frameworks v2 on Google App Engine Standard Environment using Python. + +This sample consists of two parts: + +1. The backend +2. The clients + +## Running Locally + +For more info on running Standard applications locally, see [the getting started documentation](https://cloud.google.com/appengine/docs/python/quickstart). + +Install the Endpoints Frameworks v2 library into a vendor directory: + + $ pip install -t lib TODO + +Run the application: + + $ dev_appserver.py app.yaml + +In your web browser, go to the following address: http://localhost:8080/\_ah/api/explorer + +## Deploying to Google App Engine + +Generate a swagger file by running: `endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com` + +To set up OAuth2, replace `your-oauth-client-id.com` under the `x-security` section in `echo-v1_swagger.json` with your OAuth2 client ID. If you want to use Google OAuth2 Playground, use `407408718192.apps.googleusercontent.com` as your audience. To generate a JWT, go to the following address: `https://developers.google.com/oauthplayground`. + +Deploy the generated swagger spec to Google Cloud Service Management: `gcloud alpha service-management deploy echo-v1_swagger.json` + +Open the `app.yaml` file and in the `env_variables` section, replace `your-service.appspot.com` with your service name, and `2016-08-01r0` with your uploaded service management configuration. + +Then, deploy the sample using `gcloud`: + + $ gcloud beta app deploy + +Once deployed, you can access the application at https://your-service.appspot.com From 5879b2a3cb8e4f63519bb74dc66ffd5fcc9939aa Mon Sep 17 00:00:00 2001 From: Sai Cheemalapati Date: Wed, 17 Aug 2016 15:36:36 -0700 Subject: [PATCH 2/2] Add vendor instructions and replace TODO --- .../standard/endpoints-frameworks-v2/backend/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/appengine/standard/endpoints-frameworks-v2/backend/README.md b/appengine/standard/endpoints-frameworks-v2/backend/README.md index 794c729d7ff7..5a8ad9264b40 100644 --- a/appengine/standard/endpoints-frameworks-v2/backend/README.md +++ b/appengine/standard/endpoints-frameworks-v2/backend/README.md @@ -11,9 +11,12 @@ This sample consists of two parts: For more info on running Standard applications locally, see [the getting started documentation](https://cloud.google.com/appengine/docs/python/quickstart). -Install the Endpoints Frameworks v2 library into a vendor directory: +Create a `lib` directory in which to install the Endpoints Frameworks v2 library. For more info, see [Installing a library](https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27#installing_a_library). - $ pip install -t lib TODO +Install the Endpoints Frameworks v2 library: + + $ mkdir lib + $ pip install -t lib google-endpoints Run the application: