]> git.proxmox.com Git - pve-manager.git/blame - PVE/API2/HAConfig.pm
bump version to 5.4-15
[pve-manager.git] / PVE / API2 / HAConfig.pm
CommitLineData
a06a3eac
DM
1package PVE::API2::HAConfig;
2
3use strict;
4use warnings;
5
6use PVE::SafeSyslog;
7use PVE::Tools;
8use PVE::Cluster qw(cfs_lock_file cfs_read_file cfs_write_file);
9use PVE::RESTHandler;
10use PVE::RPCEnvironment;
11use PVE::JSONSchema qw(get_standard_option);
12use PVE::Exception qw(raise_param_exc);
e877877f
DM
13use PVE::API2::HA::Resources;
14use PVE::API2::HA::Groups;
15use PVE::API2::HA::Status;
a06a3eac
DM
16
17use 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
691;