my (undef, $digest) = &$get_security_group_list($cluster_conf);
PVE::Tools::assert_if_modified($digest, $param->{digest});
my (undef, $digest) = &$get_security_group_list($cluster_conf);
PVE::Tools::assert_if_modified($digest, $param->{digest});
if !$cluster_conf->{groups}->{$param->{rename}};
my $data = delete $cluster_conf->{groups}->{$param->{rename}};
if !$cluster_conf->{groups}->{$param->{rename}};
my $data = delete $cluster_conf->{groups}->{$param->{rename}};
- raise_param_exc({ name => "Security group '$name' already exists" })
- if $name eq $param->{name};
+ raise_param_exc({ group => "Security group '$name' already exists" })
+ if $name eq $param->{group};
- $cluster_conf->{groups}->{$param->{name}} = [];
- $cluster_conf->{group_comments}->{$param->{name}} = $param->{comment} if defined($param->{comment});
+ $cluster_conf->{groups}->{$param->{group}} = [];
+ $cluster_conf->{group_comments}->{$param->{group}} = $param->{comment} if defined($param->{comment});
__PACKAGE__->register_method({
name => 'delete_security_group',
__PACKAGE__->register_method({
name => 'delete_security_group',
method => 'DELETE',
description => "Delete security group.",
protected => 1,
parameters => {
additionalProperties => 0,
properties => {
method => 'DELETE',
description => "Delete security group.",
protected => 1,
parameters => {
additionalProperties => 0,
properties => {
my (undef, $digest) = &$get_security_group_list($cluster_conf);
PVE::Tools::assert_if_modified($digest, $param->{digest});
my (undef, $digest) = &$get_security_group_list($cluster_conf);
PVE::Tools::assert_if_modified($digest, $param->{digest});
- die "Security group '$param->{name}' is not empty\n"
- if scalar(@{$cluster_conf->{groups}->{$param->{name}}});
+ die "Security group '$param->{group}' is not empty\n"
+ if scalar(@{$cluster_conf->{groups}->{$param->{group}}});