path => '',
method => 'GET',
description => "List security groups.",
- proxyto => 'node',
parameters => {
additionalProperties => 0,
- properties => {
- node => get_standard_option('pve-node'),
- },
},
returns => {
type => 'array',
my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
my $res = [];
- foreach my $group (keys %{$cluster_conf->{rules}}) {
- push @$res, { name => $group, count => scalar(@{$cluster_conf->{rules}->{$group}}) };
+ foreach my $group (keys %{$cluster_conf->{groups}}) {
+ push @$res, { name => $group, count => scalar(@{$cluster_conf->{groups}->{$group}}) };
}
return $res;
path => '{group}',
method => 'GET',
description => "List security groups rules.",
- proxyto => 'node',
parameters => {
additionalProperties => 0,
properties => {
- node => get_standard_option('pve-node'),
group => {
description => "Security group name.",
type => 'string',
my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
- my $rules = $cluster_conf->{rules}->{$param->{group}};
+ my $rules = $cluster_conf->{groups}->{$param->{group}};
die "no such security group\n" if !defined($rules);
my $digest = $cluster_conf->{digest};
path => '{group}/{pos}',
method => 'GET',
description => "Get single rule data.",
- proxyto => 'node',
parameters => {
additionalProperties => 0,
properties => {
- node => get_standard_option('pve-node'),
group => {
description => "Security group name.",
type => 'string',
my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
- my $rules = $cluster_conf->{rules}->{$param->{group}};
+ my $rules = $cluster_conf->{groups}->{$param->{group}};
die "no such security group\n" if !defined($rules);
my $digest = $cluster_conf->{digest};
path => '{group}',
method => 'POST',
description => "Create new rule.",
- proxyto => 'node',
protected => 1,
parameters => {
additionalProperties => 0,
properties => PVE::Firewall::add_rule_properties({
- node => get_standard_option('pve-node'),
group => {
description => "Security group name.",
type => 'string',
my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
- my $rules = $cluster_conf->{rules}->{$param->{group}};
+ my $rules = $cluster_conf->{groups}->{$param->{group}};
die "no such security group\n" if !defined($rules);
my $digest = $cluster_conf->{digest};
path => '{group}/{pos}',
method => 'PUT',
description => "Modify rule data.",
- proxyto => 'node',
protected => 1,
parameters => {
additionalProperties => 0,
properties => PVE::Firewall::add_rule_properties({
- node => get_standard_option('pve-node'),
group => {
description => "Security group name.",
type => 'string',
my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
- my $rules = $cluster_conf->{rules}->{$param->{group}};
+ my $rules = $cluster_conf->{groups}->{$param->{group}};
die "no such security group\n" if !defined($rules);
my $digest = $cluster_conf->{digest};
}
push @$newrules, $rule if $moveto >= scalar(@$rules);
- $cluster_conf->{rules}->{$param->{group}} = $newrules;
+ $cluster_conf->{groups}->{$param->{group}} = $newrules;
} else {
PVE::Firewall::copy_rule_data($rule, $param);
}
path => '{group}/{pos}',
method => 'DELETE',
description => "Delete rule.",
- proxyto => 'node',
protected => 1,
parameters => {
additionalProperties => 0,
properties => {
- node => get_standard_option('pve-node'),
group => {
description => "Security group name.",
type => 'string',
my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
- my $rules = $cluster_conf->{rules}->{$param->{group}};
+ my $rules = $cluster_conf->{groups}->{$param->{group}};
die "no such security group\n" if !defined($rules);
my $digest = $cluster_conf->{digest};