From f5966bbacd2998234795fb02f56bff24c7ecf7d6 Mon Sep 17 00:00:00 2001 From: Stefan Hanreich Date: Tue, 29 Jul 2025 11:29:30 +0200 Subject: api: add lock-token parameter to all api calls The parameter is optional, so all existing create/update/delete invocations can work as before, only failing if the global lock is currently set. This ensures backwards-compatibility with the existing calls to the API in the frontend. If the lock is set, users will get an error message when trying to modify the configuration from the web UI. Co-authored-by: Gabriel Goller Signed-off-by: Stefan Hanreich Link: https://lore.proxmox.com/20250729092933.90118-3-g.goller@proxmox.com --- src/PVE/Network/SDN.pm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/PVE/Network/SDN.pm') diff --git a/src/PVE/Network/SDN.pm b/src/PVE/Network/SDN.pm index 9f18f76..8a963cb 100644 --- a/src/PVE/Network/SDN.pm +++ b/src/PVE/Network/SDN.pm @@ -51,6 +51,15 @@ PVE::Cluster::cfs_register_file($running_cfg, $parse_running_cfg, $write_running my $LOCK_TOKEN_FILE = "/etc/pve/sdn/.lock"; +PVE::JSONSchema::register_standard_option( + 'pve-sdn-lock-token', + { + type => 'string', + description => "the token for unlocking the global SDN configuration", + optional => 1, + }, +); + # improve me : move status code inside plugins ? sub ifquery_check { -- cgit v1.2.3