diff options
Diffstat (limited to 'src/PVE/API2/Network/SDN/Ipams.pm')
| -rw-r--r-- | src/PVE/API2/Network/SDN/Ipams.pm | 21 | 
1 files changed, 19 insertions, 2 deletions
diff --git a/src/PVE/API2/Network/SDN/Ipams.pm b/src/PVE/API2/Network/SDN/Ipams.pm index e30d28f..89e05ee 100644 --- a/src/PVE/API2/Network/SDN/Ipams.pm +++ b/src/PVE/API2/Network/SDN/Ipams.pm @@ -128,13 +128,19 @@ __PACKAGE__->register_method({      permissions => {          check => ['perm', '/sdn/ipams', ['SDN.Allocate']],      }, -    parameters => PVE::Network::SDN::Ipams::Plugin->createSchema(), +    parameters => PVE::Network::SDN::Ipams::Plugin->createSchema( +        undef, +        { +            'lock-token' => get_standard_option('pve-sdn-lock-token'), +        }, +    ),      returns => { type => 'null' },      code => sub {          my ($param) = @_;          my $type = extract_param($param, 'type');          my $id = extract_param($param, 'ipam'); +        my $lock_token = extract_param($param, 'lock-token');          my $plugin = PVE::Network::SDN::Ipams::Plugin->lookup($type);          my $opts = $plugin->check_config($id, $param, 1, 1); @@ -164,6 +170,7 @@ __PACKAGE__->register_method({              },              "create sdn ipam object failed", +            $lock_token,          );          return undef; @@ -179,7 +186,12 @@ __PACKAGE__->register_method({      permissions => {          check => ['perm', '/sdn/ipams', ['SDN.Allocate']],      }, -    parameters => PVE::Network::SDN::Ipams::Plugin->updateSchema(), +    parameters => PVE::Network::SDN::Ipams::Plugin->updateSchema( +        undef, +        { +            'lock-token' => get_standard_option('pve-sdn-lock-token'), +        }, +    ),      returns => { type => 'null' },      code => sub {          my ($param) = @_; @@ -187,6 +199,7 @@ __PACKAGE__->register_method({          my $id = extract_param($param, 'ipam');          my $digest = extract_param($param, 'digest');          my $delete = extract_param($param, 'delete'); +        my $lock_token = extract_param($param, 'lock-token');          PVE::Network::SDN::lock_sdn_config(              sub { @@ -216,6 +229,7 @@ __PACKAGE__->register_method({              },              "update sdn ipam object failed", +            $lock_token,          );          return undef; @@ -240,6 +254,7 @@ __PACKAGE__->register_method({                      completion => \&PVE::Network::SDN::Ipams::complete_sdn_ipams,                  },              ), +            'lock-token' => get_standard_option('pve-sdn-lock-token'),          },      },      returns => { type => 'null' }, @@ -247,6 +262,7 @@ __PACKAGE__->register_method({          my ($param) = @_;          my $id = extract_param($param, 'ipam'); +        my $lock_token = extract_param($param, 'lock-token');          PVE::Network::SDN::lock_sdn_config(              sub { @@ -264,6 +280,7 @@ __PACKAGE__->register_method({              },              "delete sdn zone object failed", +            $lock_token,          );          return undef;  | 
