-
Notifications
You must be signed in to change notification settings - Fork 16
/
openapi.yaml
464 lines (463 loc) · 14.3 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
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
openapi: 3.0.0
info:
title: Swagger ESP Thread Border Router REST API
description: |-
This describes the ESP Thread Border Router REST API. The API is provided by ot_task_br_web if the cmake flag `CONFIG_OPENTHREAD_BR_START_WEB=y` is set. By default
the REST API listens on any address on port 80.
Some useful links:
- [ESP Thread Rorder Router](https://github.com/espressif/esp-thread-br)
license:
name: Apache
url: https://github.com/espressif/esp-thread-br/blob/main/LICENSE
version: 1.0.0
servers:
- url: http://localhost:80
tags:
- name: node
description: Thread parameters of this node.
- name: diagnostics
description: Thread network diagnostic.
paths:
/diagnostics:
get:
tags:
- diagnostics
summary: Get Thread network diagnostics
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: object
/node:
get:
tags:
- node
summary: Get current active node parameters
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: object
delete:
tags:
- node
summary: Erase all persistent information, essentially factory reset the Border Router.
responses:
"200":
description: Successful operation
"409":
description: Thread interface is in wrong state.
/node/ba-id:
get:
tags:
- node
summary: Get the border agent ID
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: string
description: 16 byte border agent ID as hex string.
example: "AA897CA8A67F6E6DD6166133AD1562A5"
/node/rloc:
get:
tags:
- node
summary: Routing Locator IPv6 address of this Thread node.
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: string
description: RLOC IPv6 address
example: "fda4:728e:4b39:bc4a:0:ff:fe00:1000"
/node/rloc16:
get:
tags:
- node
summary: Routing Locator Router and Child ID (RLOC16).
description: Last 16-bit of the Routing Locator IPv6 consisting of the Router ID and a Child ID.
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: number
description: RLOC16 address
example: 4096
/node/ext-address:
get:
tags:
- node
summary: IEEE 802.15.4 Extended Address (EUI-64).
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: string
description: 8-byte IEEE 802.15.4 Extended Address of this node as hex string.
example: "C21F906BE0352A4C"
/node/state:
get:
tags:
- node
summary: Get current Thread state.
description: |-
State describing the current Thread role of this Thread node.
- disabled: The Thread stack is disabled.
- detached: Not currently participating in a Thread network/partition.
- child: The Thread Child role.
- router: The Thread Router role.
- leader: The Thread Leader role.
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: string
description: Current state
example: "leader"
put:
tags:
- node
summary: Set current Thread state.
description: |-
Enable and disable the Thread protocol operation. If network interface
hasn't been started yet, it will get started automatically.
responses:
"200":
description: Successful operation.
requestBody:
description: New Thread state
content:
application/json:
schema:
type: string
description: Can be "enable" or "disable".
example: "enable"
/node/network-name:
get:
tags:
- node
summary: Thread network name this node is part of.
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: string
description: Thread network name.
example: "OpenThread-e445"
/node/leader-data:
get:
tags:
- node
summary: Gets the network's leader data.
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/LeaderData"
/node/ext-panid:
get:
tags:
- node
summary: Extended PAN ID.
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: string
description: 8-byte extended PAN ID as hex string.
example: "3CAB144450CF407E"
/node/num-of-router:
get:
tags:
- node
summary: Get number of router devices
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: number
description: Number of routers
example: 1
/node/dataset/active:
get:
tags:
- node
summary: Get current active operational dataset
responses:
"200":
description: Returns currently active operational dataset
content:
application/json:
schema:
$ref: "#/components/schemas/ActiveDataset"
text/plain:
schema:
$ref: "#/components/schemas/DatasetTlv"
"204":
description: No active operational dataset
put:
tags:
- node
summary: Creates or updates the active operational dataset
description: |-
Creates or updates the the active operational dataset on the current node. Only allowed if the Thread node
is inactive. If the Thread node is active, a pending dataset should be used to update the current active
operational dataset.
requestBody:
description: |-
Operational dataset that will be stored as active operational dataset. Supports request body Content-Type
`text/plain` (dataset in TLV format as hex string) or `application/json` (dataset in JSON format). In both
cases keys which are not set will be initialized with defaults.
content:
application/json:
schema:
$ref: "#/components/schemas/ActiveDataset"
plain/text:
schema:
$ref: "#/components/schemas/DatasetTlv"
responses:
"200":
description: Successfully updated the active operational dataset.
"201":
description: Successfully created the active operational dataset.
"400":
description: Invalid request body.
"409":
description: Writing active operational dataset rejected because Thread network is active.
/node/dataset/pending:
get:
tags:
- node
summary: Get current pending operational dataset
responses:
"200":
description: Returns currently pending operational dataset
content:
application/json:
schema:
$ref: "#/components/schemas/PendingDataset"
text/plain:
schema:
$ref: "#/components/schemas/DatasetTlv"
"204":
description: No pending operational dataset
put:
tags:
- node
summary: Creates or updates the pending operational dataset
description: |-
Creates or updates the the pending operational dataset on the current node. Delay needs to be set to let
the pending dataset apply as active dataset in the near future.
requestBody:
description: |-
Operational dataset that will be stored as pending operational dataset. Supports request body Content-Type
`text/plain` (dataset in TLV format as hex string) or `application/json` (dataset in JSON format). In both
cases keys which are not set will be initialized with defaults.
content:
application/json:
schema:
$ref: "#/components/schemas/PendingDataset"
text/plain:
schema:
$ref: "#/components/schemas/DatasetTlv"
responses:
"200":
description: Successfully updated the pending operational dataset.
"201":
description: Successfully created the pending operational dataset.
"400":
description: Invalid request body.
components:
schemas:
LeaderData:
type: object
properties:
PartitionId:
type: number
format: uint32
description: Partition ID
example: 1230046604
Weighting:
type: number
format: uint8
description: Leader Weight
example: 64
DataVersion:
type: number
description: Full network data version
example: 244
StableDataVersion:
type: number
format: uint8
description: Stable Network Data Version
example: 186
LeaderRouterId:
type: number
format: uint8
description: Leader Router ID
example: 4
ActiveDataset:
type: object
properties:
ActiveTimestamp:
$ref: "#/components/schemas/Timestamp"
NetworkKey:
type: string
description: Network key, 16 bytes long, formatted as a hexadecimal string
example: 08277229F21FB7342D705D3CEFDC042A
default: random
NetworkName:
type: string
description: Network name, 16 bytes long
example: OpenThread-e445
default: OpenThread-<PanId>
ExtPanId:
type: string
description: Extended PAN ID, 8 bytes long, formatted as a hexadecimal string
example: 996D3BEE320097A3
default: random
MeshLocalPrefix:
type: string
description: Mesh local IPv6 prefix
example: fd33:d3b9:89e3:72e4::/64
default: random
PanId:
type: integer
description: IEEE 802.15.4 PAN ID of the Thread network
format: uint16
example: 58437
default: random
Channel:
type: integer
description: IEEE 802.15.4 channel of the Thread network
format: uint16
example: 21
default: random
PSKc:
type: string
description: The pre-shared commissioner key
example: FD943ECA225A28979B991EFAC1218A72
default: random
SecurityPolicy:
$ref: "#/components/schemas/SecurityPolicy"
ChannelMask:
type: integer
description: Channel mask
format: uint32
example: 134215680
default: 134215680
PendingDataset:
type: object
properties:
ActiveDataset:
oneOf:
- $ref: "#/components/schemas/ActiveDataset"
- $ref: "#/components/schemas/DatasetTlv"
PendingTimestamp:
$ref: "#/components/schemas/Timestamp"
Delay:
type: integer
description: Delay timer in milliseconds
format: uint32
example: 30000
default: not set
SecurityPolicy:
type: object
properties:
RotationTime:
type: integer
description: Thread key rotation time in hours
format: uint16
example: 672
default: 672
ObtainNetworkKey:
type: boolean
description: Obtaining the Network Key for out-of-band commissioning is enabled
example: true
default: true
NativeCommissioning:
type: boolean
description: Native Commissioning using PSKc is allowed
example: true
default: true
Routers:
type: boolean
description: Thread 1.0/1.1.x Routers are enabled
example: true
default: true
ExternalCommissioning:
type: boolean
description: External Commissioner authentication is allowed
example: true
default: true
CommercialCommissioning:
type: boolean
description: Commercial Commissioning is enabled
example: false
default: false
AutonomousEnrollment:
type: boolean
description: Autonomous Enrollment is enabled
example: false
default: false
NetworkKeyProvisioning:
type: boolean
description: Network Key Provisioning is enabled
example: false
default: false
TobleLink:
type: boolean
description: ToBLE link is enabled
example: false
default: false
NonCcmRouters:
type: boolean
description: Non-CCM Routers enabled
example: false
default: false
Timestamp:
type: object
properties:
Seconds:
type: integer
description: Timestamp seconds
format: uint64
example: 10
default: 1
Ticks:
type: integer
description: Timestamp ticks
format: uint16
example: 0
default: 0
Authoritative:
type: boolean
example: false
default: false
DatasetTlv:
type: string
description: Operational dataset as hex-encoded TLVs.
example: 0E080000000000010000000300000F35060004001FFFE0020811111111222222220708FDAD70BFE5AA15DD051000112233445566778899AABBCCDDEEFF030E4F70656E54687265616444656D6F010212340410445F2B5CA6F2A93A55CE570A70EFEECB0C0402A0F7F8