]> git.proxmox.com Git - pve-network.git/commitdiff
api: handle delete parameter when updating dns entries
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 22 Nov 2023 10:56:12 +0000 (11:56 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 22 Nov 2023 11:29:07 +0000 (12:29 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/API2/Network/SDN/Dns.pm

index 3d085523faf7ef150d1826a99c16d85b5aab544c..826d111c510c0585b2502920741dc36da14c6c77 100644 (file)
@@ -173,6 +173,7 @@ __PACKAGE__->register_method ({
 
        my $id = extract_param($param, 'dns');
        my $digest = extract_param($param, 'digest');
+       my $delete = extract_param($param, 'delete');
 
         PVE::Network::SDN::lock_sdn_config(
         sub {
@@ -186,6 +187,12 @@ __PACKAGE__->register_method ({
            my $plugin = PVE::Network::SDN::Dns::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};
            }