summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Bumiller <w.bumiller@proxmox.com>2023-11-22 11:49:20 +0100
committerWolfgang Bumiller <w.bumiller@proxmox.com>2023-11-22 12:29:07 +0100
commit99264c81d66103d48035fca383fa09fd24dd9850 (patch)
treec2c0e75389548aad6e5208683e39853b180349e6
parent4552f5d490d1b96fd73efacd4910e789863c9ef4 (diff)
api: handle delete parameter when updating ipams
this is for completeness, currently no plugin has optional properties... Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
-rw-r--r--src/PVE/API2/Network/SDN/Ipams.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/PVE/API2/Network/SDN/Ipams.pm b/src/PVE/API2/Network/SDN/Ipams.pm
index d6e0bc8..27ead02 100644
--- a/src/PVE/API2/Network/SDN/Ipams.pm
+++ b/src/PVE/API2/Network/SDN/Ipams.pm
@@ -180,6 +180,7 @@ __PACKAGE__->register_method ({
my $id = extract_param($param, 'ipam');
my $digest = extract_param($param, 'digest');
+ my $delete = extract_param($param, 'delete');
PVE::Network::SDN::lock_sdn_config(
sub {
@@ -193,6 +194,12 @@ __PACKAGE__->register_method ({
my $plugin = PVE::Network::SDN::Ipams::Plugin->lookup($scfg->{type});
my $opts = $plugin->check_config($id, $param, 0, 1);
+ if ($delete) {
+ $delete = [ PVE::Tools::split_list($delete) ];
+ my $options = $plugin->private()->{options}->{$scfg->{type}};
+ PVE::SectionConfig::delete_from_config($scfg, $options, $opts, $delete);
+ }
+
foreach my $k (%$opts) {
$scfg->{$k} = $opts->{$k};
}