From f14f8e80ff374a26ef7c3b454058365062dff432 Mon Sep 17 00:00:00 2001 From: Wesley Wong Date: Tue, 2 May 2017 11:50:41 -0700 Subject: [PATCH] Updates the Endpoints getting-started sample. Adds the same updates in the comments in https://github.com/GoogleCloudPlatform/java-docs-samples/pull/627. Also fixes the variables to replace in app.yaml. --- endpoints/getting-started/openapi.yaml | 49 ++++++++++++------- endpoints/getting-started/pom.xml | 29 +++++------ .../src/main/appengine/app.yaml | 18 ++++++- .../src/main/docker/Dockerfile | 14 ++++++ .../src/main/appengine/app.yaml | 4 +- 5 files changed, 79 insertions(+), 35 deletions(-) diff --git a/endpoints/getting-started/openapi.yaml b/endpoints/getting-started/openapi.yaml index 74c94107996..cf88c724a5a 100644 --- a/endpoints/getting-started/openapi.yaml +++ b/endpoints/getting-started/openapi.yaml @@ -1,3 +1,17 @@ +# Copyright 2015 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # [START swagger] swagger: "2.0" info: @@ -8,60 +22,61 @@ host: "echo-api.endpoints.YOUR-PROJECT-ID.cloud.goog" # [END swagger] basePath: "/" consumes: -- "application/json" + - "application/json" produces: -- "application/json" + - "application/json" schemes: -- "https" + - "https" paths: "/echo": post: description: "Echo back a given message." operationId: "echo" produces: - - "application/json" + - "application/json" responses: 200: description: "Echo" schema: $ref: "#/definitions/echoMessage" parameters: - - description: "Message to echo" - in: body - name: message - required: true - schema: - $ref: "#/definitions/echoMessage" + - + description: "Message to echo" + in: body + name: message + required: true + schema: + $ref: "#/definitions/echoMessage" security: - - api_key: [] + - api_key: [] "/auth/info/googlejwt": get: description: "Returns the requests' authentication information." operationId: "auth_info_google_jwt" produces: - - "application/json" + - "application/json" responses: 200: description: "Authenication info." schema: $ref: "#/definitions/authInfoResponse" security: - - api_key: [] - - google_jwt: [] + - api_key: [] + - google_jwt: [] "/auth/info/googleidtoken": get: description: "Returns the requests' authentication information." operationId: "authInfoGoogleIdToken" produces: - - "application/json" + - "application/json" responses: 200: description: "Authenication info." schema: $ref: "#/definitions/authInfoResponse" security: - - api_key: [] - - google_id_token: [] + - api_key: [] + - google_id_token: [] definitions: echoMessage: properties: diff --git a/endpoints/getting-started/pom.xml b/endpoints/getting-started/pom.xml index b218c552163..3b5f70bc5ae 100644 --- a/endpoints/getting-started/pom.xml +++ b/endpoints/getting-started/pom.xml @@ -1,4 +1,18 @@ - + @@ -48,11 +62,6 @@ ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - com.google.appengine - gcloud-maven-plugin - 2.0.9.121.v20160815 - com.google.cloud.tools appengine-maven-plugin @@ -60,14 +69,6 @@ - - org.apache.maven.plugins - maven-war-plugin - ${maven.war.plugin} - - false - - org.eclipse.jetty jetty-maven-plugin diff --git a/endpoints/getting-started/src/main/appengine/app.yaml b/endpoints/getting-started/src/main/appengine/app.yaml index 92e2637bc03..6e3f1d36d49 100644 --- a/endpoints/getting-started/src/main/appengine/app.yaml +++ b/endpoints/getting-started/src/main/appengine/app.yaml @@ -1,3 +1,17 @@ +# Copyright 2015 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + runtime: custom env: flex @@ -9,5 +23,5 @@ handlers: endpoints_api_service: # The following values are to be replaced by information from the output of # 'gcloud service-management deploy openapi.yaml' command. - name: ENDPOINTS SERVICE-NAME - config_id: ENDPOINTS CONFIG-ID + name: ENDPOINTS-SERVICE-NAME + config_id: ENDPOINTS-CONFIG-ID diff --git a/endpoints/getting-started/src/main/docker/Dockerfile b/endpoints/getting-started/src/main/docker/Dockerfile index a049a90f511..382823d7577 100644 --- a/endpoints/getting-started/src/main/docker/Dockerfile +++ b/endpoints/getting-started/src/main/docker/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2015 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM gcr.io/google_appengine/jetty9 ADD endpoints-1.0-SNAPSHOT.war $JETTY_BASE/webapps/root.war diff --git a/endpoints/multiple-versions/src/main/appengine/app.yaml b/endpoints/multiple-versions/src/main/appengine/app.yaml index 338b043bcba..c3ef15b1780 100644 --- a/endpoints/multiple-versions/src/main/appengine/app.yaml +++ b/endpoints/multiple-versions/src/main/appengine/app.yaml @@ -23,5 +23,5 @@ handlers: endpoints_api_service: # The following values are to be replaced by information from the output of # 'gcloud service-management deploy openapi-v1.yaml openapi-v2.yaml' command. - name: ENDPOINTS SERVICE-NAME - config_id: ENDPOINTS CONFIG-ID + name: ENDPOINTS-SERVICE-NAME + config_id: ENDPOINTS-CONFIG-ID