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

Event Timeline

Verification update: the current rolling API guide documents that showConfig returns HTTP 400 when a schema-valid path has no configuration, gives the "Configuration under specified path is empty" response, and recommends checking exists first or treating that exact error as empty configuration: https://github.com/vyos/vyos-documentation/blob/rolling/docs/automation/vyos-api.md#retrieve. This guidance appears in commit https://github.com/vyos/vyos-documentation/commit/3a952350bf5b5b38a7db1208ed3c910ded7b4b24. This appears to address T9089. Suggested status: Resolved if the task author or a maintainer confirms the documentation meets scope.