Page MenuHomeVyOS Platform

vyos-api docs: document /retrieve showConfig behavior on empty or missing subtrees (HTTP 400)
Open, LowPublic

Description

Doc page: https://docs.vyos.io/en/latest/automation/vyos-api.html

{"op":"showConfig","path":[...]} on /retrieve returns HTTP 400 with "Configuration under specified path is empty" when the path exists in the schema but has no configuration — rather than a success with an empty result. Example: ["firewall","ipv4","forward"] right after delete firewall, or any node not yet configured.

The docs describe {"op":"exists"} but not this 400 behavior of showConfig. Automation that diffs live config against a desired state has to learn this the hard way (we hit it repeatedly during clean-slate re-applies: the 400 is indistinguishable at the HTTP level from a malformed request).

Suggested doc addition on the /retrieve section: state that showConfig on an empty/unconfigured path returns 400 with that message, and recommend either probing with exists first or treating that specific error string as "empty subtree".

Details

Version
docs.vyos.io latest (observed on VyOS 1.5 rolling)
Is it a breaking change?
Perfectly compatible
Issue type
Documentation update