]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
ha-manager: remove 'enabled' and 'disabled' commands
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Nov 2016 15:53:02 +0000 (16:53 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Sat, 19 Nov 2016 08:59:41 +0000 (09:59 +0100)
This should be done with:
ha-manager set SID --state STATE

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/CLI/ha_manager.pm

index 18c73255cdd549cab6cf52c69f95256b0ecb6307..9d1f7e2b69898771d4c2937945383a5ab3d91d14 100644 (file)
@@ -22,53 +22,6 @@ use base qw(PVE::CLIHandler);
 
 my $nodename = PVE::INotify::nodename();
 
-__PACKAGE__->register_method ({
-    name => 'enable',
-    path => 'enable',
-    method => 'POST',
-    description => "Enable a HA resource.",
-    parameters => {
-       additionalProperties => 0,
-       properties => {
-           sid => get_standard_option('pve-ha-resource-or-vm-id',
-                                     { completion => \&PVE::HA::Tools::complete_disabled_sid }),
-       },
-    },
-    returns => { type => 'null' },
-    code => sub {
-       my ($param) = @_;
-
-       my $sid = PVE::HA::Tools::parse_sid($param->{sid});
-
-       # delete state (default is 'enabled')
-       PVE::API2::HA::Resources->update({ sid => $sid, delete => 'state' });
-
-       return undef;
-    }});
-
-__PACKAGE__->register_method ({
-    name => 'disable',
-    path => 'disable',
-    method => 'POST',
-    description => "Disable a HA resource.",
-    parameters => {
-       additionalProperties => 0,
-       properties => {
-           sid => get_standard_option('pve-ha-resource-or-vm-id',
-                                     { completion => \&PVE::HA::Tools::complete_enabled_sid }),
-       },
-    },
-    returns => { type => 'null' },
-    code => sub {
-       my ($param) = @_;
-
-       my $sid = PVE::HA::Tools::parse_sid($param->{sid});
-
-       PVE::API2::HA::Resources->update({ sid => $sid, state => 'disabled' });
-
-       return undef;
-    }});
-
 my $timestamp_to_status = sub {
     my ($ctime, $timestamp) = @_;
 
@@ -117,8 +70,6 @@ __PACKAGE__->register_method ({
     }});
 
 our $cmddef = {
-    enable => [ __PACKAGE__, 'enable', ['sid']],
-    disable => [ __PACKAGE__, 'disable', ['sid']],
     status => [ __PACKAGE__, 'status'],
     config => [ 'PVE::API2::HA::Resources', 'index', [], {}, sub {
        my $res = shift;