diff options
| author | Stefan Hanreich <s.hanreich@proxmox.com> | 2025-07-29 11:29:30 +0200 |
|---|---|---|
| committer | Thomas Lamprecht <t.lamprecht@proxmox.com> | 2025-07-29 12:59:51 +0200 |
| commit | f5966bbacd2998234795fb02f56bff24c7ecf7d6 (patch) | |
| tree | e60247bd424744276281349640b5fdc6f8df248b /src/PVE/Network/SDN.pm | |
| parent | f7d4f22a42a506e6cd60f0de8fbac9f580b85c6f (diff) | |
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 <g.goller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Link: https://lore.proxmox.com/20250729092933.90118-3-g.goller@proxmox.com
Diffstat (limited to 'src/PVE/Network/SDN.pm')
| -rw-r--r-- | src/PVE/Network/SDN.pm | 9 |
1 files changed, 9 insertions, 0 deletions
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 { |
