rsmp 0.47.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 +10 -0
- data/Gemfile.lock +5 -5
- data/README.md +3 -1
- data/documentation/cli.md +225 -0
- data/documentation/configuration.md +57 -0
- data/lib/rsmp/cli/configuration.rb +30 -0
- data/lib/rsmp/cli.rb +18 -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/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/schemas/site.json +3 -0
- data/lib/rsmp/options/schemas/supervisor.json +1 -0
- data/lib/rsmp/options/site_options.rb +30 -21
- 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/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 +4 -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 +8 -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
|
@@ -689,3 +689,13 @@ Initial release.
|
|
|
689
689
|
## 0.47.0
|
|
690
690
|
- add cli command for checking configs
|
|
691
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
|
|
@@ -53,6 +54,25 @@ log:
|
|
|
53
54
|
json: true
|
|
54
55
|
```
|
|
55
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
|
+
|
|
56
76
|
## Message Buffer
|
|
57
77
|
|
|
58
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`.
|
|
@@ -80,6 +100,7 @@ The current implementation uses an in-memory buffer per supervisor connection. B
|
|
|
80
100
|
|
|
81
101
|
```yaml
|
|
82
102
|
port: 12111
|
|
103
|
+
connection_role: server
|
|
83
104
|
default:
|
|
84
105
|
sxls:
|
|
85
106
|
tlc: "1.3.0"
|
|
@@ -105,6 +126,22 @@ sites:
|
|
|
105
126
|
|
|
106
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.
|
|
107
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
|
+
|
|
108
145
|
## Supervisor settings
|
|
109
146
|
|
|
110
147
|
The following lists the top-level supervisor settings and the keys available for per-site configuration under `sites`.
|
|
@@ -113,6 +150,7 @@ Top-level supervisor settings
|
|
|
113
150
|
|
|
114
151
|
- `port`: integer|string - TCP port the supervisor listens on (default: `12111`).
|
|
115
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`).
|
|
116
154
|
- `ips`: string or array - `'all'` or a list of allowed IP addresses.
|
|
117
155
|
- `site_id`: string - optional site identifier for the supervisor itself.
|
|
118
156
|
- `max_sites`: integer - limit concurrent connected sites.
|
|
@@ -145,6 +183,25 @@ Common per-site keys
|
|
|
145
183
|
- `skip_validation` (array[string]): list of message types to skip JSON schema validation for this site.
|
|
146
184
|
- `security_codes` (object): map of security code levels to secrets.
|
|
147
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
|
+
|
|
148
205
|
### TLC-specific settings
|
|
149
206
|
|
|
150
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.
|
|
@@ -48,6 +49,8 @@ module RSMP
|
|
|
48
49
|
|
|
49
50
|
# CLI commands for running RSMP site and supervisor.
|
|
50
51
|
class CLI < Thor
|
|
52
|
+
include Configuration
|
|
53
|
+
|
|
51
54
|
desc 'version', 'Show version'
|
|
52
55
|
def version
|
|
53
56
|
puts RSMP::VERSION
|
|
@@ -59,6 +62,7 @@ module RSMP
|
|
|
59
62
|
method_option :supervisors, type: :string, aliases: '-s',
|
|
60
63
|
banner: 'ip:port,... list of supervisor to connect to'
|
|
61
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,...'
|
|
62
66
|
method_option :type, type: :string, aliases: '-t', banner: 'Type of site: [tlc]', enum: ['tlc'],
|
|
63
67
|
default: 'tlc'
|
|
64
68
|
method_option :log, type: :string, aliases: '-l', banner: 'Path to log file'
|
|
@@ -84,6 +88,7 @@ module RSMP
|
|
|
84
88
|
method_option :ip, type: :string, banner: 'IP address to listen on'
|
|
85
89
|
method_option :port, type: :string, aliases: '-p', banner: 'Port to listen on'
|
|
86
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,...'
|
|
87
92
|
method_option :log, type: :string, aliases: '-l', banner: 'Path to log file'
|
|
88
93
|
method_option :json, type: :boolean, aliases: '-j', banner: 'Show JSON messages in log'
|
|
89
94
|
def supervisor
|
|
@@ -97,26 +102,6 @@ module RSMP
|
|
|
97
102
|
register SchemaCLI, 'schema', 'schema COMMAND', 'SXL schema commands'
|
|
98
103
|
register ConfigCLI, 'config', 'config COMMAND', 'Configuration commands'
|
|
99
104
|
|
|
100
|
-
no_commands do
|
|
101
|
-
def load_site_configuration
|
|
102
|
-
settings = {}
|
|
103
|
-
log_settings = { 'active' => true }
|
|
104
|
-
|
|
105
|
-
return [settings, log_settings] unless options[:config]
|
|
106
|
-
|
|
107
|
-
begin
|
|
108
|
-
options_object = site_options_class.load_file(options[:config])
|
|
109
|
-
settings = options_object.to_h
|
|
110
|
-
log_settings = log_settings.deep_merge(options_object.log_settings)
|
|
111
|
-
rescue RSMP::ConfigurationError => e
|
|
112
|
-
puts "Error: #{e}"
|
|
113
|
-
exit
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
[settings, log_settings]
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
|
|
120
105
|
private
|
|
121
106
|
|
|
122
107
|
def site_options_class
|
|
@@ -136,8 +121,8 @@ module RSMP
|
|
|
136
121
|
|
|
137
122
|
def apply_basic_site_options(settings)
|
|
138
123
|
settings['site_id'] = options[:id] if options[:id]
|
|
139
|
-
settings['core_version'] = options[:core]
|
|
140
|
-
settings['sxls'] = parse_sxls(
|
|
124
|
+
settings['core_version'] = options[:core] if options[:core]
|
|
125
|
+
settings['sxls'] = parse_sxls(options[:sxls]) if options[:sxls]
|
|
141
126
|
end
|
|
142
127
|
|
|
143
128
|
def parse_sxls(value)
|
|
@@ -223,27 +208,9 @@ module RSMP
|
|
|
223
208
|
end
|
|
224
209
|
end
|
|
225
210
|
|
|
226
|
-
def load_supervisor_configuration
|
|
227
|
-
settings = {}
|
|
228
|
-
log_settings = { 'active' => true }
|
|
229
|
-
|
|
230
|
-
return [settings, log_settings] unless options[:config]
|
|
231
|
-
|
|
232
|
-
begin
|
|
233
|
-
options_object = RSMP::Supervisor::Options.load_file(options[:config])
|
|
234
|
-
settings = options_object.to_h
|
|
235
|
-
log_settings = log_settings.deep_merge(options_object.log_settings)
|
|
236
|
-
rescue RSMP::ConfigurationError => e
|
|
237
|
-
puts "Error: #{e}"
|
|
238
|
-
exit
|
|
239
|
-
end
|
|
240
|
-
|
|
241
|
-
[settings, log_settings]
|
|
242
|
-
end
|
|
243
|
-
|
|
244
211
|
def apply_supervisor_options(settings, log_settings)
|
|
245
212
|
apply_basic_supervisor_options(settings)
|
|
246
|
-
|
|
213
|
+
apply_version_options(settings)
|
|
247
214
|
apply_log_options(log_settings)
|
|
248
215
|
end
|
|
249
216
|
|
|
@@ -253,11 +220,17 @@ module RSMP
|
|
|
253
220
|
settings['port'] = options[:port] if options[:port]
|
|
254
221
|
end
|
|
255
222
|
|
|
256
|
-
def
|
|
257
|
-
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
|
|
258
230
|
|
|
259
|
-
|
|
260
|
-
settings['
|
|
231
|
+
def apply_version_overrides(settings, sxls)
|
|
232
|
+
settings['core_version'] = options[:core] if options[:core]
|
|
233
|
+
settings['sxls'] = sxls if sxls
|
|
261
234
|
end
|
|
262
235
|
|
|
263
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?
|
|
@@ -11,15 +11,25 @@ module RSMP
|
|
|
11
11
|
|
|
12
12
|
def match_value?(item)
|
|
13
13
|
return false if @want['q'] && @want['q'] != item['q']
|
|
14
|
+
return true unless @want.key?('s')
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return false
|
|
16
|
+
want = @want['s']
|
|
17
|
+
got = item['s']
|
|
18
|
+
if want.is_a? Regexp
|
|
19
|
+
return false unless regex_match?(got, want)
|
|
20
|
+
elsif got != want
|
|
21
|
+
return false
|
|
19
22
|
end
|
|
20
23
|
true
|
|
21
24
|
end
|
|
22
25
|
|
|
26
|
+
def regex_match?(got, want)
|
|
27
|
+
return got =~ want if got.is_a?(String)
|
|
28
|
+
return got.any? { |item| item.is_a?(String) && item =~ want } if got.is_a?(Array)
|
|
29
|
+
|
|
30
|
+
false
|
|
31
|
+
end
|
|
32
|
+
|
|
23
33
|
def match(item)
|
|
24
34
|
return nil unless match_code(item)
|
|
25
35
|
|