Skip to content

Commit f14f8e8

Browse files
committed
Updates the Endpoints getting-started sample.
Adds the same updates in the comments in #627. Also fixes the variables to replace in app.yaml.
1 parent 2182970 commit f14f8e8

File tree

5 files changed

+79
-35
lines changed

5 files changed

+79
-35
lines changed

endpoints/getting-started/openapi.yaml

+32-17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2015 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
# [START swagger]
216
swagger: "2.0"
317
info:
@@ -8,60 +22,61 @@ host: "echo-api.endpoints.YOUR-PROJECT-ID.cloud.goog"
822
# [END swagger]
923
basePath: "/"
1024
consumes:
11-
- "application/json"
25+
- "application/json"
1226
produces:
13-
- "application/json"
27+
- "application/json"
1428
schemes:
15-
- "https"
29+
- "https"
1630
paths:
1731
"/echo":
1832
post:
1933
description: "Echo back a given message."
2034
operationId: "echo"
2135
produces:
22-
- "application/json"
36+
- "application/json"
2337
responses:
2438
200:
2539
description: "Echo"
2640
schema:
2741
$ref: "#/definitions/echoMessage"
2842
parameters:
29-
- description: "Message to echo"
30-
in: body
31-
name: message
32-
required: true
33-
schema:
34-
$ref: "#/definitions/echoMessage"
43+
-
44+
description: "Message to echo"
45+
in: body
46+
name: message
47+
required: true
48+
schema:
49+
$ref: "#/definitions/echoMessage"
3550
security:
36-
- api_key: []
51+
- api_key: []
3752
"/auth/info/googlejwt":
3853
get:
3954
description: "Returns the requests' authentication information."
4055
operationId: "auth_info_google_jwt"
4156
produces:
42-
- "application/json"
57+
- "application/json"
4358
responses:
4459
200:
4560
description: "Authenication info."
4661
schema:
4762
$ref: "#/definitions/authInfoResponse"
4863
security:
49-
- api_key: []
50-
- google_jwt: []
64+
- api_key: []
65+
- google_jwt: []
5166
"/auth/info/googleidtoken":
5267
get:
5368
description: "Returns the requests' authentication information."
5469
operationId: "authInfoGoogleIdToken"
5570
produces:
56-
- "application/json"
71+
- "application/json"
5772
responses:
5873
200:
5974
description: "Authenication info."
6075
schema:
6176
$ref: "#/definitions/authInfoResponse"
6277
security:
63-
- api_key: []
64-
- google_id_token: []
78+
- api_key: []
79+
- google_id_token: []
6580
definitions:
6681
echoMessage:
6782
properties:

endpoints/getting-started/pom.xml

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<!--
2+
Copyright 2016 Google Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
216
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
317
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
418

@@ -48,26 +62,13 @@
4862
<!-- for hot reload of the web application -->
4963
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
5064
<plugins>
51-
<plugin> <!-- TEMPORARY -->
52-
<groupId>com.google.appengine</groupId>
53-
<artifactId>gcloud-maven-plugin</artifactId>
54-
<version>2.0.9.121.v20160815</version>
55-
</plugin>
5665
<plugin>
5766
<groupId>com.google.cloud.tools</groupId>
5867
<artifactId>appengine-maven-plugin</artifactId>
5968
<version>${appengine.maven.plugin}</version>
6069
<configuration>
6170
</configuration>
6271
</plugin>
63-
<plugin>
64-
<groupId>org.apache.maven.plugins</groupId>
65-
<artifactId>maven-war-plugin</artifactId>
66-
<version>${maven.war.plugin}</version>
67-
<configuration>
68-
<failOnMissingWebXml>false</failOnMissingWebXml>
69-
</configuration>
70-
</plugin>
7172
<plugin>
7273
<groupId>org.eclipse.jetty</groupId>
7374
<artifactId>jetty-maven-plugin</artifactId>

endpoints/getting-started/src/main/appengine/app.yaml

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2015 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
runtime: custom
216
env: flex
317

@@ -9,5 +23,5 @@ handlers:
923
endpoints_api_service:
1024
# The following values are to be replaced by information from the output of
1125
# 'gcloud service-management deploy openapi.yaml' command.
12-
name: ENDPOINTS SERVICE-NAME
13-
config_id: ENDPOINTS CONFIG-ID
26+
name: ENDPOINTS-SERVICE-NAME
27+
config_id: ENDPOINTS-CONFIG-ID

endpoints/getting-started/src/main/docker/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2015 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
FROM gcr.io/google_appengine/jetty9
216

317
ADD endpoints-1.0-SNAPSHOT.war $JETTY_BASE/webapps/root.war

endpoints/multiple-versions/src/main/appengine/app.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ handlers:
2323
endpoints_api_service:
2424
# The following values are to be replaced by information from the output of
2525
# 'gcloud service-management deploy openapi-v1.yaml openapi-v2.yaml' command.
26-
name: ENDPOINTS SERVICE-NAME
27-
config_id: ENDPOINTS CONFIG-ID
26+
name: ENDPOINTS-SERVICE-NAME
27+
config_id: ENDPOINTS-CONFIG-ID

0 commit comments

Comments
 (0)