-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsensor-calibration-nats.asyncapi.yaml
More file actions
84 lines (76 loc) · 2.09 KB
/
Copy pathsensor-calibration-nats.asyncapi.yaml
File metadata and controls
84 lines (76 loc) · 2.09 KB
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
asyncapi: 3.0.0
info:
title: Sensor Calibration Events over NATS
version: 1.0.0
description: |
This AsyncAPI specification defines the calibration control and feedback
messages for sensors using NATS messaging protocol.
defaultContentType: application/json
servers:
natsBroker:
host: nats.example.com
protocol: nats
description: NATS broker for sensor calibration messaging
channels:
sensorCalibrate:
address: sensors.{sensorId}.calibrate
parameters:
sensorId:
description: The ID of the sensor to calibrate
location: $message.payload#/sensorId
messages:
calibrationCommand:
$ref: '#/components/messages/calibrationCommand'
sensorCalibrated:
address: sensors.{sensorId}.calibrated
parameters:
sensorId:
description: The ID of the sensor being confirmed
location: $message.payload#/sensorId
messages:
calibrationResult:
$ref: '#/components/messages/calibrationResponse'
operations:
sendCalibration:
action: send
channel:
$ref: '#/channels/sensorCalibrate'
messages:
- $ref: '#/channels/sensorCalibrate/messages/calibrationCommand'
receiveCalibration:
action: receive
channel:
$ref: '#/channels/sensorCalibrated'
messages:
- $ref: '#/channels/sensorCalibrated/messages/calibrationResult'
components:
messages:
calibrationCommand:
name: calibrationCommand
title: Calibration Command
contentType: application/json
headers:
type: object
properties:
correlationId:
type: string
payload:
type: object
required: [sensorId, calibrationLevel]
properties:
sensorId:
type: string
calibrationLevel:
type: integer
calibrationResponse:
name: calibrationResponse
title: Calibration Result
contentType: application/json
payload:
type: object
required: [sensorId, status]
properties:
sensorId:
type: string
status:
type: string