]>
git.proxmox.com Git - pve-ha-manager.git/blob - src/ha-manager
11 use PVE
::API2
::HA
::Resources
;
12 use PVE
::API2
::HA
::Groups
;
14 use base
qw(PVE::CLIHandler);
16 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
19 die "please run as root\n" if $> != 0;
21 my $nodename = PVE
::INotify
::nodename
();
23 __PACKAGE__-
>register_method ({
27 description
=> "A stupid test.",
29 additionalProperties
=> 0,
33 returns
=> { type
=> 'null' },
43 test
=> [ __PACKAGE__
, 'test', []],
44 config
=> [ 'PVE::API2::HA::Resources', 'index', [], {}, sub {
46 foreach my $rec (sort { $a->{sid
} cmp $b->{sid
} } @$res) {
47 my ($type, $name) = split(':', $rec->{sid
}, 2);
48 print "$type: $name\n";
49 foreach my $k (sort keys %$rec) {
50 next if $k eq 'digest' || $k eq 'sid' ||
52 print "\t$k $rec->{$k}\n";
56 groups
=> [ 'PVE::API2::HA::Groups', 'index', [], {}, sub {
58 foreach my $rec (sort { $a->{group
} cmp $b->{group
} } @$res) {
59 print "group: $rec->{group}\n";
60 foreach my $k (sort keys %$rec) {
61 next if $k eq 'digest' || $k eq 'group' ||
63 print "\t$k $rec->{$k}\n";
67 add
=> [ "PVE::API2::HA::Resources", 'create', ['sid'] ],
68 remove
=> [ "PVE::API2::HA::Resources", 'delete', ['sid'] ],
69 set
=> [ "PVE::API2::HA::Resources", 'update', ['sid'] ],
75 if ($cmd && $cmd ne 'printmanpod' && $cmd ne 'verifyapi') {
76 PVE
::Cluster
::check_cfs_is_mounted
();
77 PVE
::Cluster
::cfs_update
();
80 PVE
::CLIHandler
::handle_cmd
($cmddef, "ha-manager", $cmd, \
@ARGV, undef, $0);
88 pvecm - Proxmox VE HA Command Line Interface
96 ha-manager is a program to manage the HA configuration.
98 =include pve_copyright