-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasyncapi.yaml
149 lines (149 loc) · 4.19 KB
/
asyncapi.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
asyncapi: 2.2.0
info:
title: MQTT API
version: 1.0.0
description: "MQTT description"
license:
name: Apache 2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0'
servers:
production:
url: 'broker.emqx.io'
protocol: mqtt
description: Broker used
defaultContentType: application/json
channels:
'SmartCoffeeMachineMQTT/coffee-order-request':
publish:
message:
$ref: '#/components/messages/coffee-order-request'
'SmartCoffeeMachineMQTT/heartbeat':
publish:
message:
$ref: '#/components/messages/heartbeat'
'SmartCoffeeMachineMQTT/available-recipes':
publish:
message:
$ref: '#/components/messages/available-recipes'
'SmartCoffeeMachineMQTT/coffee-order-log':
publish:
message:
$ref: '#/components/messages/coffee-order-log'
components:
messages:
coffee-order-request:
name: Coffee Order Request
title: Coffee Order Request
summary: >-
Request a particular coffee machine to make a coffee.
contentType: application/json
payload:
$ref: '#/components/schemas/coffeeOrderPayload'
heartbeat:
name: Heartbeat
title: Heartbeat
summary: >-
Heartbeat informing the server that the app is running.
contentType: application/json
payload:
$ref: '#/components/schemas/heartbeatPayload'
available-recipes:
name: List of available recipes
title: List of available recipes
summary: >-
List of available recipes.
contentType: application/json
payload:
$ref: '#/components/schemas/availableRecipesPayload'
coffee-order-log:
name: Coffee Order Log
title: Coffee Order Log
summary: >-
Send details to the server about each order made by a coffee machine.
contentType: application/json
payload:
$ref: '#/components/schemas/coffeeOrderLogPayload'
schemas:
coffeeOrderPayload:
type: object
properties:
recipient-machine-id:
type: string
description: ID of the machine the request is for.
coffee-name:
type: string
description: name of the coffee.
machineLevelsPayload:
type: object
properties:
coffee_mg_level:
type: integer
description: Level of coffee.
milk_mg_level:
type: integer
description: Level of coffee.
sugar_mg_level:
type: integer
description: Level of coffee.
water_mg_level:
type: integer
description: Level of coffee.
coffeeOrderLogPayload:
type: object
properties:
machine-id:
type: string
description: ID of the machine to which the order was made.
coffee-name:
type: string
description: name of the coffee that was ordered.
success:
type: boolean
description: if the order was successful or not.
machine_levels:
$ref: '#/components/schemas/machineLevelsPayload'
description: levels of the machine
heartbeatPayload:
type: object
properties:
status:
type: string
description: Status of the machine.
id_machine:
type: string
description: id of the machine.
machine_levels:
$ref: '#/components/schemas/machineLevelsPayload'
description: levels of the machine
recipePayload:
type: object
properties:
drink_name:
type: string
description: drink_name.
drink_description:
type: string
description: drink_description.
coffee_mg:
type: string
description: coffee_mg.
milk_mg:
type: string
description: milk_mg.
water_mg:
type: string
description: water_mg.
sugar_mg:
type: string
description: sugar_mg.
milk_foam:
type: boolean
description: milk_foam.
availableRecipesPayload:
type: object
properties:
recipes:
type: array
description: list of recipes
items:
$ref: '#/components/schemas/recipePayload'