Skip to content

Add VyOS API support for /configure and /config-file save#11

Open
mikehansen1970 wants to merge 1 commit intora-olg-ucentral-sdkfrom
fix/vyos-api-configure-save
Open

Add VyOS API support for /configure and /config-file save#11
mikehansen1970 wants to merge 1 commit intora-olg-ucentral-sdkfrom
fix/vyos-api-configure-save

Conversation

@mikehansen1970
Copy link
Copy Markdown
Contributor

Summary

Add support for additional VyOS API operations required for NAT persistence workaround:

  • /configure endpoint: set and delete operations
  • /config-file endpoint: save operation

Changes in https_server_api.uc

1. Added save operation to /config-file endpoint (lines 32-44)

  • Allows saving running configuration to /config/config.boot
  • No payload needed (just op: "save")
  • Required for persisting NAT rules across VyOS reboots

2. Added /configure endpoint support (lines 66-79)

  • Supports set and delete operations
  • Requires path array parameter
  • set operation optionally accepts value parameter
  • Auto-commits changes (no explicit commit needed)

Technical Notes

  • /configure endpoint only supports set/delete operations (not commit/save)
  • Commit happens automatically after each operation
  • Save must use /config-file endpoint with op: "save"

Use Case

These operations are required for the NAT persistence workaround where we:

  1. Delete old NAT rules: /configure delete nat source
  2. Apply new rules: /configure set nat source rule X ...
  3. Save to config.boot: /config-file save

This ensures NAT rules use the correct bridge interface (br0) and persist across VyOS reboots.

Related PRs

This change is required by the companion PR in the olg-ucentral-schema repository that implements the NAT persistence fix.

Testing

Tested on MinisForum MS-01 with VyOS VM:

  • /configure set successfully creates NAT rules
  • /configure delete successfully removes NAT rules
  • /config-file save successfully persists to config.boot
  • ✅ Changes survive VyOS reboots

  Add support for:
  - /configure endpoint: set and delete operations
  - /config-file endpoint: save operation

  These operations are required for NAT persistence workaround where
  we explicitly delete old NAT rules and re-apply correct rules with
  br0 interface, then save to config.boot.

  Note: /configure endpoint only supports set/delete (not commit/save).
  Commit happens automatically, and save must use /config-file endpoint.

Signed-off-by: Mike Hansen <mike.hansen@netexperience.com>
@NavneetBarwal-RA
Copy link
Copy Markdown
Contributor

These changes are not as per the initial design(retrieve + load) and apply a unified configuration each time from ucentral-client to Vyos .
Explanation is already provided in Telecominfraproject/olg-ucentral-schema#5 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants