Extend ConfigureModel and related modules to support load configuration in JSON format.
"configFormat": "json | json_ast | raw (default)
Ability to use load for some Section
For example, for NAT section we want to load via the API
{"source": {"rule": {"100": {"outbound-interface": "eth0", "translation": {"address": "masquerade"}}}}}
Expected configuration:
set nat source rule 100 outbound-interface 'eth0' set nat source rule 100 translation address 'masquerade'
Proposed query:
op = <set|load> - set on load configuration
configFormat = <json|json_ast|raw (default)>
path = Name of the section which we want to configure, maybe replace to section
data = config in JSON format for required section (path)
curl -k --location --request POST 'https://192.168.122.14/configure' \ --form data='{"op": "<set|load>", "configFormat": "json", "path": ["nat"], "data": [{"source": {"rule": {"100": {"outbound-interface": "eth0", "translation": {"address": "masquerade"}]}}}}]}' \ --form key='foo'