diff options
| author | Brad Kollmyer <bradk@vitalsoft.com> | 2026-07-14 13:49:22 -0700 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2026-07-21 13:09:01 +0000 |
| commit | 2fde06b12d1854845883c4096aab9ce1eff09ec6 (patch) | |
| tree | 372476ba9e7dacf150f04eb604d3c5b667ecb016 /docs | |
| parent | 50be9c1b8aac147110f93ff3aebc26132e427046 (diff) | |
| download | vyos-documentation-2fde06b12d1854845883c4096aab9ce1eff09ec6.tar.gz vyos-documentation-2fde06b12d1854845883c4096aab9ce1eff09ec6.zip | |
vyos-api: T9088: document /show configuration commands export
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 <noreply@anthropic.com>
(cherry picked from commit ca902d4eebd49697f476d538eadfcaeb8ebb2232)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/automation/vyos-api.md | 21 |
1 files changed, 21 insertions, 0 deletions
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 |
