Skip to content

Commit 54b7ba3

Browse files
docs(asyncapi): add events documentation with async api standard
1 parent 0451068 commit 54b7ba3

File tree

1 file changed

+268
-13
lines changed

1 file changed

+268
-13
lines changed

docs/asyncapi/asyncapi.yml

Lines changed: 268 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,279 @@
11
asyncapi: 2.6.0
2+
id: 'https://github.com/smartoperatingblock/dt-event-gateway'
3+
tags:
4+
- name: user
5+
- name: signup
6+
- name: register
27
info:
38
title: Digital Twins Event Gateway
49
version: 1.0.0
5-
description: The Gateway between Azure Digital Twins and the application microservices.
10+
description: |
11+
The Gateway between Azure Digital Twins and the application microservices.
12+
### Features:
13+
* Consume Digital Twins events from a SignalR topic
14+
* Send events to a Kafka event broker
15+
license:
16+
name: MIT
17+
url: https://opensource.org/license/mit/
18+
contact:
19+
name: API Support
20+
url: https://smartoperatingblock.github.io
21+
22+
23+
servers:
24+
production:
25+
url: http://broker:29092
26+
protocol: kafka
27+
description: The event broker
28+
29+
defaultContentType: application/json
630

731
channels:
8-
user/signedup:
32+
room-events:
33+
description: The topic on which room events are published and consumed.
34+
subscribe:
35+
summary: |
36+
Send room informations such as temperature, luminosity, humidity, etc.
37+
message:
38+
oneOf:
39+
- "$ref": '#/components/messages/temperatureEvent'
40+
- "$ref": "#/components/messages/humidityEvent"
41+
- "$ref": "#/components/messages/presenceEvent"
42+
- "$ref": "#/components/messages/luminosityEvent"
43+
44+
process-events:
45+
description: The topic on which process events are published and consumed.
46+
subscribe:
47+
summary: |
48+
Send all process events.
49+
message:
50+
oneOf:
51+
- "$ref": '#/components/messages/medicalDeviceUsageEvent'
52+
- "$ref": "#/components/messages/processInfoEvent"
53+
54+
tracking-events:
55+
description: The topic on which health professionals tracking events are published and consumed.
956
subscribe:
57+
summary: |
58+
Send the tracking event of a health professional within an operating block room.
1059
message:
11-
$ref: '#/components/messages/UserSignedUp'
60+
$ref: '#/components/messages/trackingEvent'
61+
1262
components:
1363
messages:
14-
UserSignedUp:
64+
temperatureEvent:
65+
name: temperatureEvent
66+
title: The Temperature Event
67+
summary: the event of change of temperature in a room.
68+
contentType: application/json
69+
payload:
70+
$ref: "#/components/schemas/temperatureEventPayload"
71+
humidityEvent:
72+
name: humidityEvent
73+
title: The Humidity Event
74+
summary: the event of change of humidity in a room.
75+
contentType: application/json
76+
payload:
77+
$ref: "#/components/schemas/humidityEventPayload"
78+
presenceEvent:
79+
name: luminosityEvent
80+
title: The Luminosity Event
81+
summary: the event of change of luminosity in a room.
82+
contentType: application/json
83+
payload:
84+
$ref: "#/components/schemas/luminosityEventPayload"
85+
luminosityEvent:
86+
name: presenceEvent
87+
title: The Presence Event
88+
summary: the event of presence detected in a room.
89+
contentType: application/json
1590
payload:
16-
type: object
17-
properties:
18-
displayName:
19-
type: string
20-
description: Name of the user
21-
email:
22-
type: string
23-
format: email
24-
description: Email of the user
91+
$ref: "#/components/schemas/presenceEventPayload"
92+
93+
medicalDeviceUsageEvent:
94+
name: medicalDeviceUsageEvent
95+
title: The Medical Device Usage Event
96+
summary: the event of usage of a implantable medical device in a process.
97+
contentType: application/json
98+
payload:
99+
$ref: "#/components/schemas/medicalDeviceUsageEventPayload"
100+
processInfoEvent:
101+
name: processInfoEvent
102+
title: The Process Informations Event
103+
summary: the event about some informations on process.
104+
contentType: application/json
105+
payload:
106+
$ref: "#/components/schemas/processInfoEventPayload"
107+
108+
trackingEvent:
109+
name: trackingEvent
110+
title: The Tracking Event
111+
summary: the event about health professionals tracking.
112+
contentType: application/json
113+
payload:
114+
$ref: "#/components/schemas/trackingEventPayload"
115+
116+
schemas:
117+
118+
temperatureEventPayload:
119+
type: object
120+
properties:
121+
key:
122+
type: string
123+
description: The key of the event.
124+
roomId:
125+
type: string
126+
description: The id of the room.
127+
data:
128+
type: object
129+
$ref: "#/components/schemas/temperature"
130+
dateTime:
131+
type: string
132+
description: the timestamp of the event.
133+
134+
humidityEventPayload:
135+
type: object
136+
properties:
137+
key:
138+
type: string
139+
description: The key of the event.
140+
roomId:
141+
type: string
142+
description: The id of the room.
143+
data:
144+
type: object
145+
$ref: "#/components/schemas/humidity"
146+
dateTime:
147+
type: string
148+
description: the timestamp of the event.
149+
150+
luminosityEventPayload:
151+
type: object
152+
properties:
153+
key:
154+
type: string
155+
description: The key of the event.
156+
roomId:
157+
type: string
158+
description: The id of the room.
159+
data:
160+
type: object
161+
$ref: "#/components/schemas/luminosity"
162+
dateTime:
163+
type: string
164+
description: the timestamp of the event.
165+
166+
presenceEventPayload:
167+
type: object
168+
properties:
169+
key:
170+
type: string
171+
description: The key of the event.
172+
roomId:
173+
type: string
174+
description: The id of the room.
175+
data:
176+
type: object
177+
$ref: "#/components/schemas/presence"
178+
dateTime:
179+
type: string
180+
description: the timestamp of the event.
181+
182+
medicalDeviceUsageEventPayload:
183+
type: object
184+
properties:
185+
key:
186+
type: string
187+
description: The key of the event.
188+
data:
189+
type: object
190+
$ref: "#/components/schemas/medicalDeviceUsage"
191+
dateTime:
192+
type: string
193+
description: the timestamp of the event.
194+
195+
processInfoEventPayload:
196+
type: object
197+
properties:
198+
key:
199+
type: string
200+
description: The key of the event.
201+
data:
202+
type: object
203+
$ref: "#/components/schemas/processInfo"
204+
dateTime:
205+
type: string
206+
description: the timestamp of the event.
207+
208+
trackingEventPayload:
209+
type: object
210+
properties:
211+
key:
212+
type: string
213+
description: The key of the event.
214+
healthProfessionalId:
215+
type: string
216+
description: The id of the health professional tracked.
217+
roomId:
218+
type: string
219+
description: The id of the room in which the health professional is tracked.
220+
data:
221+
type: boolean
222+
description: true if the health professional is tracked, false otherwise.
223+
dateTime:
224+
type: string
225+
description: the timestamp of the event.
226+
227+
temperature:
228+
type: object
229+
properties:
230+
temperatureValue:
231+
type: number
232+
description: The temperature value
233+
temperatureUnit:
234+
type: string
235+
description: the temperature measure unit
236+
237+
humidity:
238+
type: object
239+
properties:
240+
humidityPercentage:
241+
type: number
242+
description: The humidity percentage
243+
244+
luminosity:
245+
type: object
246+
properties:
247+
luminosityValue:
248+
type: number
249+
description: The luminosity value
250+
luminosityUnit:
251+
type: string
252+
description: the luminosity measure unit
253+
254+
presence:
255+
type: object
256+
properties:
257+
presenceDetected:
258+
type: boolean
259+
description: true if a presence is detected, false otherwise
260+
261+
medicalDeviceUsage:
262+
type: object
263+
properties:
264+
medicalDeviceID:
265+
type: string
266+
description: The id of the medical device.
267+
processId:
268+
type: string
269+
description: The id of the process.
270+
271+
processInfo:
272+
type: object
273+
properties:
274+
info:
275+
type: string
276+
description: The information about the process.
277+
processId:
278+
type: string
279+
description: The id of the process.

0 commit comments

Comments
 (0)