UNPKG

11.8 kBJSONView Raw
1{
2 "title": "Network protocol",
3 "description": "Protocol for starting and stopping FBP networks, and finding out about their state.",
4 "output": {
5 "stopped": {
6 "description": "Inform that a given network has stopped.",
7 "properties": {
8 "time": {
9 "type": "string",
10 "format": "date-time",
11 "description": "time when the network was stopped"
12 },
13 "uptime": {
14 "type": "string",
15 "format": "date-time",
16 "description": "time the network was running, in seconds"
17 },
18 "graph": {
19 "type": "string",
20 "description": "graph the action targets"
21 }
22 }
23 },
24 "started": {
25 "description": "Inform that a given network has been started.",
26 "properties": {
27 "time": {
28 "type": "string",
29 "format": "date-time",
30 "description": "time when the network was started"
31 },
32 "graph": {
33 "type": "string",
34 "description": "graph the action targets"
35 }
36 }
37 },
38 "status": {
39 "description": "Response to a getstatus message.",
40 "properties": {
41 "running": {
42 "type": "boolean",
43 "description": "boolean tells whether the network is running or not"
44 },
45 "graph": {
46 "type": "string",
47 "description": "graph the action targets"
48 },
49 "uptime": {
50 "type": "string",
51 "format": "date-time",
52 "description": "(optional) time the network has been running, in seconds"
53 }
54 }
55 },
56 "output": {
57 "description": "An output message from a running network, roughly similar to STDOUT output of a Unix process, or a line of console.log in JavaScript. Output can also be used for passing images from the runtime to the UI.",
58 "properties": {
59 "message": {
60 "type": "string",
61 "description": "contents of the output line"
62 },
63 "type": {
64 "type": "string",
65 "enum": [
66 "message",
67 "previewurl"
68 ],
69 "description": "(optional) type of output, either message or previewurl"
70 },
71 "url": {
72 "type": "string",
73 "format": "uri",
74 "description": "(optional) URL for an image generated by the runtime"
75 }
76 }
77 },
78 "error": {
79 "description": "An error from a running network, roughly similar to STDERR output of a Unix process, or a line of console.error in JavaScript.",
80 "properties": {
81 "message": {
82 "type": "any",
83 "description": "contents of the error message"
84 }
85 }
86 },
87 "icon": {
88 "description": "Icon of a component instance has changed.",
89 "properties": {
90 "id": {
91 "type": "string",
92 "description": "identifier of the node"
93 },
94 "icon": {
95 "type": "string",
96 "description": "new icon for the component instance"
97 },
98 "graph": {
99 "type": "string",
100 "description": "graph the action targets"
101 }
102 }
103 },
104 "connect": {
105 "description": "Beginning of transmission on an edge.",
106 "properties": {
107 "id": {
108 "type": "string",
109 "description": "textual edge identifier, usually in form of a FBP language line"
110 },
111 "src": {
112 "type": "object",
113 "description": "source node for the edge",
114 "properties": {
115 "node": {
116 "type": "string",
117 "description": "node identifier"
118 },
119 "port": {
120 "type": "string",
121 "description": "port name"
122 }
123 }
124 },
125 "tgt": {
126 "type": "object",
127 "description": "target node for the edge",
128 "properties": {
129 "node": {
130 "type": "string",
131 "description": "node identifier"
132 },
133 "port": {
134 "type": "string",
135 "description": "port name"
136 }
137 }
138 },
139 "graph": {
140 "type": "string",
141 "description": "graph the action targets"
142 },
143 "subgraph": {
144 "type": "string",
145 "description": "(optional): subgraph identifier for the event. An array of node IDs"
146 }
147 }
148 },
149 "begingroup": {
150 "description": "Beginning of a group (bracket IP) on an edge.",
151 "properties": {
152 "id": {
153 "type": "string",
154 "description": "textual edge identifier, usually in form of a FBP language line"
155 },
156 "src": {
157 "description": "source node for the edge",
158 "properties": {
159 "node": {
160 "type": "string",
161 "description": "node identifier"
162 },
163 "port": {
164 "type": "string",
165 "description": "port name"
166 }
167 }
168 },
169 "tgt": {
170 "description": "target node for the edge",
171 "properties": {
172 "node": {
173 "type": "string",
174 "description": "node identifier"
175 },
176 "port": {
177 "type": "string",
178 "description": "port name"
179 }
180 }
181 },
182 "group": {
183 "description": "group name",
184 "type": "string"
185 },
186 "graph": {
187 "type": "string",
188 "description": "graph the action targets"
189 },
190 "subgraph": {
191 "type": "array",
192 "description": "(optional): subgraph identifier for the event. An array of node IDs"
193 }
194 }
195 },
196 "data": {
197 "description": "Data transmission on an edge.",
198 "properties": {
199 "id": {
200 "type": "string",
201 "description": "textual edge identifier, usually in form of a FBP language line"
202 },
203 "src": {
204 "type": "object",
205 "description": "source node for the edge",
206 "properties": {
207 "node": {
208 "type": "string",
209 "description": "node identifier"
210 },
211 "port": {
212 "type": "string",
213 "description": "port name"
214 }
215 }
216 },
217 "tgt": {
218 "type": "object",
219 "description": "target node for the edge",
220 "properties": {
221 "node": {
222 "type": "string",
223 "description": "node identifier"
224 },
225 "port": {
226 "type": "string",
227 "description": "port name"
228 }
229 }
230 },
231 "data": {
232 "type": "any",
233 "description": "actual data being transmitted, encoded in a way that can be carried over the protocol transport"
234 },
235 "graph": {
236 "type": "string",
237 "description": "graph the action targets"
238 },
239 "subgraph": {
240 "type": "string",
241 "description": "(optional): subgraph identifier for the event. An array of node IDs"
242 }
243 }
244 },
245 "endgroup": {
246 "description": "Ending of a group (bracket IP) on an edge.",
247 "properties": {
248 "id": {
249 "type": "string",
250 "description": "textual edge identifier, usually in form of a FBP language line"
251 },
252 "src": {
253 "description": "source node for the edge",
254 "properties": {
255 "node": {
256 "type": "string",
257 "description": "node identifier"
258 },
259 "port": {
260 "type": "string",
261 "description": "port name"
262 }
263 }
264 },
265 "tgt": {
266 "description": "target node for the edge",
267 "properties": {
268 "node": {
269 "type": "string",
270 "description": "node identifier"
271 },
272 "port": {
273 "type": "string",
274 "description": "port name"
275 }
276 }
277 },
278 "group": {
279 "description": "group name",
280 "type": "string"
281 },
282 "graph": {
283 "description": "graph the action targets",
284 "type": "string"
285 },
286 "subgraph": {
287 "type": "array",
288 "description": "(optional): subgraph identifier for the event. An array of node IDs"
289 }
290 }
291 },
292 "disconnect": {
293 "description": "End of transmission on an edge.",
294 "properties": {
295 "id": {
296 "description": "textual edge identifier, usually in form of a FBP language line"
297 },
298 "src": {
299 "type": "object",
300 "description": "source node for the edge",
301 "properties": {
302 "node": {
303 "type": "string",
304 "description": "node identifier"
305 },
306 "port": {
307 "type": "string",
308 "description": "port name"
309 }
310 }
311 },
312 "tgt": {
313 "type": "object",
314 "description": "target node for the edge",
315 "properties": {
316 "node": {
317 "type": "string",
318 "description": "node identifier"
319 },
320 "port": {
321 "type": "string",
322 "description": "port name"
323 }
324 }
325 },
326 "graph": {
327 "type": "string",
328 "description": "graph the action targets"
329 },
330 "subgraph": {
331 "type": "string",
332 "description": "(optional): subgraph identifier for the event. An array of node IDs"
333 }
334 }
335 }
336 },
337 "input": {
338 "error": {
339 "description": "Network error"
340 },
341 "start": {
342 "description": "Start execution of a FBP network based on a given graph.",
343 "properties": {
344 "graph": {
345 "type": "string",
346 "description": "graph the action targets"
347 }
348 }
349 },
350 "getstatus": {
351 "description": "Get the current status of the runtime. The runtime should respond with a status message.",
352 "properties": {
353 "graph": {
354 "type": "string",
355 "description": "graph the action targets"
356 }
357 }
358 },
359 "stop": {
360 "description": "Stop execution of a FBP network based on a given graph.",
361 "properties": {
362 "graph": {
363 "type": "string",
364 "description": "graph the action targets"
365 }
366 }
367 },
368 "edges": {
369 "description": "List of edges user has selected for inspection in a user interface or debugger, sent from UI to a runtime.",
370 "edges": {
371 "type": "array",
372 "description": "list of selected edges, each containing",
373 "properties": {
374 "src": {
375 "type": "object",
376 "description": "source node for the edge",
377 "properties": {
378 "node": {
379 "type": "string",
380 "description": "node identifier"
381 },
382 "port": {
383 "type": "string",
384 "description": "port name"
385 }
386 }
387 },
388 "tgt": {
389 "type": "object",
390 "description": "target node for the edge",
391 "properties": {
392 "node": {
393 "type": "string",
394 "description": "node identifier"
395 },
396 "port": {
397 "type": "string",
398 "description": "port name"
399 },
400 "graph": {
401 "type": "string",
402 "description": "graph the action targets"
403 }
404 }
405 }
406 }
407 }
408 }
409 }
410}