UNPKG

11.3 kBJSONView Raw
1{
2 "title": "Runtime protocol",
3 "description": "When a client connects to a FBP procotol it may choose to discover the capabilities and other information about the runtime.",
4 "input": {
5 "getruntime": {
6 "id": "input/getruntime",
7 "description": "Request the information about the runtime. When receiving this message the runtime should response with a runtime message. If the runtime is currently running a graph and it is able to speak the full Runtime protocol, it should follow up with a ports message.",
8 "allOf": [
9 {
10 "$ref": "/shared/message"
11 },
12 {
13 "properties": {
14 "protocol": {
15 "enum": [
16 "runtime"
17 ]
18 },
19 "command": {
20 "enum": [
21 "getruntime"
22 ]
23 },
24 "payload": {
25 "required": [],
26 "properties": {
27 "secret": {
28 "type": "string",
29 "description": "access token to authorize user"
30 }
31 }
32 }
33 }
34 }
35 ]
36 },
37 "packet": {
38 "id": "input/packet",
39 "description": "Runtimes that can be used as remote subgraphs (i.e. ones that have reported supporting the protocol:runtime capability) need to be able to receive and transmit information packets at their exposed ports.\nThese packets can be send from the client to the runtimes input ports, or from runtimes output ports to the client.",
40 "allOf": [
41 {
42 "$ref": "/shared/message"
43 },
44 {
45 "properties": {
46 "protocol": {
47 "enum": [
48 "runtime"
49 ]
50 },
51 "command": {
52 "enum": [
53 "packet"
54 ]
55 },
56 "payload": {
57 "required": [
58 "port",
59 "event",
60 "graph"
61 ],
62 "additionalProperties": false,
63 "properties": {
64 "port": {
65 "type": "string",
66 "description": "port name for the input or output port"
67 },
68 "event": {
69 "type": "string",
70 "enum": [
71 "connect",
72 "begingroup",
73 "data",
74 "endgroup",
75 "disconnect"
76 ],
77 "description": "packet event"
78 },
79 "type": {
80 "type": "string",
81 "description": "The basic datatype sent",
82 "example": "array"
83 },
84 "schema": {
85 "type": "string",
86 "format": "uri",
87 "description": "Link to JSON schema describing the format of the data",
88 "example": "https://example.net/schemas/person.json"
89 },
90 "graph": {
91 "type": "string",
92 "description": "graph the action targets"
93 },
94 "payload": {
95 "description": "payload for the packet. Used only with begingroup (for group names) and data packets"
96 },
97 "secret": {
98 "type": "string",
99 "description": "access token to authorize user"
100 }
101 }
102 }
103 }
104 }
105 ]
106 }
107 },
108 "output": {
109 "error": {
110 "id": "output/error",
111 "description": "Error response to a command on runtime protocol",
112 "allOf": [
113 {
114 "$ref": "/shared/message"
115 },
116 {
117 "properties": {
118 "protocol": {
119 "enum": [
120 "runtime"
121 ]
122 },
123 "command": {
124 "enum": [
125 "error"
126 ]
127 },
128 "payload": {
129 "required": [
130 "message"
131 ],
132 "properties": {
133 "message": {
134 "type": "string",
135 "description": "Error message describing what went wrong"
136 }
137 }
138 }
139 }
140 }
141 ]
142 },
143 "ports": {
144 "id": "output/ports",
145 "description": "Message sent by the runtime to signal its available ports. The runtime is responsible for sending the up-to-date list of available ports back to client whenever it changes.",
146 "allOf": [
147 {
148 "$ref": "/shared/message"
149 },
150 {
151 "properties": {
152 "protocol": {
153 "enum": [
154 "runtime"
155 ]
156 },
157 "command": {
158 "enum": [
159 "ports"
160 ]
161 },
162 "payload": {
163 "required": [
164 "graph",
165 "inPorts",
166 "outPorts"
167 ],
168 "additionalProperties": false,
169 "properties": {
170 "graph": {
171 "type": "string",
172 "description": "ID of the currently configured main graph running on the runtime"
173 },
174 "inPorts": {
175 "description": "list of input ports of the runtime",
176 "$ref": "/shared/port_definition"
177 },
178 "outPorts": {
179 "description": "list of output ports of the runtime",
180 "$ref": "/shared/port_definition"
181 }
182 }
183 }
184 }
185 }
186 ]
187 },
188 "runtime": {
189 "id": "output/runtime",
190 "description": "Response from the runtime to the getruntime request.",
191 "allOf": [
192 {
193 "$ref": "/shared/message"
194 },
195 {
196 "properties": {
197 "protocol": {
198 "enum": [
199 "runtime"
200 ]
201 },
202 "command": {
203 "enum": [
204 "runtime"
205 ]
206 },
207 "payload": {
208 "required": [
209 "version",
210 "capabilities",
211 "type"
212 ],
213 "additionalProperties": false,
214 "properties": {
215 "id": {
216 "type": "string",
217 "description": "unique runtime ID. Must be a UUID, version 4",
218 "example": "f18a4924-9d4f-414d-a37c-cd24b39bba10"
219 },
220 "label": {
221 "description": "Human-readable description of the runtime",
222 "type": "string"
223 },
224 "version": {
225 "description": "version of the runtime protocol that the runtime supports",
226 "type": "string",
227 "example": "0.6"
228 },
229 "allCapabilities": {
230 "description": "<a href='#capabilities'>capability strings</a> for things the runtime is able to do. May include things not permitted for this client.",
231 "$ref": "/shared/capabilities"
232 },
233 "capabilities": {
234 "description": "<a href='#capabilities'>capability strings</a> for things the runtime is able to do for this client.",
235 "$ref": "/shared/capabilities"
236 },
237 "graph": {
238 "description": "ID of the currently configured main graph running on the runtime, if any",
239 "type": "string",
240 "example": "service-main"
241 },
242 "type": {
243 "description": "type of the runtime",
244 "type": "string",
245 "example": "microflo"
246 },
247 "namespace": {
248 "description": "Library namespace of the project running on the runtime, if any. Must match that of components belonging to the (top-level) of project.",
249 "type": "string",
250 "example": "my-project-foo"
251 },
252 "repository": {
253 "description": "Source-code repository URL of the project running on the runtime, if any",
254 "type": "string",
255 "example": "https://github.com/flowbased/fbp-protocol.git"
256 },
257 "repositoryVersion": {
258 "description": "Unique version identifier of the source code of the project, if known. The version should be available in @repository.",
259 "type": "string",
260 "example": "0.6.3-8-g90edcfc"
261 }
262 }
263 }
264 }
265 }
266 ]
267 },
268 "packetsent": {
269 "id": "output/packetsent",
270 "description": "Confirmation that a packet has been sent",
271 "allOf": [
272 {
273 "$ref": "/shared/message"
274 },
275 {
276 "properties": {
277 "protocol": {
278 "enum": [
279 "runtime"
280 ]
281 },
282 "command": {
283 "enum": [
284 "packetsent"
285 ]
286 },
287 "payload": {
288 "required": [
289 "port",
290 "event",
291 "graph"
292 ],
293 "additionalProperties": false,
294 "properties": {
295 "port": {
296 "type": "string",
297 "description": "port name for the input port"
298 },
299 "event": {
300 "type": "string",
301 "enum": [
302 "connect",
303 "begingroup",
304 "data",
305 "endgroup",
306 "disconnect"
307 ],
308 "description": "packet event"
309 },
310 "type": {
311 "type": "string",
312 "description": "The basic datatype sent",
313 "example": "array"
314 },
315 "schema": {
316 "type": "string",
317 "format": "uri",
318 "description": "Link to JSON schema describing the format of the data",
319 "example": "https://example.net/schemas/person.json"
320 },
321 "graph": {
322 "type": "string",
323 "description": "graph the action targeted"
324 },
325 "payload": {
326 "description": "payload for the packet. Used only with begingroup (for group names) and data packets"
327 }
328 }
329 }
330 }
331 }
332 ]
333 },
334 "packet": {
335 "id": "output/packet",
336 "description": "Runtimes that can be used as remote subgraphs (i.e. ones that have reported supporting the protocol:runtime capability) need to be able to receive and transmit information packets at their exposed ports.\nThese packets can be send from the client to the runtimes input ports, or from runtimes output ports to the client.",
337 "$ref": "../input/packet"
338 }
339 }
340}
\No newline at end of file