Configuration schema is currently not available in VyOS build - XML schemas are only avaialble in VyOS-1X and once build is created/published, all it remains are compiled chains of node.def files scattered in /opt/vyatta/share/vyatta-cfg/templates/
My need is to pre-validate vyos configuration commands in a browser (js code) before they are pushed to the target VyOS. To do that effectively, we need JSON VyOS Schema so I can validate VyOS JSON configuration.
Best: we agree on JSON Schema for VyOS and package it inside VyOS build OK: publishing current XML schemas inside VyOS build and convert XML schema to JSON schema on demand Currently: scan and parse /opt/vyatta/share/vyatta-cfg/templates/ every time config validation is needed, reverse-engineering schema.
Is there a suggested best practice to help with configuration validation? Any future VyOS GUI project will need that.
When building vyos-1x package you will get a XML cache definition of all CLI commands.
After build you can check: ./python/build/lib/vyos/xml_ref/pkg_cache/vyos_1x_cache.py or on a running system, vyos.xml_ref package with helper functions.
Some good starters would be:
from vyos.xml_ref import cli_defined
from vyos.xml_ref import default_value