rsmp 0.46.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/copilot-setup-steps.yml +1 -1
- data/.github/workflows/rubocop.yaml +1 -1
- data/.github/workflows/sus.yaml +1 -1
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +5 -5
- data/README.md +3 -1
- data/documentation/cli.md +225 -0
- data/documentation/configuration.md +83 -0
- data/lib/rsmp/cli/configuration.rb +30 -0
- data/lib/rsmp/cli.rb +45 -45
- data/lib/rsmp/collect/command_matcher.rb +13 -4
- data/lib/rsmp/collect/status_matcher.rb +14 -4
- data/lib/rsmp/command_list.rb +1 -1
- data/lib/rsmp/config.rb +63 -0
- data/lib/rsmp/convert/export/json_schema/index.rb +64 -0
- data/lib/rsmp/convert/export/json_schema/items.rb +9 -1
- data/lib/rsmp/convert/export/json_schema/outputs.rb +65 -25
- data/lib/rsmp/convert/export/json_schema/values.rb +40 -11
- data/lib/rsmp/convert/export/json_schema.rb +3 -1
- data/lib/rsmp/message/sxl_codec.rb +194 -0
- data/lib/rsmp/message.rb +2 -0
- data/lib/rsmp/node/site/connections.rb +80 -0
- data/lib/rsmp/node/site/site.rb +21 -35
- data/lib/rsmp/node/supervisor/supervisor.rb +42 -0
- data/lib/rsmp/options/options.rb +21 -9
- data/lib/rsmp/options/schemas/config_common.json +129 -0
- data/lib/rsmp/options/schemas/log.json +71 -0
- data/lib/rsmp/options/schemas/site.json +12 -57
- data/lib/rsmp/options/schemas/supervisor.json +4 -29
- data/lib/rsmp/options/schemas/supervisor_site.json +19 -31
- data/lib/rsmp/options/schemas/traffic_controller_site.json +1 -2
- data/lib/rsmp/options/site_options.rb +31 -23
- data/lib/rsmp/options/supervisor_options.rb +1 -0
- data/lib/rsmp/proxy/modules/receive.rb +3 -1
- data/lib/rsmp/proxy/modules/send.rb +26 -14
- data/lib/rsmp/proxy/proxy.rb +17 -0
- data/lib/rsmp/proxy/site/connection.rb +79 -0
- data/lib/rsmp/proxy/site/modules/commands.rb +24 -1
- data/lib/rsmp/proxy/site/site_proxy.rb +6 -15
- data/lib/rsmp/proxy/supervisor/modules/commands.rb +55 -0
- data/lib/rsmp/proxy/supervisor/modules/message_buffer.rb +0 -5
- data/lib/rsmp/proxy/supervisor/modules/status.rb +13 -104
- data/lib/rsmp/proxy/supervisor/modules/status_updates.rb +148 -0
- data/lib/rsmp/proxy/supervisor/supervisor_proxy.rb +19 -0
- data/lib/rsmp/schema.rb +38 -1
- data/lib/rsmp/tlc/detector_logic.rb +2 -2
- data/lib/rsmp/tlc/modules/helpers.rb +0 -22
- data/lib/rsmp/tlc/modules/inputs.rb +4 -3
- data/lib/rsmp/tlc/modules/modes.rb +2 -2
- data/lib/rsmp/tlc/modules/plans.rb +7 -3
- data/lib/rsmp/tlc/modules/system.rb +1 -1
- data/lib/rsmp/tlc/proxy/control.rb +19 -19
- data/lib/rsmp/tlc/proxy/detectors.rb +3 -3
- data/lib/rsmp/tlc/proxy/io.rb +15 -12
- data/lib/rsmp/tlc/proxy/plans.rb +14 -14
- data/lib/rsmp/tlc/proxy/status.rb +9 -5
- data/lib/rsmp/tlc/proxy/system.rb +12 -6
- data/lib/rsmp/tlc/signal_group.rb +2 -2
- data/lib/rsmp/tlc/supervisor_interface.rb +42 -0
- data/lib/rsmp/tlc/traffic_controller_site.rb +1 -18
- data/lib/rsmp/version.rb +1 -1
- data/lib/rsmp.rb +5 -0
- data/schemas/core/3.1.4/command_response.json +11 -0
- data/schemas/core/3.1.5/command_response.json +11 -0
- data/schemas/core/3.2.0/command_response.json +11 -0
- data/schemas/core/3.2.1/command_response.json +11 -0
- data/schemas/core/3.2.2/command_response.json +11 -0
- data/schemas/core/3.3.0/command_response.json +11 -0
- data/schemas/tlc/1.0.10/alarms/A0008.json +21 -15
- data/schemas/tlc/1.0.10/alarms/A0201.json +26 -20
- data/schemas/tlc/1.0.10/alarms/A0202.json +26 -20
- data/schemas/tlc/1.0.10/alarms/A0301.json +69 -63
- data/schemas/tlc/1.0.10/alarms/A0302.json +87 -81
- data/schemas/tlc/1.0.10/commands/M0001.json +66 -60
- data/schemas/tlc/1.0.10/commands/M0002.json +48 -42
- data/schemas/tlc/1.0.10/commands/M0003.json +48 -42
- data/schemas/tlc/1.0.10/commands/M0004.json +35 -29
- data/schemas/tlc/1.0.10/commands/M0005.json +48 -42
- data/schemas/tlc/1.0.10/commands/M0006.json +48 -42
- data/schemas/tlc/1.0.10/commands/M0007.json +35 -29
- data/schemas/tlc/1.0.10/commands/M0008.json +48 -42
- data/schemas/tlc/1.0.10/commands/M0010.json +35 -29
- data/schemas/tlc/1.0.10/commands/M0011.json +35 -29
- data/schemas/tlc/1.0.10/commands/M0012.json +35 -29
- data/schemas/tlc/1.0.10/commands/M0013.json +35 -29
- data/schemas/tlc/1.0.10/commands/M0019.json +61 -55
- data/schemas/tlc/1.0.10/commands/M0103.json +51 -45
- data/schemas/tlc/1.0.10/commands/M0104.json +100 -94
- data/schemas/tlc/1.0.10/commands/command_requests.json +995 -1
- data/schemas/tlc/1.0.10/defs/guards.json +19 -0
- data/schemas/tlc/1.0.10/sxl.yaml +56 -56
- data/schemas/tlc/1.0.10/sxl_index.json +226 -244
- data/schemas/tlc/1.0.13/alarms/A0008.json +21 -15
- data/schemas/tlc/1.0.13/alarms/A0201.json +26 -20
- data/schemas/tlc/1.0.13/alarms/A0202.json +26 -20
- data/schemas/tlc/1.0.13/alarms/A0301.json +69 -63
- data/schemas/tlc/1.0.13/alarms/A0302.json +87 -81
- data/schemas/tlc/1.0.13/commands/M0001.json +66 -60
- data/schemas/tlc/1.0.13/commands/M0002.json +48 -42
- data/schemas/tlc/1.0.13/commands/M0003.json +48 -42
- data/schemas/tlc/1.0.13/commands/M0004.json +35 -29
- data/schemas/tlc/1.0.13/commands/M0005.json +48 -42
- data/schemas/tlc/1.0.13/commands/M0006.json +48 -42
- data/schemas/tlc/1.0.13/commands/M0007.json +35 -29
- data/schemas/tlc/1.0.13/commands/M0008.json +48 -42
- data/schemas/tlc/1.0.13/commands/M0010.json +35 -29
- data/schemas/tlc/1.0.13/commands/M0011.json +35 -29
- data/schemas/tlc/1.0.13/commands/M0012.json +35 -29
- data/schemas/tlc/1.0.13/commands/M0013.json +35 -29
- data/schemas/tlc/1.0.13/commands/M0014.json +48 -42
- data/schemas/tlc/1.0.13/commands/M0015.json +48 -42
- data/schemas/tlc/1.0.13/commands/M0016.json +35 -29
- data/schemas/tlc/1.0.13/commands/M0017.json +35 -29
- data/schemas/tlc/1.0.13/commands/M0018.json +48 -42
- data/schemas/tlc/1.0.13/commands/M0019.json +61 -55
- data/schemas/tlc/1.0.13/commands/M0103.json +51 -45
- data/schemas/tlc/1.0.13/commands/M0104.json +100 -94
- data/schemas/tlc/1.0.13/commands/command_requests.json +1293 -1
- data/schemas/tlc/1.0.13/defs/guards.json +19 -0
- data/schemas/tlc/1.0.13/sxl.yaml +63 -63
- data/schemas/tlc/1.0.13/sxl_index.json +280 -298
- data/schemas/tlc/1.0.14/alarms/A0008.json +21 -15
- data/schemas/tlc/1.0.14/alarms/A0201.json +26 -20
- data/schemas/tlc/1.0.14/alarms/A0202.json +26 -20
- data/schemas/tlc/1.0.14/alarms/A0301.json +69 -63
- data/schemas/tlc/1.0.14/alarms/A0302.json +87 -81
- data/schemas/tlc/1.0.14/commands/M0001.json +66 -60
- data/schemas/tlc/1.0.14/commands/M0002.json +48 -42
- data/schemas/tlc/1.0.14/commands/M0003.json +48 -42
- data/schemas/tlc/1.0.14/commands/M0004.json +35 -29
- data/schemas/tlc/1.0.14/commands/M0005.json +48 -42
- data/schemas/tlc/1.0.14/commands/M0006.json +48 -42
- data/schemas/tlc/1.0.14/commands/M0007.json +35 -29
- data/schemas/tlc/1.0.14/commands/M0008.json +48 -42
- data/schemas/tlc/1.0.14/commands/M0010.json +35 -29
- data/schemas/tlc/1.0.14/commands/M0011.json +35 -29
- data/schemas/tlc/1.0.14/commands/M0012.json +35 -29
- data/schemas/tlc/1.0.14/commands/M0013.json +35 -29
- data/schemas/tlc/1.0.14/commands/M0014.json +48 -42
- data/schemas/tlc/1.0.14/commands/M0015.json +48 -42
- data/schemas/tlc/1.0.14/commands/M0016.json +35 -29
- data/schemas/tlc/1.0.14/commands/M0017.json +35 -29
- data/schemas/tlc/1.0.14/commands/M0018.json +48 -42
- data/schemas/tlc/1.0.14/commands/M0019.json +61 -55
- data/schemas/tlc/1.0.14/commands/M0103.json +51 -45
- data/schemas/tlc/1.0.14/commands/M0104.json +100 -94
- data/schemas/tlc/1.0.14/commands/command_requests.json +1293 -1
- data/schemas/tlc/1.0.14/defs/guards.json +19 -0
- data/schemas/tlc/1.0.14/sxl.yaml +63 -63
- data/schemas/tlc/1.0.14/sxl_index.json +304 -322
- data/schemas/tlc/1.0.15/alarms/A0008.json +21 -15
- data/schemas/tlc/1.0.15/alarms/A0201.json +26 -20
- data/schemas/tlc/1.0.15/alarms/A0202.json +26 -20
- data/schemas/tlc/1.0.15/alarms/A0301.json +69 -63
- data/schemas/tlc/1.0.15/alarms/A0302.json +87 -81
- data/schemas/tlc/1.0.15/commands/M0001.json +66 -60
- data/schemas/tlc/1.0.15/commands/M0002.json +48 -42
- data/schemas/tlc/1.0.15/commands/M0003.json +48 -42
- data/schemas/tlc/1.0.15/commands/M0004.json +35 -29
- data/schemas/tlc/1.0.15/commands/M0005.json +48 -42
- data/schemas/tlc/1.0.15/commands/M0006.json +48 -42
- data/schemas/tlc/1.0.15/commands/M0007.json +35 -29
- data/schemas/tlc/1.0.15/commands/M0008.json +48 -42
- data/schemas/tlc/1.0.15/commands/M0010.json +35 -29
- data/schemas/tlc/1.0.15/commands/M0011.json +35 -29
- data/schemas/tlc/1.0.15/commands/M0012.json +35 -29
- data/schemas/tlc/1.0.15/commands/M0013.json +35 -29
- data/schemas/tlc/1.0.15/commands/M0014.json +48 -42
- data/schemas/tlc/1.0.15/commands/M0015.json +48 -42
- data/schemas/tlc/1.0.15/commands/M0016.json +35 -29
- data/schemas/tlc/1.0.15/commands/M0017.json +35 -29
- data/schemas/tlc/1.0.15/commands/M0018.json +48 -42
- data/schemas/tlc/1.0.15/commands/M0019.json +61 -55
- data/schemas/tlc/1.0.15/commands/M0020.json +61 -55
- data/schemas/tlc/1.0.15/commands/M0021.json +35 -29
- data/schemas/tlc/1.0.15/commands/M0103.json +51 -45
- data/schemas/tlc/1.0.15/commands/M0104.json +100 -94
- data/schemas/tlc/1.0.15/commands/command_requests.json +1425 -1
- data/schemas/tlc/1.0.15/defs/guards.json +19 -0
- data/schemas/tlc/1.0.15/sxl.yaml +66 -66
- data/schemas/tlc/1.0.15/sxl_index.json +330 -350
- data/schemas/tlc/1.0.7/alarms/A0008.json +21 -15
- data/schemas/tlc/1.0.7/alarms/A0201.json +26 -20
- data/schemas/tlc/1.0.7/alarms/A0202.json +26 -20
- data/schemas/tlc/1.0.7/alarms/A0301.json +69 -63
- data/schemas/tlc/1.0.7/alarms/A0302.json +87 -81
- data/schemas/tlc/1.0.7/commands/M0001.json +66 -60
- data/schemas/tlc/1.0.7/commands/M0002.json +48 -42
- data/schemas/tlc/1.0.7/commands/M0003.json +48 -42
- data/schemas/tlc/1.0.7/commands/M0004.json +35 -29
- data/schemas/tlc/1.0.7/commands/M0005.json +48 -42
- data/schemas/tlc/1.0.7/commands/M0006.json +48 -42
- data/schemas/tlc/1.0.7/commands/M0007.json +35 -29
- data/schemas/tlc/1.0.7/commands/M0008.json +48 -42
- data/schemas/tlc/1.0.7/commands/M0010.json +35 -29
- data/schemas/tlc/1.0.7/commands/M0011.json +35 -29
- data/schemas/tlc/1.0.7/commands/M0019.json +61 -55
- data/schemas/tlc/1.0.7/commands/M0103.json +51 -45
- data/schemas/tlc/1.0.7/commands/M0104.json +100 -94
- data/schemas/tlc/1.0.7/commands/command_requests.json +895 -1
- data/schemas/tlc/1.0.7/defs/guards.json +19 -0
- data/schemas/tlc/1.0.7/sxl.yaml +58 -58
- data/schemas/tlc/1.0.7/sxl_index.json +228 -246
- data/schemas/tlc/1.0.8/alarms/A0008.json +21 -15
- data/schemas/tlc/1.0.8/alarms/A0201.json +26 -20
- data/schemas/tlc/1.0.8/alarms/A0202.json +26 -20
- data/schemas/tlc/1.0.8/alarms/A0301.json +69 -63
- data/schemas/tlc/1.0.8/alarms/A0302.json +87 -81
- data/schemas/tlc/1.0.8/commands/M0001.json +66 -60
- data/schemas/tlc/1.0.8/commands/M0002.json +48 -42
- data/schemas/tlc/1.0.8/commands/M0003.json +48 -42
- data/schemas/tlc/1.0.8/commands/M0004.json +35 -29
- data/schemas/tlc/1.0.8/commands/M0005.json +48 -42
- data/schemas/tlc/1.0.8/commands/M0006.json +48 -42
- data/schemas/tlc/1.0.8/commands/M0007.json +35 -29
- data/schemas/tlc/1.0.8/commands/M0008.json +48 -42
- data/schemas/tlc/1.0.8/commands/M0010.json +35 -29
- data/schemas/tlc/1.0.8/commands/M0011.json +35 -29
- data/schemas/tlc/1.0.8/commands/M0012.json +35 -29
- data/schemas/tlc/1.0.8/commands/M0013.json +35 -29
- data/schemas/tlc/1.0.8/commands/M0019.json +61 -55
- data/schemas/tlc/1.0.8/commands/M0103.json +51 -45
- data/schemas/tlc/1.0.8/commands/M0104.json +100 -94
- data/schemas/tlc/1.0.8/commands/command_requests.json +995 -1
- data/schemas/tlc/1.0.8/defs/guards.json +19 -0
- data/schemas/tlc/1.0.8/sxl.yaml +56 -56
- data/schemas/tlc/1.0.8/sxl_index.json +226 -244
- data/schemas/tlc/1.0.9/alarms/A0008.json +21 -15
- data/schemas/tlc/1.0.9/alarms/A0201.json +26 -20
- data/schemas/tlc/1.0.9/alarms/A0202.json +26 -20
- data/schemas/tlc/1.0.9/alarms/A0301.json +69 -63
- data/schemas/tlc/1.0.9/alarms/A0302.json +87 -81
- data/schemas/tlc/1.0.9/commands/M0001.json +66 -60
- data/schemas/tlc/1.0.9/commands/M0002.json +48 -42
- data/schemas/tlc/1.0.9/commands/M0003.json +48 -42
- data/schemas/tlc/1.0.9/commands/M0004.json +35 -29
- data/schemas/tlc/1.0.9/commands/M0005.json +48 -42
- data/schemas/tlc/1.0.9/commands/M0006.json +48 -42
- data/schemas/tlc/1.0.9/commands/M0007.json +35 -29
- data/schemas/tlc/1.0.9/commands/M0008.json +48 -42
- data/schemas/tlc/1.0.9/commands/M0010.json +35 -29
- data/schemas/tlc/1.0.9/commands/M0011.json +35 -29
- data/schemas/tlc/1.0.9/commands/M0012.json +35 -29
- data/schemas/tlc/1.0.9/commands/M0013.json +35 -29
- data/schemas/tlc/1.0.9/commands/M0019.json +61 -55
- data/schemas/tlc/1.0.9/commands/M0103.json +51 -45
- data/schemas/tlc/1.0.9/commands/M0104.json +100 -94
- data/schemas/tlc/1.0.9/commands/command_requests.json +995 -1
- data/schemas/tlc/1.0.9/defs/guards.json +19 -0
- data/schemas/tlc/1.0.9/sxl.yaml +56 -56
- data/schemas/tlc/1.0.9/sxl_index.json +226 -244
- data/schemas/tlc/1.1.0/alarms/A0007.json +25 -19
- data/schemas/tlc/1.1.0/alarms/A0008.json +21 -15
- data/schemas/tlc/1.1.0/alarms/A0201.json +26 -20
- data/schemas/tlc/1.1.0/alarms/A0202.json +26 -20
- data/schemas/tlc/1.1.0/alarms/A0301.json +69 -63
- data/schemas/tlc/1.1.0/alarms/A0302.json +87 -81
- data/schemas/tlc/1.1.0/alarms/A0303.json +69 -63
- data/schemas/tlc/1.1.0/alarms/A0304.json +87 -81
- data/schemas/tlc/1.1.0/commands/M0001.json +66 -60
- data/schemas/tlc/1.1.0/commands/M0002.json +48 -42
- data/schemas/tlc/1.1.0/commands/M0003.json +48 -42
- data/schemas/tlc/1.1.0/commands/M0004.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0005.json +48 -42
- data/schemas/tlc/1.1.0/commands/M0006.json +48 -42
- data/schemas/tlc/1.1.0/commands/M0007.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0008.json +48 -42
- data/schemas/tlc/1.1.0/commands/M0010.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0011.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0012.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0013.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0014.json +48 -42
- data/schemas/tlc/1.1.0/commands/M0015.json +48 -42
- data/schemas/tlc/1.1.0/commands/M0016.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0017.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0018.json +48 -42
- data/schemas/tlc/1.1.0/commands/M0019.json +61 -55
- data/schemas/tlc/1.1.0/commands/M0020.json +61 -55
- data/schemas/tlc/1.1.0/commands/M0021.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0022.json +194 -188
- data/schemas/tlc/1.1.0/commands/M0023.json +35 -29
- data/schemas/tlc/1.1.0/commands/M0103.json +51 -45
- data/schemas/tlc/1.1.0/commands/M0104.json +100 -94
- data/schemas/tlc/1.1.0/commands/command_requests.json +1525 -1
- data/schemas/tlc/1.1.0/defs/guards.json +19 -0
- data/schemas/tlc/1.1.0/statuses/S0033.json +2 -2
- data/schemas/tlc/1.1.0/sxl.yaml +75 -74
- data/schemas/tlc/1.1.0/sxl_index.json +391 -398
- data/schemas/tlc/1.2.0/alarms/A0007.json +25 -19
- data/schemas/tlc/1.2.0/alarms/A0008.json +21 -15
- data/schemas/tlc/1.2.0/alarms/A0201.json +26 -20
- data/schemas/tlc/1.2.0/alarms/A0202.json +26 -20
- data/schemas/tlc/1.2.0/alarms/A0301.json +69 -63
- data/schemas/tlc/1.2.0/alarms/A0302.json +87 -81
- data/schemas/tlc/1.2.0/alarms/A0303.json +69 -63
- data/schemas/tlc/1.2.0/alarms/A0304.json +87 -81
- data/schemas/tlc/1.2.0/commands/M0001.json +66 -60
- data/schemas/tlc/1.2.0/commands/M0002.json +48 -42
- data/schemas/tlc/1.2.0/commands/M0003.json +48 -42
- data/schemas/tlc/1.2.0/commands/M0004.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0005.json +48 -42
- data/schemas/tlc/1.2.0/commands/M0006.json +48 -42
- data/schemas/tlc/1.2.0/commands/M0007.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0008.json +48 -42
- data/schemas/tlc/1.2.0/commands/M0010.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0011.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0012.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0013.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0014.json +48 -42
- data/schemas/tlc/1.2.0/commands/M0015.json +48 -42
- data/schemas/tlc/1.2.0/commands/M0016.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0017.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0018.json +48 -42
- data/schemas/tlc/1.2.0/commands/M0019.json +61 -55
- data/schemas/tlc/1.2.0/commands/M0020.json +61 -55
- data/schemas/tlc/1.2.0/commands/M0021.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0022.json +194 -188
- data/schemas/tlc/1.2.0/commands/M0023.json +35 -29
- data/schemas/tlc/1.2.0/commands/M0103.json +51 -45
- data/schemas/tlc/1.2.0/commands/M0104.json +100 -94
- data/schemas/tlc/1.2.0/commands/command_requests.json +1525 -1
- data/schemas/tlc/1.2.0/defs/guards.json +19 -0
- data/schemas/tlc/1.2.0/statuses/S0033.json +2 -2
- data/schemas/tlc/1.2.0/sxl.yaml +77 -76
- data/schemas/tlc/1.2.0/sxl_index.json +401 -397
- data/schemas/tlc/1.2.1/alarms/A0007.json +25 -19
- data/schemas/tlc/1.2.1/alarms/A0008.json +21 -15
- data/schemas/tlc/1.2.1/alarms/A0201.json +26 -20
- data/schemas/tlc/1.2.1/alarms/A0202.json +26 -20
- data/schemas/tlc/1.2.1/alarms/A0301.json +69 -63
- data/schemas/tlc/1.2.1/alarms/A0302.json +87 -81
- data/schemas/tlc/1.2.1/alarms/A0303.json +69 -63
- data/schemas/tlc/1.2.1/alarms/A0304.json +87 -81
- data/schemas/tlc/1.2.1/commands/M0001.json +66 -60
- data/schemas/tlc/1.2.1/commands/M0002.json +48 -42
- data/schemas/tlc/1.2.1/commands/M0003.json +48 -42
- data/schemas/tlc/1.2.1/commands/M0004.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0005.json +48 -42
- data/schemas/tlc/1.2.1/commands/M0006.json +48 -42
- data/schemas/tlc/1.2.1/commands/M0007.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0008.json +48 -42
- data/schemas/tlc/1.2.1/commands/M0010.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0011.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0012.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0013.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0014.json +48 -42
- data/schemas/tlc/1.2.1/commands/M0015.json +48 -42
- data/schemas/tlc/1.2.1/commands/M0016.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0017.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0018.json +48 -42
- data/schemas/tlc/1.2.1/commands/M0019.json +61 -55
- data/schemas/tlc/1.2.1/commands/M0020.json +61 -55
- data/schemas/tlc/1.2.1/commands/M0021.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0022.json +194 -188
- data/schemas/tlc/1.2.1/commands/M0023.json +35 -29
- data/schemas/tlc/1.2.1/commands/M0103.json +51 -45
- data/schemas/tlc/1.2.1/commands/M0104.json +100 -94
- data/schemas/tlc/1.2.1/commands/command_requests.json +1525 -1
- data/schemas/tlc/1.2.1/defs/guards.json +19 -0
- data/schemas/tlc/1.2.1/statuses/S0033.json +2 -2
- data/schemas/tlc/1.2.1/sxl.yaml +77 -76
- data/schemas/tlc/1.2.1/sxl_index.json +401 -397
- data/schemas/tlc/1.3.0/alarms/A0007.json +25 -19
- data/schemas/tlc/1.3.0/alarms/A0008.json +21 -15
- data/schemas/tlc/1.3.0/alarms/A0201.json +26 -20
- data/schemas/tlc/1.3.0/alarms/A0202.json +26 -20
- data/schemas/tlc/1.3.0/alarms/A0301.json +69 -63
- data/schemas/tlc/1.3.0/alarms/A0302.json +87 -81
- data/schemas/tlc/1.3.0/alarms/A0303.json +70 -64
- data/schemas/tlc/1.3.0/alarms/A0304.json +88 -82
- data/schemas/tlc/1.3.0/commands/M0001.json +66 -60
- data/schemas/tlc/1.3.0/commands/M0002.json +48 -42
- data/schemas/tlc/1.3.0/commands/M0003.json +48 -42
- data/schemas/tlc/1.3.0/commands/M0004.json +35 -29
- data/schemas/tlc/1.3.0/commands/M0005.json +48 -42
- data/schemas/tlc/1.3.0/commands/M0006.json +48 -42
- data/schemas/tlc/1.3.0/commands/M0007.json +35 -29
- data/schemas/tlc/1.3.0/commands/M0008.json +61 -55
- data/schemas/tlc/1.3.0/commands/M0010.json +35 -29
- data/schemas/tlc/1.3.0/commands/M0011.json +35 -29
- data/schemas/tlc/1.3.0/commands/M0012.json +35 -29
- data/schemas/tlc/1.3.0/commands/M0013.json +36 -30
- data/schemas/tlc/1.3.0/commands/M0014.json +48 -42
- data/schemas/tlc/1.3.0/commands/M0015.json +48 -42
- data/schemas/tlc/1.3.0/commands/M0016.json +35 -29
- data/schemas/tlc/1.3.0/commands/M0017.json +35 -29
- data/schemas/tlc/1.3.0/commands/M0018.json +48 -42
- data/schemas/tlc/1.3.0/commands/M0019.json +61 -55
- data/schemas/tlc/1.3.0/commands/M0020.json +61 -55
- data/schemas/tlc/1.3.0/commands/M0021.json +35 -29
- data/schemas/tlc/1.3.0/commands/M0022.json +195 -189
- data/schemas/tlc/1.3.0/commands/M0023.json +35 -29
- data/schemas/tlc/1.3.0/commands/M0024.json +21 -15
- data/schemas/tlc/1.3.0/commands/M0103.json +51 -45
- data/schemas/tlc/1.3.0/commands/M0104.json +100 -94
- data/schemas/tlc/1.3.0/commands/command_requests.json +1559 -1
- data/schemas/tlc/1.3.0/defs/guards.json +19 -0
- data/schemas/tlc/1.3.0/statuses/S0001.json +4 -4
- data/schemas/tlc/1.3.0/statuses/S0005.json +3 -3
- data/schemas/tlc/1.3.0/statuses/S0006.json +2 -2
- data/schemas/tlc/1.3.0/statuses/S0007.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0008.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0009.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0010.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0011.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0012.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0013.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0014.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0015.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0016.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0017.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0019.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0020.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0025.json +2 -2
- data/schemas/tlc/1.3.0/statuses/S0027.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0032.json +2 -2
- data/schemas/tlc/1.3.0/statuses/S0033.json +5 -5
- data/schemas/tlc/1.3.0/statuses/S0034.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0035.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0091.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0092.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0096.json +6 -6
- data/schemas/tlc/1.3.0/statuses/S0201.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0202.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0203.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0204.json +9 -9
- data/schemas/tlc/1.3.0/statuses/S0205.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0206.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0207.json +1 -1
- data/schemas/tlc/1.3.0/statuses/S0208.json +9 -9
- data/schemas/tlc/1.3.0/sxl_index.json +408 -402
- metadata +11 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 24b3e3fbb36a769054061eeb10f070096ec576468f20196932d43d1e4c3915c7
|
|
4
|
+
data.tar.gz: 3b6830d24f1225b721e21680b35c71c8dc508eb5bd6d684c595c71256c207ea0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1208ed7baf84741848f268c28a66d5410afdd172f8fd1f1010280816d8f16cc184870b3f979fcaa6e566f5746fd164608504a9bc00c9447f36bdfac77b457f34
|
|
7
|
+
data.tar.gz: b5c71f21c3369585b7740d85669a9fd4b3ebb030697984faeceb43f280fe9f6d86f6f78b3a005f0c133ceee50daef748868f6206c380726beb883fdfdbb1f295
|
data/.github/workflows/sus.yaml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -685,3 +685,17 @@ Initial release.
|
|
|
685
685
|
|
|
686
686
|
## 0.46.0
|
|
687
687
|
- add outgoing message buffering for sites
|
|
688
|
+
|
|
689
|
+
## 0.47.0
|
|
690
|
+
- add cli command for checking configs
|
|
691
|
+
- tighten config schemas
|
|
692
|
+
|
|
693
|
+
## 0.48.0
|
|
694
|
+
- implement RSMP Core 3.3.0 connection roles, allowing a site to listen and a supervisor to connect
|
|
695
|
+
- enforce 3.3.0 command message rules, including one command code per CommandRequest/CommandResponse
|
|
696
|
+
- update TLC schemas with JSON-native values and required/optional command arguments
|
|
697
|
+
- add argument types to SXL indexes
|
|
698
|
+
- encode/decode message values based on SXL type defintions
|
|
699
|
+
- return `unknown` for unimplemented commands and statuses instead of rejecting the whole request
|
|
700
|
+
- omit legacy NTS message attributes from outgoing Core 3.3.0 messages
|
|
701
|
+
- `CORE_VERSION` or `SXLS` environment variables with command line options `--core` and `--sxls`
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rsmp (0.
|
|
4
|
+
rsmp (0.48.0)
|
|
5
5
|
async (~> 2.39)
|
|
6
6
|
colorize (~> 1.1)
|
|
7
7
|
io-endpoint (~> 0.17)
|
|
@@ -15,7 +15,7 @@ GEM
|
|
|
15
15
|
remote: https://rubygems.org/
|
|
16
16
|
specs:
|
|
17
17
|
ast (2.4.3)
|
|
18
|
-
async (2.
|
|
18
|
+
async (2.40.0)
|
|
19
19
|
console (~> 1.29)
|
|
20
20
|
fiber-annotation
|
|
21
21
|
io-event (~> 1.11)
|
|
@@ -33,9 +33,9 @@ GEM
|
|
|
33
33
|
fiber-storage (1.0.1)
|
|
34
34
|
hana (1.3.7)
|
|
35
35
|
io-endpoint (0.17.2)
|
|
36
|
-
io-event (1.16.
|
|
37
|
-
io-stream (0.13.
|
|
38
|
-
json (2.
|
|
36
|
+
io-event (1.16.4)
|
|
37
|
+
io-stream (0.13.1)
|
|
38
|
+
json (2.20.0)
|
|
39
39
|
json_schemer (2.5.0)
|
|
40
40
|
bigdecimal
|
|
41
41
|
hana (~> 1.3)
|
data/README.md
CHANGED
|
@@ -28,7 +28,7 @@ require 'rsmp'
|
|
|
28
28
|
RSMP::Supervisor.new.start # run supervisor until Ctlr-C is pressed
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
By default, a site will try to connect to a single supervisor on localhost 127.0.0.1, port 12111. By default, a supervisor will listen for sites on port 12111 and accept any site.
|
|
32
32
|
|
|
33
33
|
You can pass options to control ip adresseses, ports, logging and other behaviour:
|
|
34
34
|
|
|
@@ -144,6 +144,8 @@ sxls:
|
|
|
144
144
|
tlc: '1.3.0'
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
+
See [configuration](documentation/configuration.md) for connection-role examples and other YAML settings.
|
|
148
|
+
|
|
147
149
|
## Command-line tool
|
|
148
150
|
Tools for easily running RSMP supervisors and sites. The binary is called ```rsmp```.
|
|
149
151
|
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# RSMP CLI
|
|
2
|
+
|
|
3
|
+
The `rsmp` command can run a site, run a supervisor, validate config files, generate JSON Schemas from an SXL, and print the gem version.
|
|
4
|
+
|
|
5
|
+
Use help at any level:
|
|
6
|
+
|
|
7
|
+
```console
|
|
8
|
+
$ rsmp help
|
|
9
|
+
$ rsmp help site
|
|
10
|
+
$ rsmp help supervisor
|
|
11
|
+
$ rsmp help config check
|
|
12
|
+
$ rsmp help schema generate
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick Examples
|
|
16
|
+
|
|
17
|
+
Run a TLC site that connects to the default supervisor endpoint, `127.0.0.1:12111`:
|
|
18
|
+
|
|
19
|
+
```console
|
|
20
|
+
$ rsmp site
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Run a supervisor that listens on the default port, `12111`:
|
|
24
|
+
|
|
25
|
+
```console
|
|
26
|
+
$ rsmp supervisor
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Run both with explicit config files:
|
|
30
|
+
|
|
31
|
+
```console
|
|
32
|
+
$ rsmp supervisor --config config/supervisor.yaml
|
|
33
|
+
$ rsmp site --config config/tlc.yaml
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Run a site against a specific supervisor endpoint:
|
|
37
|
+
|
|
38
|
+
```console
|
|
39
|
+
$ rsmp site --supervisors 192.0.2.10:12111
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Show raw JSON messages in the log:
|
|
43
|
+
|
|
44
|
+
```console
|
|
45
|
+
$ rsmp site --json
|
|
46
|
+
$ rsmp supervisor --json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Write logs to a file:
|
|
50
|
+
|
|
51
|
+
```console
|
|
52
|
+
$ rsmp supervisor --log log/supervisor.log
|
|
53
|
+
$ rsmp site --log log/site.log
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Validate config files before starting anything:
|
|
57
|
+
|
|
58
|
+
```console
|
|
59
|
+
$ rsmp config check config/tlc.yaml --type tlc
|
|
60
|
+
$ rsmp config check config/supervisor.yaml --type supervisor
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Generate JSON Schema files from an SXL YAML file:
|
|
64
|
+
|
|
65
|
+
```console
|
|
66
|
+
$ rsmp schema generate --in schemas/tlc/1.3.0/sxl.yaml --out /tmp/tlc-schema
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Configuration Files
|
|
70
|
+
|
|
71
|
+
Most real runs should use YAML config files. The CLI accepts `--config`, `-c`, and `--options` as aliases:
|
|
72
|
+
|
|
73
|
+
```console
|
|
74
|
+
$ rsmp site -c config/tlc.yaml
|
|
75
|
+
$ rsmp supervisor --options config/supervisor.yaml
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
CLI options override or add to settings loaded from the config file. For example, this loads `config/tlc.yaml` but changes the site id and supervisor endpoint for this run:
|
|
79
|
+
|
|
80
|
+
```console
|
|
81
|
+
$ rsmp site -c config/tlc.yaml --id RN+SI0420 --supervisors 127.0.0.1:13111
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Core and SXL version overrides are command-line options.
|
|
85
|
+
|
|
86
|
+
See `documentation/configuration.md` for the YAML format.
|
|
87
|
+
|
|
88
|
+
## Commands
|
|
89
|
+
|
|
90
|
+
### `rsmp site`
|
|
91
|
+
|
|
92
|
+
Runs an RSMP site. The default site type is `tlc`, so this starts a TLC traffic controller site implementation.
|
|
93
|
+
|
|
94
|
+
```console
|
|
95
|
+
$ rsmp site
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Common options:
|
|
99
|
+
|
|
100
|
+
- `--config PATH`, `-c PATH`, `--options PATH`: load site settings from a YAML file.
|
|
101
|
+
- `--id ID`, `-i ID`: set the site id.
|
|
102
|
+
- `--supervisors LIST`, `-s LIST`: set one or more supervisor endpoints.
|
|
103
|
+
- `--core VERSION`: set the RSMP Core version.
|
|
104
|
+
- `--sxls LIST`: set the SXLs announced by the site as a comma-separated `name:version` list.
|
|
105
|
+
- `--type tlc`, `-t tlc`: choose the site type. Currently `tlc` is the supported CLI type.
|
|
106
|
+
- `--log PATH`, `-l PATH`: write log output to a file.
|
|
107
|
+
- `--json`, `-j`: include raw JSON messages in the log.
|
|
108
|
+
|
|
109
|
+
The `--supervisors` option accepts a comma-separated list:
|
|
110
|
+
|
|
111
|
+
```console
|
|
112
|
+
$ rsmp site --supervisors 127.0.0.1:12111,192.0.2.10:12111
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If the IP address is omitted, `127.0.0.1` is used:
|
|
116
|
+
|
|
117
|
+
```console
|
|
118
|
+
$ rsmp site --supervisors :13111
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
If the port is omitted, the configured site default is used:
|
|
122
|
+
|
|
123
|
+
```console
|
|
124
|
+
$ rsmp site --supervisors 127.0.0.1
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Use `--sxls` to specify several SXLs for a site:
|
|
128
|
+
|
|
129
|
+
```console
|
|
130
|
+
$ rsmp site --sxls tlc:1.3.0,vms:1.0.0
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Example with explicit core and SXL versions:
|
|
134
|
+
|
|
135
|
+
```console
|
|
136
|
+
$ rsmp site -c config/tlc.yaml --core 3.3.0 --sxls tlc:1.3.0
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### `rsmp supervisor`
|
|
140
|
+
|
|
141
|
+
Runs an RSMP supervisor. By default it listens for site connections on port `12111`.
|
|
142
|
+
|
|
143
|
+
```console
|
|
144
|
+
$ rsmp supervisor
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Common options:
|
|
148
|
+
|
|
149
|
+
- `--config PATH`, `-c PATH`, `--options PATH`: load supervisor settings from a YAML file.
|
|
150
|
+
- `--id ID`, `-i ID`: set the supervisor site id.
|
|
151
|
+
- `--ip ADDRESS`: set the listen address.
|
|
152
|
+
- `--port PORT`, `-p PORT`: set the listen port.
|
|
153
|
+
- `--core VERSION`: override the accepted RSMP Core version.
|
|
154
|
+
- `--sxls LIST`: override SXL versions as a comma-separated `name:version` list.
|
|
155
|
+
- `--log PATH`, `-l PATH`: write log output to a file.
|
|
156
|
+
- `--json`, `-j`: include raw JSON messages in the log.
|
|
157
|
+
|
|
158
|
+
Example:
|
|
159
|
+
|
|
160
|
+
```console
|
|
161
|
+
$ rsmp supervisor --ip 0.0.0.0 --port 13111 --core 3.3.0 --sxls tlc:1.3.0 --json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
When `--core` or `--sxls` is used with the supervisor command, it overrides `default` and any configured `sites` entries for that run.
|
|
165
|
+
|
|
166
|
+
### `rsmp config check`
|
|
167
|
+
|
|
168
|
+
Validates one or more YAML config files without starting a site or supervisor.
|
|
169
|
+
|
|
170
|
+
```console
|
|
171
|
+
$ rsmp config check config/tlc.yaml
|
|
172
|
+
$ rsmp config check config/tlc.yaml config/supervisor.yaml
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Options:
|
|
176
|
+
|
|
177
|
+
- `--type TYPE`, `-t TYPE`: choose the config type. Supported values are `auto`, `site`, `tlc`, and `supervisor`.
|
|
178
|
+
|
|
179
|
+
The default type is `auto`. Auto-detection works when the config shape is clear. If the CLI cannot infer the type, pass `--type` explicitly:
|
|
180
|
+
|
|
181
|
+
```console
|
|
182
|
+
$ rsmp config check config/tlc.yaml --type tlc
|
|
183
|
+
$ rsmp config check config/supervisor.yaml --type supervisor
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Successful validation prints `OK` for each valid file. Invalid files print an error and the command exits with status `1`.
|
|
187
|
+
|
|
188
|
+
Common validation errors include:
|
|
189
|
+
|
|
190
|
+
- The file does not exist.
|
|
191
|
+
- The path is a directory.
|
|
192
|
+
- The file is not YAML.
|
|
193
|
+
- A setting has the wrong type.
|
|
194
|
+
- A config key is not allowed by the schema.
|
|
195
|
+
|
|
196
|
+
### `rsmp schema generate`
|
|
197
|
+
|
|
198
|
+
Generates JSON Schema files from an `sxl.yaml` file.
|
|
199
|
+
|
|
200
|
+
```console
|
|
201
|
+
$ rsmp schema generate --in schemas/tlc/1.3.0/sxl.yaml --out /tmp/tlc-schema
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Options:
|
|
205
|
+
|
|
206
|
+
- `--in PATH`, `-i PATH`: path to the input `sxl.yaml`. Defaults to `sxl.yaml`.
|
|
207
|
+
- `--out PATH`, `-o PATH`: output directory. Defaults to the current directory.
|
|
208
|
+
|
|
209
|
+
The command writes the generated status, command, alarm, root schema, definitions, and `sxl_index.json` files to the output directory.
|
|
210
|
+
|
|
211
|
+
If the input file is missing, the command prints an error and exits with status `1`.
|
|
212
|
+
|
|
213
|
+
### `rsmp version`
|
|
214
|
+
|
|
215
|
+
Prints the installed `rsmp` gem version:
|
|
216
|
+
|
|
217
|
+
```console
|
|
218
|
+
$ rsmp version
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Exit Status
|
|
222
|
+
|
|
223
|
+
Commands return status `0` on success. Validation and argument errors return a non-zero status.
|
|
224
|
+
|
|
225
|
+
Long-running commands such as `rsmp site` and `rsmp supervisor` run until interrupted or until startup fails.
|
|
@@ -38,6 +38,7 @@ Both `--config` and `--options` are accepted as aliases.
|
|
|
38
38
|
|
|
39
39
|
```yaml
|
|
40
40
|
site_id: RN+SI0001
|
|
41
|
+
connection_role: client
|
|
41
42
|
supervisors:
|
|
42
43
|
- ip: 127.0.0.1
|
|
43
44
|
port: 12111
|
|
@@ -46,14 +47,60 @@ sxls:
|
|
|
46
47
|
components:
|
|
47
48
|
main:
|
|
48
49
|
TC:
|
|
50
|
+
message_buffer:
|
|
51
|
+
max_messages: 10000
|
|
52
|
+
statuses: true
|
|
49
53
|
log:
|
|
50
54
|
json: true
|
|
51
55
|
```
|
|
52
56
|
|
|
57
|
+
`connection_role` controls which side opens the TCP connection:
|
|
58
|
+
|
|
59
|
+
- `client` means the node connects to configured remote endpoints.
|
|
60
|
+
- `server` means the node listens for incoming connections.
|
|
61
|
+
|
|
62
|
+
Configurable connection roles are available from Core 3.3.0.
|
|
63
|
+
|
|
64
|
+
For sites, `client` is the default and uses the `supervisors` endpoint list. A site in `server` role listens on `ip` and `port` instead.
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
site_id: RN+SI0001
|
|
68
|
+
connection_role: server
|
|
69
|
+
ip: 0.0.0.0
|
|
70
|
+
port: 12111
|
|
71
|
+
core_version: "3.3.0"
|
|
72
|
+
sxls:
|
|
73
|
+
tlc: "1.3.0"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Message Buffer
|
|
77
|
+
|
|
78
|
+
Sites buffer outgoing alarm and aggregated status messages while a supervisor connection is down. Status updates are buffered according to `message_buffer.statuses`, which defaults to `true`.
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
message_buffer:
|
|
82
|
+
max_messages: 10000
|
|
83
|
+
statuses: true
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`statuses: true` buffers all subscribed status updates during communication disruption. To buffer only selected statuses, provide selectors:
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
message_buffer:
|
|
90
|
+
statuses:
|
|
91
|
+
- sCI: S0001
|
|
92
|
+
n: signalgroupstatus
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Use `statuses: false` or an empty list to avoid buffering status updates. Subscriptions for statuses that are not buffered are removed when the connection is lost.
|
|
96
|
+
|
|
97
|
+
The current implementation uses an in-memory buffer per supervisor connection. Buffered messages survive reconnects while the process keeps running, but are lost if the process exits, crashes, or the host loses power. The RSMP core specification requires the outgoing communication buffer to survive communication failure and power outage, so this is not yet a complete persistent buffer implementation.
|
|
98
|
+
|
|
53
99
|
## Example: supervisor YAML
|
|
54
100
|
|
|
55
101
|
```yaml
|
|
56
102
|
port: 12111
|
|
103
|
+
connection_role: server
|
|
57
104
|
default:
|
|
58
105
|
sxls:
|
|
59
106
|
tlc: "1.3.0"
|
|
@@ -79,6 +126,22 @@ sites:
|
|
|
79
126
|
|
|
80
127
|
Per-site configuration follows the supervisor-side site schema (`lib/rsmp/options/schemas/supervisor_site.json`). Each site entry can define an `sxls` map, or inherit it from `default`. The SXL name `core` is reserved for the RSMP core schema and cannot be used as an SXL key.
|
|
81
128
|
|
|
129
|
+
For supervisors, `server` is the default and listens on `ip`/`port`. A supervisor in `client` role connects out to the endpoints listed under each configured site. The outbound endpoint list uses the existing `supervisors` key in the per-site settings:
|
|
130
|
+
|
|
131
|
+
```yaml
|
|
132
|
+
connection_role: client
|
|
133
|
+
sites:
|
|
134
|
+
RN+SI0001:
|
|
135
|
+
core_version: "3.3.0"
|
|
136
|
+
sxls:
|
|
137
|
+
tlc: "1.3.0"
|
|
138
|
+
supervisors:
|
|
139
|
+
- ip: 127.0.0.1
|
|
140
|
+
port: 12111
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
This reversed setup is used when the site listens and the supervision system initiates the connection.
|
|
144
|
+
|
|
82
145
|
## Supervisor settings
|
|
83
146
|
|
|
84
147
|
The following lists the top-level supervisor settings and the keys available for per-site configuration under `sites`.
|
|
@@ -87,6 +150,7 @@ Top-level supervisor settings
|
|
|
87
150
|
|
|
88
151
|
- `port`: integer|string - TCP port the supervisor listens on (default: `12111`).
|
|
89
152
|
- `ip`: string - address to bind to.
|
|
153
|
+
- `connection_role`: string - `server` to listen for sites, or `client` to connect to configured site endpoints (default: `server`).
|
|
90
154
|
- `ips`: string or array - `'all'` or a list of allowed IP addresses.
|
|
91
155
|
- `site_id`: string - optional site identifier for the supervisor itself.
|
|
92
156
|
- `max_sites`: integer - limit concurrent connected sites.
|
|
@@ -119,6 +183,25 @@ Common per-site keys
|
|
|
119
183
|
- `skip_validation` (array[string]): list of message types to skip JSON schema validation for this site.
|
|
120
184
|
- `security_codes` (object): map of security code levels to secrets.
|
|
121
185
|
|
|
186
|
+
## Site settings
|
|
187
|
+
|
|
188
|
+
The following lists the top-level site settings.
|
|
189
|
+
|
|
190
|
+
- `site_id` (string): site identifier sent in the Version message.
|
|
191
|
+
- `type` (string): optional site type.
|
|
192
|
+
- `connection_role` (string): `client` to connect to supervisors, or `server` to listen for supervisor connections (default: `client`).
|
|
193
|
+
- `ip` (string): bind address when `connection_role` is `server` (default: `0.0.0.0`).
|
|
194
|
+
- `port` (integer|string): listen port when `connection_role` is `server`. If omitted, it defaults to the first configured supervisor port.
|
|
195
|
+
- `supervisors` (array): supervisor endpoints used when `connection_role` is `client`.
|
|
196
|
+
- `sxls` (object): SXL versions used by the site, keyed by SXL name.
|
|
197
|
+
- `core_version` (string): RSMP Core version to use.
|
|
198
|
+
- `intervals` (object): timer settings - `timer`, `watchdog`, `reconnect`.
|
|
199
|
+
- `timeouts` (object): timeout settings - `watchdog`, `acknowledgement`.
|
|
200
|
+
- `send_after_connect` (boolean): whether to send messages after connect without waiting for additional events.
|
|
201
|
+
- `message_buffer` (object): outgoing message buffer settings.
|
|
202
|
+
- `components` (object): component definitions.
|
|
203
|
+
- `security_codes` (object): map of security code levels to secrets.
|
|
204
|
+
|
|
122
205
|
### TLC-specific settings
|
|
123
206
|
|
|
124
207
|
TLC-specific settings are used when a site uses the `tlc` SXL and include:
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module RSMP
|
|
2
|
+
class CLI < Thor
|
|
3
|
+
# Private helpers for loading CLI configuration files.
|
|
4
|
+
module Configuration
|
|
5
|
+
private
|
|
6
|
+
|
|
7
|
+
def load_site_configuration
|
|
8
|
+
load_configuration(site_options_class)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def load_supervisor_configuration
|
|
12
|
+
load_configuration(RSMP::Supervisor::Options)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def load_configuration(options_class)
|
|
16
|
+
settings = {}
|
|
17
|
+
log_settings = { 'active' => true }
|
|
18
|
+
return [settings, log_settings] unless options[:config]
|
|
19
|
+
|
|
20
|
+
options_object = options_class.load_file(options[:config])
|
|
21
|
+
settings = options_object.to_h
|
|
22
|
+
log_settings = log_settings.deep_merge(options_object.log_settings)
|
|
23
|
+
[settings, log_settings]
|
|
24
|
+
rescue RSMP::ConfigurationError => e
|
|
25
|
+
puts "Error: #{e}"
|
|
26
|
+
exit
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/lib/rsmp/cli.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'thor'
|
|
2
2
|
require_relative '../rsmp'
|
|
3
|
+
require_relative 'cli/configuration'
|
|
3
4
|
|
|
4
5
|
module RSMP
|
|
5
6
|
# CLI subcommands for SXL schema operations.
|
|
@@ -20,8 +21,36 @@ module RSMP
|
|
|
20
21
|
end
|
|
21
22
|
end
|
|
22
23
|
|
|
24
|
+
# CLI subcommands for RSMP configuration validation.
|
|
25
|
+
class ConfigCLI < Thor
|
|
26
|
+
namespace :config
|
|
27
|
+
desc 'check PATH...', 'Validate RSMP site or supervisor config files'
|
|
28
|
+
method_option :type, type: :string, aliases: '-t', default: 'auto',
|
|
29
|
+
enum: ['auto'] + RSMP::Config.types,
|
|
30
|
+
banner: 'Config type: auto, site, tlc or supervisor'
|
|
31
|
+
def check(*paths)
|
|
32
|
+
if paths.empty?
|
|
33
|
+
puts 'Error: config check requires at least one path'
|
|
34
|
+
exit 1
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
valid = true
|
|
38
|
+
paths.each do |path|
|
|
39
|
+
RSMP::Config.load_file(path, type: options[:type])
|
|
40
|
+
puts 'OK'
|
|
41
|
+
rescue RSMP::ConfigurationError => e
|
|
42
|
+
valid = false
|
|
43
|
+
puts "Error: #{e.message}"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
exit 1 unless valid
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
23
50
|
# CLI commands for running RSMP site and supervisor.
|
|
24
51
|
class CLI < Thor
|
|
52
|
+
include Configuration
|
|
53
|
+
|
|
25
54
|
desc 'version', 'Show version'
|
|
26
55
|
def version
|
|
27
56
|
puts RSMP::VERSION
|
|
@@ -33,6 +62,7 @@ module RSMP
|
|
|
33
62
|
method_option :supervisors, type: :string, aliases: '-s',
|
|
34
63
|
banner: 'ip:port,... list of supervisor to connect to'
|
|
35
64
|
method_option :core, type: :string, banner: "Core version: [#{RSMP::Schema.core_versions.join(' ')}]", enum: RSMP::Schema.core_versions
|
|
65
|
+
method_option :sxls, type: :string, banner: 'SXL versions as name:version,...'
|
|
36
66
|
method_option :type, type: :string, aliases: '-t', banner: 'Type of site: [tlc]', enum: ['tlc'],
|
|
37
67
|
default: 'tlc'
|
|
38
68
|
method_option :log, type: :string, aliases: '-l', banner: 'Path to log file'
|
|
@@ -58,6 +88,7 @@ module RSMP
|
|
|
58
88
|
method_option :ip, type: :string, banner: 'IP address to listen on'
|
|
59
89
|
method_option :port, type: :string, aliases: '-p', banner: 'Port to listen on'
|
|
60
90
|
method_option :core, type: :string, banner: "Core version: [#{RSMP::Schema.core_versions.join(' ')}]", enum: RSMP::Schema.core_versions
|
|
91
|
+
method_option :sxls, type: :string, banner: 'Default SXL versions as name:version,...'
|
|
61
92
|
method_option :log, type: :string, aliases: '-l', banner: 'Path to log file'
|
|
62
93
|
method_option :json, type: :boolean, aliases: '-j', banner: 'Show JSON messages in log'
|
|
63
94
|
def supervisor
|
|
@@ -69,26 +100,7 @@ module RSMP
|
|
|
69
100
|
end
|
|
70
101
|
|
|
71
102
|
register SchemaCLI, 'schema', 'schema COMMAND', 'SXL schema commands'
|
|
72
|
-
|
|
73
|
-
no_commands do
|
|
74
|
-
def load_site_configuration
|
|
75
|
-
settings = {}
|
|
76
|
-
log_settings = { 'active' => true }
|
|
77
|
-
|
|
78
|
-
return [settings, log_settings] unless options[:config]
|
|
79
|
-
|
|
80
|
-
begin
|
|
81
|
-
options_object = site_options_class.load_file(options[:config])
|
|
82
|
-
settings = options_object.to_h
|
|
83
|
-
log_settings = log_settings.deep_merge(options_object.log_settings)
|
|
84
|
-
rescue RSMP::ConfigurationError => e
|
|
85
|
-
puts "Error: #{e}"
|
|
86
|
-
exit
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
[settings, log_settings]
|
|
90
|
-
end
|
|
91
|
-
end
|
|
103
|
+
register ConfigCLI, 'config', 'config COMMAND', 'Configuration commands'
|
|
92
104
|
|
|
93
105
|
private
|
|
94
106
|
|
|
@@ -109,8 +121,8 @@ module RSMP
|
|
|
109
121
|
|
|
110
122
|
def apply_basic_site_options(settings)
|
|
111
123
|
settings['site_id'] = options[:id] if options[:id]
|
|
112
|
-
settings['core_version'] = options[:core]
|
|
113
|
-
settings['sxls'] = parse_sxls(
|
|
124
|
+
settings['core_version'] = options[:core] if options[:core]
|
|
125
|
+
settings['sxls'] = parse_sxls(options[:sxls]) if options[:sxls]
|
|
114
126
|
end
|
|
115
127
|
|
|
116
128
|
def parse_sxls(value)
|
|
@@ -196,27 +208,9 @@ module RSMP
|
|
|
196
208
|
end
|
|
197
209
|
end
|
|
198
210
|
|
|
199
|
-
def load_supervisor_configuration
|
|
200
|
-
settings = {}
|
|
201
|
-
log_settings = { 'active' => true }
|
|
202
|
-
|
|
203
|
-
return [settings, log_settings] unless options[:config]
|
|
204
|
-
|
|
205
|
-
begin
|
|
206
|
-
options_object = RSMP::Supervisor::Options.load_file(options[:config])
|
|
207
|
-
settings = options_object.to_h
|
|
208
|
-
log_settings = log_settings.deep_merge(options_object.log_settings)
|
|
209
|
-
rescue RSMP::ConfigurationError => e
|
|
210
|
-
puts "Error: #{e}"
|
|
211
|
-
exit
|
|
212
|
-
end
|
|
213
|
-
|
|
214
|
-
[settings, log_settings]
|
|
215
|
-
end
|
|
216
|
-
|
|
217
211
|
def apply_supervisor_options(settings, log_settings)
|
|
218
212
|
apply_basic_supervisor_options(settings)
|
|
219
|
-
|
|
213
|
+
apply_version_options(settings)
|
|
220
214
|
apply_log_options(log_settings)
|
|
221
215
|
end
|
|
222
216
|
|
|
@@ -226,11 +220,17 @@ module RSMP
|
|
|
226
220
|
settings['port'] = options[:port] if options[:port]
|
|
227
221
|
end
|
|
228
222
|
|
|
229
|
-
def
|
|
230
|
-
return unless options[:core]
|
|
223
|
+
def apply_version_options(settings)
|
|
224
|
+
return unless options[:core] || options[:sxls]
|
|
225
|
+
|
|
226
|
+
sxls = parse_sxls(options[:sxls]) if options[:sxls]
|
|
227
|
+
apply_version_overrides(settings['default'] ||= {}, sxls)
|
|
228
|
+
(settings['sites'] || {}).each_value { |site_settings| apply_version_overrides(site_settings, sxls) }
|
|
229
|
+
end
|
|
231
230
|
|
|
232
|
-
|
|
233
|
-
settings['
|
|
231
|
+
def apply_version_overrides(settings, sxls)
|
|
232
|
+
settings['core_version'] = options[:core] if options[:core]
|
|
233
|
+
settings['sxls'] = sxls if sxls
|
|
234
234
|
end
|
|
235
235
|
|
|
236
236
|
def apply_log_options(log_settings)
|
|
@@ -9,16 +9,25 @@ module RSMP
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def match_value?(item)
|
|
12
|
-
return true unless @want
|
|
12
|
+
return true unless @want.key?('v')
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
want = @want['v']
|
|
15
|
+
got = item['v']
|
|
16
|
+
if want.is_a? Regexp
|
|
17
|
+
return false unless regex_match?(got, want)
|
|
18
|
+
elsif got != want
|
|
17
19
|
return false
|
|
18
20
|
end
|
|
19
21
|
true
|
|
20
22
|
end
|
|
21
23
|
|
|
24
|
+
def regex_match?(got, want)
|
|
25
|
+
return got =~ want if got.is_a?(String)
|
|
26
|
+
return got.any? { |item| item.is_a?(String) && item =~ want } if got.is_a?(Array)
|
|
27
|
+
|
|
28
|
+
false
|
|
29
|
+
end
|
|
30
|
+
|
|
22
31
|
def match(item)
|
|
23
32
|
code_match = match_code(item)
|
|
24
33
|
return code_match if code_match.nil?
|