Page MenuHomeVyOS Platform

Ability to load config via API in JSON format
Closed, ResolvedPublicFEATURE REQUEST

Description

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'

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Feature (new functionality)

Event Timeline

jestabro changed the task status from Open to Needs testing.Jun 12 2023, 7:36 PM
jestabro triaged this task as Normal priority.
jestabro moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.