Skip to content

Commit

Permalink
Updates the Endpoints getting-started sample. (#642)
Browse files Browse the repository at this point in the history
Adds the same updates in the comments in
#627.

Also fixes the variables to replace in app.yaml.
  • Loading branch information
wmwong authored and dpebot committed May 3, 2017
1 parent dfb4142 commit 2d71e88
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 35 deletions.
49 changes: 32 additions & 17 deletions endpoints/getting-started/openapi.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
29 changes: 15 additions & 14 deletions endpoints/getting-started/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2016 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

Expand Down Expand Up @@ -48,26 +62,13 @@
<!-- for hot reload of the web application -->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin> <!-- TEMPORARY -->
<groupId>com.google.appengine</groupId>
<artifactId>gcloud-maven-plugin</artifactId>
<version>2.0.9.121.v20160815</version>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.maven.plugin}</version>
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven.war.plugin}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
Expand Down
18 changes: 16 additions & 2 deletions endpoints/getting-started/src/main/appengine/app.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
14 changes: 14 additions & 0 deletions endpoints/getting-started/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions endpoints/multiple-versions/src/main/appengine/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2d71e88

Please sign in to comment.