]>
Commit | Line | Data |
---|---|---|
a06a3eac DM |
1 | package PVE::API2::HAConfig; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use PVE::SafeSyslog; | |
7 | use PVE::Tools; | |
8 | use PVE::Cluster qw(cfs_lock_file cfs_read_file cfs_write_file); | |
9 | use PVE::RESTHandler; | |
10 | use PVE::RPCEnvironment; | |
11 | use PVE::JSONSchema qw(get_standard_option); | |
12 | use PVE::Exception qw(raise_param_exc); | |
e877877f DM |
13 | use PVE::API2::HA::Resources; |
14 | use PVE::API2::HA::Groups; | |
15 | use PVE::API2::HA::Status; | |
a06a3eac DM |
16 | |
17 | use base qw(PVE::RESTHandler); | |
18 | ||
e877877f DM |
19 | __PACKAGE__->register_method ({ |
20 | subclass => "PVE::API2::HA::Resources", | |
21 | path => 'resources', | |
22 | }); | |
23 | ||
24 | __PACKAGE__->register_method ({ | |
25 | subclass => "PVE::API2::HA::Groups", | |
26 | path => 'groups', | |
27 | }); | |
28 | ||
29 | __PACKAGE__->register_method ({ | |
30 | subclass => "PVE::API2::HA::Status", | |
31 | path => 'status', | |
32 | }); | |
33 | ||
a06a3eac DM |
34 | __PACKAGE__->register_method({ |
35 | name => 'index', | |
36 | path => '', | |
37 | method => 'GET', | |
38 | description => "Directory index.", | |
39 | permissions => { | |
7d020b42 | 40 | check => ['perm', '/', [ 'Sys.Audit' ]], |
a06a3eac DM |
41 | }, |
42 | parameters => { | |
43 | additionalProperties => 0, | |
44 | properties => {}, | |
45 | }, | |
46 | returns => { | |
47 | type => 'array', | |
48 | items => { | |
49 | type => "object", | |
50 | properties => { | |
51 | id => { type => 'string' }, | |
52 | }, | |
53 | }, | |
54 | links => [ { rel => 'child', href => "{id}" } ], | |
55 | }, | |
56 | code => sub { | |
57 | my ($param) = @_; | |
58 | ||
59 | my $res = [ | |
e877877f DM |
60 | { id => 'status' }, |
61 | { id => 'resources' }, | |
a06a3eac DM |
62 | { id => 'groups' }, |
63 | ]; | |
64 | ||
65 | return $res; | |
66 | }}); | |
67 | ||
a06a3eac DM |
68 | |
69 | 1; |