[pve-devel] [PATCH ha-manager 2/2] ha-manager: remove 'enabled' and 'disabled' commands

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Nov 18 16:53:02 CET 2016


This should be done with:
ha-manager set SID --state STATE

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

If a user gets really annoyed by typing this I could imagine a
ha-manager request SID STATE
command, but should not be needed.

 src/PVE/CLI/ha_manager.pm | 49 -----------------------------------------------
 1 file changed, 49 deletions(-)

diff --git a/src/PVE/CLI/ha_manager.pm b/src/PVE/CLI/ha_manager.pm
index 18c7325..9d1f7e2 100644
--- a/src/PVE/CLI/ha_manager.pm
+++ b/src/PVE/CLI/ha_manager.pm
@@ -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;
-- 
2.1.4





More information about the pve-devel mailing list