}
print "\n";
}}],
- groups => [ 'PVE::API2::HA::Groups', 'index', [], {}, sub {
+ groupconfig => [ 'PVE::API2::HA::Groups', 'index', [], {}, sub {
my $res = shift;
foreach my $rec (sort { $a->{group} cmp $b->{group} } @$res) {
print "group: $rec->{group}\n";
}
print "\n";
}}],
+ groupadd => [ "PVE::API2::HA::Groups", 'create', ['group'] ],
+ groupremove => [ "PVE::API2::HA::Groups", 'delete', ['group'] ],
+ groupset => [ "PVE::API2::HA::Groups", 'update', ['group'] ],
+
add => [ "PVE::API2::HA::Resources", 'create', ['sid'] ],
remove => [ "PVE::API2::HA::Resources", 'delete', ['sid'] ],
set => [ "PVE::API2::HA::Resources", 'update', ['sid'] ],
my $defaultData = {
propertyList => {
- type => { description => "Section type." },
+ type => {
+ description => "Group type.",
+ optional => 1,
+ },
group => get_standard_option('pve-ha-group-id',
{ completion => \&PVE::HA::Tools::complete_group }),
nodes => get_standard_option('pve-ha-group-node-list', { optional => 1 }),
}
sub complete_group {
+ my ($cmd, $pname, $cur) = @_;
my $cfg = PVE::HA::Config::read_group_config();
my $res = [];
- foreach my $group (keys %{$cfg->{ids}}) {
- push @$res, $group;
+ if ($cmd ne 'groupadd') {
+
+ foreach my $group (keys %{$cfg->{ids}}) {
+ push @$res, $group;
+ }
+
}
return $res;