-
Notifications
You must be signed in to change notification settings - Fork 0
/
PhotoCollectionApi.yaml
210 lines (210 loc) · 7.32 KB
/
PhotoCollectionApi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
---
swagger: "2.0"
info:
version: "2019-04-17T18:59:57Z"
title: "PhotoCollection"
host: "xxxxxx.execute-api.us-east-1.amazonaws.com"
basePath: "/v1"
schemes:
- "https"
paths:
/bucket/{item}:
post:
produces:
- "application/json"
parameters:
- name: "Content-Type"
in: "header"
required: true
type: "string"
- name: "item"
in: "path"
required: true
type: "string"
responses:
200:
description: "200 response"
schema:
$ref: "#/definitions/Empty"
security:
- api_key: []
x-amazon-apigateway-request-validator: "Validar corpo, parâmetros de string\
\ de consulta e cabeçalhos"
x-amazon-apigateway-integration:
credentials: "arn:aws:iam::xxxxxxx:role/"
uri: "arn:aws:apigateway:us-east-1:s3:path/xxxxlabsphotocolletion/{item}"
responses:
default:
statusCode: "200"
responseTemplates:
application/json: "{\"messagem\":\"Envio com sucesso\"}"
requestParameters:
integration.request.path.item: "method.request.path.item"
passthroughBehavior: "when_no_match"
httpMethod: "PUT"
contentHandling: "CONVERT_TO_BINARY"
type: "aws"
delete:
produces:
- "application/json"
parameters:
- name: "item"
in: "path"
required: true
type: "string"
responses:
200:
description: "200 response"
schema:
$ref: "#/definitions/Empty"
security:
- api_key: []
x-amazon-apigateway-integration:
credentials: "arn:aws:iam::xxxxxx:role/"
uri: "arn:aws:apigateway:us-east-1:s3:path/xxxlabsphotocolletion/{item}"
responses:
default:
statusCode: "200"
responseTemplates:
application/json: "{\"messagem\":\"Arquivo deletado\"}"
requestParameters:
integration.request.path.item: "method.request.path.item"
passthroughBehavior: "when_no_match"
httpMethod: "DELETE"
type: "aws"
/photo:
get:
consumes:
- "application/json"
produces:
- "text/html"
responses:
200:
description: "200 response"
headers:
Content-Type:
type: "string"
x-amazon-apigateway-integration:
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Content-Type: "'text/html'"
responseTemplates:
text/html: "<html>\r\n <head>\r\n <style>\r\n body\
\ {\r\n color: #333;\r\n font-family: Sans-serif;\r\
\n max-width: 800px;\r\n margin: auto;\r\n \
\ }\r\n </style>\r\n </head>\r\n <body>\r\n \
\ <h1>Photo Collection API</h1>\r\n <p>\r\n \
\ A API Photo Collection contem os seguintes recursos:\r\n \
\ </p>\r\n <p> \r\n Consulta pelo ID da photo.\
\ Metodo <code>GET</code> <code>/photo/{id}</code>\r\n </p>\r\
\n <pre>\r\n Exemplo:\r\n <code>photo/1</code>\r\
\n </pre> \r\n <p> \r\n Consulta pelo ASSUNTO\
\ da photo. Metodo <code>GET</code> <code>/photo/assunto</code>\r\n\
\ </p>\r\n <pre>\r\n Exemplo:\r\n \
\ <code>photo/assunto?nome=batman</code>\r\n </pre> \r\n\
\ <p>\r\n Consulta por ASSUNTO e COLECAO. Metodo\
\ <code>GET</code> <code>/photo/consulta</code>\r\n </p>\r\n\
\ <pre>\r\n Exemplo:\r\n <code>/photo/consulta?assunto=batman&colecao=dc</code>\
\ \r\n </pre>\r\n </body>\r\n</html>"
passthroughBehavior: "when_no_match"
requestTemplates:
application/json: "{\"statusCode\": 200}"
type: "mock"
/photo/assunto:
get:
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "200 response"
schema:
$ref: "#/definitions/Empty"
x-amazon-apigateway-integration:
credentials: "arn:aws:iam::xxxxxx:role/"
uri: "arn:aws:apigateway:us-east-1:dynamodb:action/Scan"
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_templates"
httpMethod: "POST"
requestTemplates:
application/json: "{ \n \"TableName\" : \"PhotoColletion\", \n \"\
ProjectionExpression\" : \"id, descricao, colecao\",\n \"FilterExpression\"\
\ : \"assunto = :v1\",\n \"ExpressionAttributeValues\" : {\n \
\ \":v1\" : { \"S\" : \"$input.params('nome')\" }\n }\n }"
type: "aws"
/photo/consulta:
get:
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "200 response"
schema:
$ref: "#/definitions/Empty"
x-amazon-apigateway-integration:
credentials: "arn:aws:iam::xxxxxx:role/"
uri: "arn:aws:apigateway:us-east-1:dynamodb:action/Scan"
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_templates"
httpMethod: "POST"
requestTemplates:
application/json: " {\r\n \"TableName\" : \"PhotoColletion\",\r\n \"ProjectionExpression\"\
\ : \"id, descricao, colecao\",\r\n \"FilterExpression\" : \"assunto\
\ = :v1 AND colecao = :v2\",\r\n \"ExpressionAttributeValues\" : {\r\
\n \":v1\" : { \"S\" : \"$input.params('assunto')\" },\r\n \":v2\"\
\ : { \"S\" : \"$input.params('colecao')\" }\r\n }\r\n}"
type: "aws"
/photo/{id}:
get:
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
required: true
type: "string"
responses:
200:
description: "200 response"
schema:
$ref: "#/definitions/Empty"
x-amazon-apigateway-integration:
credentials: "arn:aws:iam::xxxxxx:role/"
uri: "arn:aws:apigateway:us-east-1:dynamodb:action/Scan"
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_templates"
httpMethod: "POST"
requestTemplates:
application/json: "{ \n \"TableName\" : \"PhotoColletion\", \n \"\
FilterExpression\" : \"id = :v1\",\n \"ExpressionAttributeValues\"\
\ : {\n \":v1\" : { \"N\" : \"$input.params('id')\" }\n }\n \
\ }"
type: "aws"
securityDefinitions:
api_key:
type: "apiKey"
name: "x-api-key"
in: "header"
definitions:
Empty:
type: "object"
title: "Empty Schema"
x-amazon-apigateway-request-validators:
Validar corpo, parâmetros de string de consulta e cabeçalhos:
validateRequestParameters: true
validateRequestBody: true
x-amazon-apigateway-binary-media-types:
- "image/jpeg"