From ca902d4eebd49697f476d538eadfcaeb8ebb2232 Mon Sep 17 00:00:00 2001 From: Brad Kollmyer Date: Tue, 14 Jul 2026 13:49:22 -0700 Subject: vyos-api: T9088: document /show configuration commands export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /show endpoint can return the running config as flat set commands (op-mode 'show configuration commands' equivalent) — the natural way to mirror or back up a router over the API; previously undocumented. Co-Authored-By: Claude Fable 5 --- docs/automation/vyos-api.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'docs') diff --git a/docs/automation/vyos-api.md b/docs/automation/vyos-api.md index 383b8311..1c51cc01 100644 --- a/docs/automation/vyos-api.md +++ b/docs/automation/vyos-api.md @@ -381,6 +381,27 @@ response: } ``` +The endpoint can also export the running configuration as flat `set` +commands, equivalent to the operational mode command +`show configuration commands`. This is convenient for mirroring, diffing, +or backing up a configuration: + +```none +curl -k --location --request POST 'https://vyos/show' \ +--form data='{"op": "show", "path": ["configuration", "commands"]}' \ +--form key='MY-HTTPS-API-PLAINTEXT-KEY' + +response (shortened): +{ + "success": true, + "data": "set interfaces ethernet eth0 address 'dhcp'\n + set interfaces ethernet eth0 hw-id '50:00:00:01:00:00'\n + set system host-name 'vyos'\n + ...", + "error": null +} +``` + ### /generate -- cgit v1.2.3