-
Notifications
You must be signed in to change notification settings - Fork 10
/
openapi.yaml
92 lines (92 loc) · 2.74 KB
/
openapi.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
openapi: 3.0.1
info:
title: order-app
version: '1.0'
servers:
- url: /Dev
paths:
/orders:
get:
x-amazon-apigateway-integration:
credentials:
Fn::GetAtt:
- ApiGwExecutionRole
- Arn
type: aws_proxy
httpMethod: POST
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetOrders}/invocations
passthroughBehavior: when_no_match
post:
summary: create a new order
description: "place an order message onto sqs queue for processing"
responses:
"200":
description: create order request successfully handled
"400":
description: Bad request
"500":
description: Server Error
x-amazon-apigateway-integration:
type: aws
credentials:
Fn::GetAtt:
- ApiGwExecutionRole
- Arn
httpMethod: POST
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:sqs:path/${AWS::AccountId}/${OrderQueueName}
requestParameters:
integration.request.header.Content-Type: "'application/x-www-form-urlencoded'"
requestTemplates:
application/json: "Action=SendMessage&MessageBody={\"data\":$input.json('$')}"
responses:
default:
statusCode: "200"
passthroughBehavior: "NEVER"
/orders/{orderId+}:
get:
x-amazon-apigateway-integration:
credentials:
Fn::GetAtt:
- ApiGwExecutionRole
- Arn
type: "aws_proxy"
httpMethod: POST
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetSingleOrder}/invocations
passthroughBehavior: "when_no_match"
put:
parameters:
- name: "orderId"
in: "path"
required: true
schema:
type: "string"
x-amazon-apigateway-integration:
credentials:
Fn::GetAtt: [ ApiGwExecutionRole, Arn ]
httpMethod: POST
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${UpdateOrder}/invocations
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_match"
type: "aws_proxy"
delete:
parameters:
- name: "orderId"
in: "path"
required: true
schema:
type: "string"
x-amazon-apigateway-integration:
credentials:
Fn::GetAtt: [ ApiGwExecutionRole, Arn ]
type: "aws_proxy"
httpMethod: "POST"
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DeleteOrder}/invocations
passthroughBehavior: "when_no_match"
components: {}