-
Notifications
You must be signed in to change notification settings - Fork 6
/
spec.yaml
219 lines (219 loc) · 6.2 KB
/
spec.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
211
212
213
214
215
216
217
218
219
swagger: '2.0'
info:
version: v1
title: Delegate Code Challenge 2019 API.
paths:
/api/sensors/geocode:
post:
tags:
- Geocode
summary: Looks up country code from Longitude and Latitude
operationId: CountryNamePostAsync
consumes:
- application/json-patch+json
- application/json
- text/json
- application/*+json
produces: []
parameters:
- name: body
in: body
description: Sensor identification and GPS position in Longitude and Latitude.
required: false
schema:
uniqueItems: false
type: array
items:
$ref: '#/definitions/GeocodePayload'
responses:
'200':
description: Success
schema:
uniqueItems: false
type: array
items:
type: string
/api/networkplanning/simulate:
post:
tags:
- NetworkPlanning
summary: 'Detects critical gateways in the network. A critial gateway is a gateway that, if missing, would leave devices unable to connect.'
operationId: NetworkPlanningPostAsync
consumes:
- application/json-patch+json
- application/json
- text/json
- application/*+json
produces: []
parameters:
- name: body
in: body
description: Graph containing verticies and edges of a LoRaWAN network topology.
required: false
schema:
$ref: '#/definitions/NetworkGraph'
responses:
'200':
description: Success
schema:
uniqueItems: false
type: array
items:
$ref: '#/definitions/Node'
/api/sensors/parse:
post:
tags:
- Sensor
summary: Decodes raw DigitalMatter SensorNode payloads.
description: 'Expects a list of raw SensorNode payloads, should output decoded and parsed sensor data.'
operationId: SensorsParsePostAsync
consumes:
- application/json-patch+json
- application/json
- text/json
- application/*+json
produces: []
parameters:
- name: body
in: body
description: IoT device payload and identification.
required: false
schema:
uniqueItems: false
type: array
items:
$ref: '#/definitions/SensorPayload'
responses:
'200':
description: Success
schema:
uniqueItems: false
type: array
items:
$ref: '#/definitions/SensorPayloadDecoded'
definitions:
GeocodePayload:
description: Geocode payload from the Digital Matter SensorNode.
type: object
properties:
long:
description: 'Longitude of the device, as a string.'
type: string
example: '12.484492'
lat:
description: 'DeviceLatitude of the device, as a string.'
type: string
example: '55.781619'
devEUI:
description: 'Device EUI, LoRaWAN devices have a 64 bit unique identifier (DevEUI) that is assigned to the device by the chip manufacturer.'
type: string
example: '1234'
time:
format: date-time
description: The time the sensor reading was recorded.
type: string
example: '2018-06-04T15:17:23.433+02:00'
NetworkGraph:
type: object
properties:
graphs:
uniqueItems: false
type: array
items:
$ref: '#/definitions/Graph'
Graph:
type: object
properties:
type:
type: string
label:
type: string
nodes:
uniqueItems: false
type: array
items:
$ref: '#/definitions/Node'
edges:
uniqueItems: false
type: array
items:
$ref: '#/definitions/Edge'
Node:
type: object
properties:
id:
type: string
label:
type: string
type:
type: string
Edge:
type: object
properties:
source:
type: string
target:
type: string
relation:
type: string
SensorPayload:
description: Sensor payload from the Digital Matter SensorNode.
type: object
properties:
fPort:
format: int32
description: The LoraWAN Port used for the reading. The first ID is given by the LoRaWAN Port.
type: integer
example: '43'
data:
description: 'A hexidecimal representation of the data payload, data sheet defines delimiting values and lengths of payloads. Little Endian.'
type: string
example: a2083714df12
devEUI:
description: 'Device EUI, LoRaWAN devices have a 64 bit unique identifier (DevEUI) that is assigned to the device by the chip manufacturer.'
type: string
example: '1234'
time:
format: date-time
description: The time the sensor reading was recorded.
type: string
example: '2018-06-04T15:17:23.433+02:00'
SensorPayloadDecoded:
description: Decoded sensor data from the Digital Matter SensorNode.
type: object
properties:
battery:
format: int32
description: Decoded battery value of port 20
type: integer
readOnly: true
tempInternal:
format: double
description: Decoded value of port 40
type: number
tempRed:
format: double
description: Decoded value of port 41
type: number
tempBlue:
format: double
description: Decoded value of port 42
type: number
tempHumidity:
format: double
description: Decoded temperature value of port 43
type: number
humidity:
format: double
description: Decoded humidity value of port 43
type: number
readOnly: true
devEUI:
description: 'Device EUI, LoRaWAN devices have a 64 bit unique identifier (DevEUI) that is assigned to the device by the chip manufacturer.'
type: string
example: '1234'
time:
format: date-time
description: The time the sensor reading was recorded.
type: string
example: '2018-06-04T15:17:23.433+02:00'