-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkoi_v3_node_api.yaml
184 lines (177 loc) · 4.33 KB
/
koi_v3_node_api.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
openapi: 3.0.0
info:
title: KOI Node Network API
description: API for coordinating communication across KOI nodes
version: 1.0.0
tags:
- name: sensor
description: endpoints for sensor nodes to implement (communication with coordinator and downstream nodes)
- name: coordinator
description: endpoints for coordinator nodes to implement (communication with sensors and processors)
- name: processor
description: endpoints for processor nodes to implement (communication with coordinator)
paths:
/sensors:
get:
summary: Retrieve sensor information
tags:
- coordinator
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
additionalProperties:
type: string
example:
rid_context1: sensor_url1
rid_context2: sensor_url2
post:
summary: Register a new sensor with the coordinator
tags:
- coordinator
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Sensor"
responses:
"200":
description: Success
/events/publish:
post:
summary: Publish an event to be brokered by the coordinator
tags:
- coordinator
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Event"
responses:
"200":
description: Success
/events/subscribe:
post:
summary: Subscribe to RID events
tags:
- coordinator
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
url:
type: string
responses:
"200":
description: Success
/events/receive:
post:
summary: Called by coordinator to send events to subscribed nodes
tags:
- processor
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Event"
responses:
"200":
description: Success
/rids:
get:
summary: Retrieve all known RIDs from the node
tags:
- coordinator
- sensor
responses:
"200":
description: Success
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/RID"
/object:
get:
summary: Retrieve dereferenced data associated with an RID
tags:
- sensor
parameters:
- in: query
name: rid
schema:
$ref: "#/components/schemas/RID"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
manifest:
$ref: "#/components/schemas/Manifest"
data:
type: object
components:
schemas:
RID:
type: string
format: rid
example: "orn:slack.message:TA2E6KPK3/C07BKQX0EVC/1721669683.087619"
Manifest:
type: object
properties:
rid:
$ref: "#/components/schemas/RID"
timestamp:
type: string
format: date-time
sha256_hash:
type: string
required:
- rid
- timestamp
- sha256_hash
Event:
type: object
properties:
rid:
$ref: "#/components/schemas/RID"
manifest:
$ref: "#/components/schemas/Manifest"
event_type:
enum:
- "NEW"
- "UPDATE"
- "FORGET"
type: string
required:
- rid
- event_type
Sensor:
type: object
properties:
url:
type: string
contexts:
type: array
items:
type: string
example:
- "https"
- "orn:slack.message"
- "orn:hackmd.note"
required:
- url
- contexts