From a18962c9bf9be58c5b2eeaf08a2759adf8e31b5f Mon Sep 17 00:00:00 2001 From: AdamRickards Date: Tue, 29 Sep 2026 07:35:01 +1000 Subject: [PATCH] schema+wire: SSH get_config.running from show running-config script (#324) running: new base wire/config.yaml (synthetic hm2configrunning; no MIB object backs a config-text dump) + wire/ssh/config.yaml overlay sourced from "show running-config script". parser: none is explicit and required: SSH.yaml's protocol-level default parser is dot_keys, which returns {} against the raw text. startup: deliberately unwired. "show startup-config" is rejected on the tested firmware, and the saved config can only be read by a mutating copy into running, which a read-only getter must not do. MOPS/SNMP unchanged (running stays empty). Offline (tested): SSH sends the command and returns the text; MOPS offline unchanged. Live sidecar proof: untested (pending). Open items: receipt redaction, parity/gold handling for an SSH-only field. Schema + wire YAML only. Draft for sidecar live proof; do not merge. Related #324 --- crude_engine/schemas/config.yaml | 11 +++++++++-- crude_engine/wire/config.yaml | 10 ++++++++++ crude_engine/wire/ssh/config.yaml | 20 ++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 crude_engine/wire/config.yaml create mode 100644 crude_engine/wire/ssh/config.yaml diff --git a/crude_engine/schemas/config.yaml b/crude_engine/schemas/config.yaml index 3ca228a..382d557 100644 --- a/crude_engine/schemas/config.yaml +++ b/crude_engine/schemas/config.yaml @@ -37,8 +37,15 @@ methods: set_watchdog: type: upsert attributes: - # 1.17 get_config is SSH execute (show running-config). No overlay in this ticket. - running: {} + # #324: running wired to SSH "show running-config script" (raw text, + # parser: none). SSH-only; MOPS/SNMP stay empty. + running: + wire: hm2configrunning + source: config + # startup stays unwired, deliberately: "show startup-config" is rejected as + # an invalid command on the tested firmware, and the saved (nvm) config can + # only be read by first loading it into running (a mutating copy), which a + # read-only getter must not do. Not a wiring gap; there is nothing to wire. startup: {} nvm: wire: hm2fmnvmstate diff --git a/crude_engine/wire/config.yaml b/crude_engine/wire/config.yaml new file mode 100644 index 0000000..f4e50f1 --- /dev/null +++ b/crude_engine/wire/config.yaml @@ -0,0 +1,10 @@ +version: "2.9.0" +feature: config +description: "Config management — running-config text blob. SSH-only: no SNMP/MOPS equivalent exists for a raw config-text dump (#324)." + +attributes: + # Synthetic identifier — no real HM2 MIB object backs this (there is no + # SNMP/MOPS way to fetch config as text). Named to match house hm2* + # convention for readability, not because it's a real OID. + hm2configrunning: + type: string diff --git a/crude_engine/wire/ssh/config.yaml b/crude_engine/wire/ssh/config.yaml new file mode 100644 index 0000000..6e23811 --- /dev/null +++ b/crude_engine/wire/ssh/config.yaml @@ -0,0 +1,20 @@ +version: "2.9.0" +feature: config-ssh +description: "SSH CLI execute-blob source for get_config.running (#324)" + +attributes: + # Tested live over SSH: bare "show running-config" is rejected + # ("Incomplete command"); "script" is the working form. parser: none is + # REQUIRED here, not optional: SSH.yaml's protocol-level default parser is + # dot_keys, and omitting this key returned {} against the raw text. + # + # Considered "show running-config xml" for shape consistency with a future + # MOPS get_config (an XML config file). On the tested firmware "xml" is + # rejected as an invalid command, although the CLI reference lists it. + # "script all" hung the SSH session (prompt-pattern timeout) and was not + # pursued. No XML-shape source is reachable via SSH on the tested devices; + # a future MOPS get_config needs its own shape-reconciliation pass. + hm2configrunning: + sources: + ssh: + read: {command: "show running-config script", parser: none}