Commit | Line | Data |
---|---|---|
b4366f00 DM |
1 | package PVE::API2::Firewall::Cluster; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | use PVE::JSONSchema qw(get_standard_option); | |
6 | ||
7 | use PVE::Firewall; | |
8 | use PVE::API2::Firewall::Groups; | |
9 | ||
10 | use Data::Dumper; # fixme: remove | |
11 | ||
12 | use base qw(PVE::RESTHandler); | |
13 | ||
14 | __PACKAGE__->register_method ({ | |
15 | subclass => "PVE::API2::Firewall::Groups", | |
16 | path => 'groups', | |
17 | }); | |
18 | ||
19 | __PACKAGE__->register_method({ | |
20 | name => 'index', | |
21 | path => '', | |
22 | method => 'GET', | |
23 | permissions => { user => 'all' }, | |
24 | description => "Directory index.", | |
25 | parameters => { | |
26 | additionalProperties => 0, | |
27 | }, | |
28 | returns => { | |
29 | type => 'array', | |
30 | items => { | |
31 | type => "object", | |
32 | properties => {}, | |
33 | }, | |
34 | links => [ { rel => 'child', href => "{name}" } ], | |
35 | }, | |
36 | code => sub { | |
37 | my ($param) = @_; | |
38 | ||
39 | my $result = [ | |
40 | { name => 'rules' }, | |
41 | { name => 'options' }, | |
42 | { name => 'groups' }, | |
43 | { name => 'netgroups' }, | |
44 | ]; | |
45 | ||
46 | return $result; | |
47 | }}); |