Goby3 3.7.0
2026.11.12
Loading...
Searching...
No Matches
interface_tool_config.proto
Go to the documentation of this file.
1// Copyright 2026:
2// GobySoft, LLC (2013-)
3// Community contributors (see AUTHORS file)
4// File authors:
5// Toby Schneider <toby@gobysoft.org>
6//
7//
8// This file is part of the Goby Underwater Autonomy Project Binaries
9// ("The Goby Binaries").
10//
11// The Goby Binaries are free software: you can redistribute them and/or modify
12// them under the terms of the GNU General Public License as published by
13// the Free Software Foundation, either version 2 of the License, or
14// (at your option) any later version.
15//
16// The Goby Binaries are distributed in the hope that they will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with Goby. If not, see <http://www.gnu.org/licenses/>.
23syntax = "proto2";
24import "goby/middleware/protobuf/app_config.proto";
25import "goby/protobuf/option_extensions.proto";
26
27package goby.apps.middleware.protobuf;
28
29message InterfaceToolConfig
30{
31 option (goby.msg).cfg.tool = {
32 is_tool: true
33 has_subtools: true
34 has_help_action: true
35 };
36
37 optional goby.middleware.protobuf.AppConfig app = 1
38 [(goby.field) = { cfg { action: DEVELOPER } }];
39
40 enum Action
41 {
42 help = 0 [(goby.ev).cfg = {
43 short_help_msg: "Print usage information",
44 full_help_msg: "Usage: \"goby interface help [action]\"\n"
45 }];
46 visualize = 1 [(goby.ev).cfg = {
47 short_help_msg: "Draw a deployment's publish/subscribe graph (Graphviz or D2)"
48 }];
49 validate = 2 [(goby.ev).cfg = {
50 short_help_msg: "Check that every required subscription in a deployment has a publisher"
51 }];
52 list = 3 [(goby.ev).cfg = {
53 short_help_msg: "List a deployment's platforms, applications or groups"
54 }];
55 explain = 4 [(goby.ev).cfg = {
56 short_help_msg: "Show who publishes and subscribes to groups, and why a subscription is unmet"
57 }];
58 diff = 5 [(goby.ev).cfg = {
59 short_help_msg: "Compare the connections of two deployments, or of one against two sets of interface files"
60 }];
61 init = 6 [(goby.ev).cfg = {
62 short_help_msg: "Write a starter deployment file from a directory of interface files"
63 }];
64 launch = 7 [(goby.ev).cfg = {
65 short_help_msg: "Write goby_launch files from a deployment file"
66 }];
67 launch_check = 8 [(goby.ev).cfg = {
68 short_help_msg: "Compare a hand-written goby_launch file with a deployment file"
69 }];
70 systemd = 9 [(goby.ev).cfg = {
71 short_help_msg: "Write systemd units from a deployment file, or check installed ones"
72 }];
73 }
74 optional Action action = 2 [
75 default = help,
76 (goby.field) = {
77 description: "The action this tool should take [can omit --action if 1st parameter]",
78 cfg { position: { enable: true }, cli_short: "A", action: HIDDEN }
79 }
80 ];
81}
82
83message InterfaceVisualizeConfig
84{
85 option (goby.msg).cfg.tool = {
86 is_tool: true
87 has_subtools: false
88 has_help_action: false
89 };
90
91 optional goby.middleware.protobuf.AppConfig app = 1
92 [(goby.field) = { cfg { action: DEVELOPER } }];
93
94 required string deployment_file = 10 [(goby.field) = {
95 description: "Deployment file (deployment.yml), or a single interface file drawn as a one-platform deployment",
96 cfg { position: { enable: true } }
97 }];
98 optional string output_file = 11
99 [(goby.field).description = "Write the graph here instead of stdout"];
100
101 enum Format
102 {
103 DOT = 1;
104 D2 = 2;
105 }
106 optional Format format = 14 [
107 default = DOT,
108 (goby.field) = {
109 description: "Graphviz (render with dot) or D2 (render with d2, https://d2lang.com)"
110 }
111 ];
112 repeated string define = 12 [(goby.field) = {
113 description: "Set a variable used as ${NAME} in the deployment file, as NAME=value; overrides the environment",
114 cfg { cli_short: "D" }
115 }];
116 repeated string interface_dir = 13 [(goby.field) = {
117 description: "Search this directory for interface files, after the deployment file's own directory (also GOBY_INTERFACE_PATH, colon separated)",
118 cfg { cli_short: "I" }
119 }];
120
121 optional bool no_disconnected = 20 [
122 default = false,
123 (goby.field).description =
124 "Do not draw publications without subscribers or subscriptions without publishers (required subscriptions are always drawn)"
125 ];
126 optional bool omit_interthread = 21
127 [default = false, (goby.field).description = "Do not draw interthread connections"];
128 optional string omit_group_regex = 22
129 [(goby.field).description = "Do not draw groups matching this regex"];
130 optional string omit_node_regex = 23 [(goby.field).description =
131 "Do not draw platforms, modules, applications or "
132 "threads whose name matches this regex"];
133 optional bool include_terminate = 24
134 [default = false, (goby.field).description = "Draw goby_terminate groups"];
135 optional bool include_coroner = 25
136 [default = false, (goby.field).description = "Draw goby_coroner groups"];
137 optional bool include_all = 26 [
138 default = false,
139 (goby.field).description = "Draw every group, including Goby's internal ones"
140 ];
141 optional string splines = 27
142 [default = "ortho", (goby.field).description = "Graphviz splines= setting"];
143 optional bool expand_instances = 28 [
144 default = false,
145 (goby.field).description =
146 "Draw each of a platform's instances: separately, rather than once for all of them"
147 ];
148 optional bool expand_goby_apps = 29 [
149 default = false,
150 (goby.field).description =
151 "Draw Goby's own applications (gobyd, goby_*) with their threads, rather than as one box (gobyd folded into its module)"
152 ];
153}
154
155message InterfaceValidateConfig
156{
157 option (goby.msg).cfg.tool = {
158 is_tool: true
159 has_subtools: false
160 has_help_action: false
161 };
162
163 optional goby.middleware.protobuf.AppConfig app = 1
164 [(goby.field) = { cfg { action: DEVELOPER } }];
165
166 required string deployment_file = 10 [(goby.field) = {
167 description: "Deployment file (deployment.yml), or a single interface file checked as a one-platform deployment",
168 cfg { position: { enable: true } }
169 }];
170 optional string output_file = 11
171 [(goby.field).description = "Write the report here instead of stdout"];
172 repeated string define = 12 [(goby.field) = {
173 description: "Set a variable used as ${NAME} in the deployment file, as NAME=value; overrides the environment",
174 cfg { cli_short: "D" }
175 }];
176 repeated string interface_dir = 13 [(goby.field) = {
177 description: "Search this directory for interface files, after the deployment file's own directory (also GOBY_INTERFACE_PATH, colon separated)",
178 cfg { cli_short: "I" }
179 }];
180
181 enum OutputFormat
182 {
183 HUMAN = 1;
184 JSON = 2;
185 }
186 optional OutputFormat output_format = 20
187 [default = HUMAN, (goby.field) = { cfg { cli_short: "o" } }];
188 optional bool strict = 21
189 [default = false, (goby.field).description = "Fail on warnings as well as errors"];
190 optional bool report_unused = 22 [
191 default = false,
192 (goby.field).description = "Also report publications that nothing subscribes to"
193 ];
194 optional bool assume_dynamic = 25 [
195 default = false,
196 (goby.field).description =
197 "Count a dynamic publication whose group's numeric part is set at run time (and not given with bind:) as reaching the subscriptions it might"
198 ];
199 optional string omit_group_regex = 23
200 [(goby.field).description = "Do not check groups matching this regex"];
201 optional string omit_node_regex = 24 [(goby.field).description =
202 "Do not check platforms, modules, applications or "
203 "threads whose name matches this regex"];
204}
205
206// Reports written with -o JSON
207
208// a publication or subscription, and where in the deployment it is made
209message InterfaceEndpoint
210{
211 optional string platform = 1;
212 optional string module = 2;
213 optional string application = 3;
214 optional string thread = 4;
215 optional string layer = 5;
216 optional string group = 6;
217 optional string scheme = 7;
218 optional string type = 8;
219 optional string necessity = 9;
220}
221
222message InterfaceIssue
223{
224 enum Severity
225 {
226 ERROR = 1;
227 WARNING = 2;
228 INFO = 3;
229 }
230 required Severity severity = 1;
231 required string code = 2 [(goby.field).description = "e.g. required-unmet"];
232 required string message = 3;
233 optional string location = 4 [(goby.field).description =
234 "Position in the deployment file, e.g. platforms[0].run[2]"];
235
236 optional InterfaceEndpoint subject = 5 [(goby.field).description =
237 "The publication or subscription the issue is about"];
238}
239
240message InterfaceValidation
241{
242 required string file = 1;
243 required bool valid = 2;
244 repeated InterfaceIssue issue = 3;
245
246 message Summary
247 {
248 optional int32 platforms = 1;
249 optional int32 applications = 2;
250 optional int32 connections = 3;
251 optional int32 required = 4;
252 optional int32 required_met = 5;
253 }
254 optional Summary summary = 4;
255}
256
257message InterfaceListConfig
258{
259 option (goby.msg).cfg.tool = {
260 is_tool: true
261 has_subtools: false
262 has_help_action: false
263 };
264
265 optional goby.middleware.protobuf.AppConfig app = 1
266 [(goby.field) = { cfg { action: DEVELOPER } }];
267
268 required string deployment_file = 10 [(goby.field) = {
269 description: "Deployment file (deployment.yml), or a single interface file",
270 cfg { position: { enable: true } }
271 }];
272 enum What
273 {
274 applications = 1;
275 platforms = 2;
276 groups = 3;
277 }
278 optional What what = 11 [
279 default = applications,
280 (goby.field) = {
281 description: "applications (with their threads and publish/subscribe counts per layer), platforms, or groups (with their publishers and subscribers)",
282 cfg { position: { enable: true } }
283 }
284 ];
285 repeated string define = 14 [(goby.field) = {
286 description: "Set a variable used as ${NAME} in the deployment file, as NAME=value; overrides the environment",
287 cfg { cli_short: "D" }
288 }];
289 repeated string interface_dir = 15 [(goby.field) = {
290 description: "Search this directory for interface files, after the deployment file's own directory (also GOBY_INTERFACE_PATH, colon separated)",
291 cfg { cli_short: "I" }
292 }];
293 optional string output_file = 16
294 [(goby.field).description = "Write the list here instead of stdout"];
295 optional InterfaceValidateConfig.OutputFormat output_format = 20
296 [default = HUMAN, (goby.field) = { cfg { cli_short: "o" } }];
297}
298
299message InterfaceExplainConfig
300{
301 option (goby.msg).cfg.tool = {
302 is_tool: true
303 has_subtools: false
304 has_help_action: false
305 };
306
307 optional goby.middleware.protobuf.AppConfig app = 1
308 [(goby.field) = { cfg { action: DEVELOPER } }];
309
310 required string deployment_file = 10 [(goby.field) = {
311 description: "Deployment file (deployment.yml), or a single interface file",
312 cfg { position: { enable: true } }
313 }];
314 required string group_regex = 11 [(goby.field) = {
315 description: "Explain the groups matching this regex",
316 cfg { position: { enable: true } }
317 }];
318 optional string type_regex = 12
319 [(goby.field).description = "Only entries whose type matches this regex"];
320 repeated string define = 14 [(goby.field) = {
321 description: "Set a variable used as ${NAME} in the deployment file, as NAME=value; overrides the environment",
322 cfg { cli_short: "D" }
323 }];
324 repeated string interface_dir = 15 [(goby.field) = {
325 description: "Search this directory for interface files, after the deployment file's own directory (also GOBY_INTERFACE_PATH, colon separated)",
326 cfg { cli_short: "I" }
327 }];
328 optional string output_file = 16
329 [(goby.field).description = "Write the explanation here instead of stdout"];
330 optional InterfaceValidateConfig.OutputFormat output_format = 20
331 [default = HUMAN, (goby.field) = { cfg { cli_short: "o" } }];
332}
333
334message InterfaceDiffConfig
335{
336 option (goby.msg).cfg.tool = {
337 is_tool: true
338 has_subtools: false
339 has_help_action: false
340 };
341
342 optional goby.middleware.protobuf.AppConfig app = 1
343 [(goby.field) = { cfg { action: DEVELOPER } }];
344
345 required string deployment_file = 10 [(goby.field) = {
346 description: "Deployment file before",
347 cfg { position: { enable: true } }
348 }];
349 optional string deployment_file_b = 11 [(goby.field) = {
350 description: "Deployment file after; the same file if omitted (compare two sets of interface files with --interface_dir_a and --interface_dir_b)",
351 cfg { position: { enable: true } }
352 }];
353 repeated string define = 14 [(goby.field) = {
354 description: "Set a variable used as ${NAME} in the deployment file, as NAME=value; overrides the environment",
355 cfg { cli_short: "D" }
356 }];
357 repeated string interface_dir = 15 [(goby.field) = {
358 description: "Search this directory for interface files, for both deployments, after each deployment file's own directory and its --interface_dir_a or --interface_dir_b (also GOBY_INTERFACE_PATH, colon separated)",
359 cfg { cli_short: "I" }
360 }];
361 repeated string interface_dir_a = 16 [(goby.field).description =
362 "Search this directory for the first deployment's interface files"];
363 repeated string interface_dir_b = 17 [(goby.field).description =
364 "Search this directory for the second deployment's interface files"];
365 optional string output_file = 18
366 [(goby.field).description = "Write the differences here instead of stdout"];
367 optional InterfaceValidateConfig.OutputFormat output_format = 20
368 [default = HUMAN, (goby.field) = { cfg { cli_short: "o" } }];
369}
370
371message InterfaceInitConfig
372{
373 option (goby.msg).cfg.tool = {
374 is_tool: true
375 has_subtools: false
376 has_help_action: false
377 };
378
379 optional goby.middleware.protobuf.AppConfig app = 1
380 [(goby.field) = { cfg { action: DEVELOPER } }];
381
382 required string directory = 10 [(goby.field) = {
383 description: "Directory of interface files (<target>_interface.yml) to start from",
384 cfg { position: { enable: true } }
385 }];
386 optional string platform = 11
387 [default = "platform", (goby.field).description = "Name of the one platform written"];
388 optional string deployment_name = 12
389 [(goby.field).description = "Name of the deployment; the directory's name if omitted"];
390 optional string output_file = 13
391 [(goby.field).description = "Write the deployment file here instead of stdout"];
392}
393
394// Written by 'goby interface list -o JSON'
395message InterfaceList
396{
397 required string file = 1;
398
399 message Platform
400 {
401 required string name = 1;
402 repeated string module = 2;
403 optional int32 applications = 3;
404 }
405 message LayerCount
406 {
407 required string layer = 1;
408 optional int32 publishes = 2;
409 optional int32 subscribes = 3;
410 }
411 message Application
412 {
413 required string platform = 1;
414 optional string module = 2;
415 required string name = 3;
416 repeated string thread = 4;
417 repeated LayerCount count = 5;
418 }
419 message Group
420 {
421 required string layer = 1;
422 required string group = 2;
423 repeated InterfaceEndpoint publisher = 3;
424 repeated InterfaceEndpoint subscriber = 4;
425 }
426 repeated Platform platform = 2;
427 repeated Application application = 3;
428 repeated Group group = 4;
429}
430
431// Written by 'goby interface explain -o JSON'
432message InterfaceExplanation
433{
434 required string file = 1;
435 required string group_regex = 2;
436 optional string type_regex = 3;
437
438 message Subscription
439 {
440 required InterfaceEndpoint subscriber = 1;
441 repeated InterfaceEndpoint publisher = 2;
442 // reached by a publisher whose group certainly matches
443 required bool met = 3;
444 // why it is not met, or what it depends on
445 repeated string reason = 4;
446 optional bool necessity_set_by_deployment = 5;
447 }
448 message Publication
449 {
450 required InterfaceEndpoint publisher = 1;
451 repeated InterfaceEndpoint subscriber = 2;
452 repeated string note = 3;
453 }
454 repeated Subscription subscription = 4;
455 repeated Publication publication = 5;
456}
457
458// Written by 'goby interface diff -o JSON'
459message InterfaceDiff
460{
461 required string file_a = 1;
462 required string file_b = 2;
463
464 message Connection
465 {
466 required InterfaceEndpoint publisher = 1;
467 required InterfaceEndpoint subscriber = 2;
468 }
469 repeated string application_added = 3
470 [(goby.field).description = "platform/[module/]application"];
471 repeated string application_removed = 4;
472 repeated Connection connection_added = 5;
473 repeated Connection connection_removed = 6;
474 // required subscriptions without a publisher in the second deployment but not the first
475 repeated InterfaceIssue newly_unmet = 7;
476 // and the other way round
477 repeated InterfaceIssue newly_met = 8;
478}
479
480message InterfaceLaunchConfig
481{
482 option (goby.msg).cfg.tool = {
483 is_tool: true
484 has_subtools: false
485 has_help_action: false
486 };
487
488 optional goby.middleware.protobuf.AppConfig app = 1
489 [(goby.field) = { cfg { action: DEVELOPER } }];
490
491 required string deployment_file = 10 [(goby.field) = {
492 description: "Deployment file (deployment.yml)",
493 cfg { position: { enable: true } }
494 }];
495 optional string platform = 12 [(goby.field).description =
496 "Platform to use, or one of its instances (e.g. bot2); needed when the deployment has more than one"];
497 optional uint32 instance = 13
498 [(goby.field).description = "With --platform, the instance (--platform bot --instance 2 is bot2)"];
499 optional string module = 16 [(goby.field).description =
500 "With modules, the module (one gobyd) to use"];
501 repeated string define = 14 [(goby.field) = {
502 description: "Set a variable used as ${NAME} in the deployment file, as NAME=value; overrides the environment",
503 cfg { cli_short: "D" }
504 }];
505 repeated string interface_dir = 15 [(goby.field) = {
506 description: "Search this directory for interface files, after the deployment file's own directory (also GOBY_INTERFACE_PATH, colon separated)",
507 cfg { cli_short: "I" }
508 }];
509 optional string output_file = 17
510 [(goby.field).description = "Write the launch file here instead of stdout"];
511 optional string outdir = 18 [(goby.field).description =
512 "Write <platform>[.<module>].launch here for every platform (and module)"];
513}
514
515message InterfaceLaunchCheckConfig
516{
517 option (goby.msg).cfg.tool = {
518 is_tool: true
519 has_subtools: false
520 has_help_action: false
521 };
522
523 optional goby.middleware.protobuf.AppConfig app = 1
524 [(goby.field) = { cfg { action: DEVELOPER } }];
525
526 required string deployment_file = 10 [(goby.field) = {
527 description: "Deployment file (deployment.yml)",
528 cfg { position: { enable: true } }
529 }];
530 required string launch_file = 11 [(goby.field) = {
531 description: "goby_launch file to compare with it",
532 cfg { position: { enable: true } }
533 }];
534 optional string platform = 12 [(goby.field).description =
535 "Platform to use, or one of its instances (e.g. bot2); needed when the deployment has more than one"];
536 optional uint32 instance = 13
537 [(goby.field).description = "With --platform, the instance (--platform bot --instance 2 is bot2)"];
538 optional string module = 16 [(goby.field).description =
539 "With modules, the module (one gobyd) to use"];
540 repeated string define = 14 [(goby.field) = {
541 description: "Set a variable used as ${NAME} in the deployment file, as NAME=value; overrides the environment",
542 cfg { cli_short: "D" }
543 }];
544 repeated string interface_dir = 15 [(goby.field) = {
545 description: "Search this directory for interface files, after the deployment file's own directory (also GOBY_INTERFACE_PATH, colon separated)",
546 cfg { cli_short: "I" }
547 }];
548 optional string output_file = 17
549 [(goby.field).description = "Write the differences here instead of stdout"];
550 optional InterfaceValidateConfig.OutputFormat output_format = 20
551 [default = HUMAN, (goby.field) = { cfg { cli_short: "o" } }];
552}
553
554// Written by 'goby interface launch_check -o JSON'
555message InterfaceLaunchCheck
556{
557 required string launch_file = 1;
558 required string deployment_file = 2;
559 // platform[.module]
560 required string unit = 3;
561
562 message Difference
563 {
564 // launched-only, not-launched, env or kill
565 required string kind = 1;
566 required string name = 2;
567 // in the launch file, when the line is there
568 optional int32 line = 3;
569 required string detail = 4;
570 }
571 repeated Difference difference = 4;
572}
573
574message InterfaceSystemdConfig
575{
576 option (goby.msg).cfg.tool = {
577 is_tool: true
578 has_subtools: false
579 has_help_action: false
580 };
581
582 optional goby.middleware.protobuf.AppConfig app = 1
583 [(goby.field) = { cfg { action: DEVELOPER } }];
584
585 required string deployment_file = 10 [(goby.field) = {
586 description: "Deployment file (deployment.yml)",
587 cfg { position: { enable: true } }
588 }];
589 optional string platform = 12 [(goby.field).description =
590 "Platform to use, or one of its instances (e.g. bot2); needed when the deployment has more than one"];
591 optional uint32 instance = 13
592 [(goby.field).description = "With --platform, the instance (--platform bot --instance 2 is bot2)"];
593 optional string module = 16 [(goby.field).description =
594 "With modules, the module (one gobyd) to use"];
595 repeated string define = 14 [(goby.field) = {
596 description: "Set a variable used as ${NAME} in the deployment file, as NAME=value; overrides the environment",
597 cfg { cli_short: "D" }
598 }];
599 repeated string interface_dir = 15 [(goby.field) = {
600 description: "Search this directory for interface files, after the deployment file's own directory (also GOBY_INTERFACE_PATH, colon separated)",
601 cfg { cli_short: "I" }
602 }];
603 optional string outdir = 17 [(goby.field).description =
604 "Write the unit files here, instead of printing them"];
605 optional bool check = 18 [
606 default = false,
607 (goby.field).description =
608 "Compare the units with those in --unit_dir instead of writing them; exits 1 if any differ"
609 ];
610 optional string unit_dir = 19 [
611 default = "/etc/systemd/system",
612 (goby.field).description = "Installed units, for --check"
613 ];
614}