On Wed Sep 17, 2025 at 1:53 PM CEST, Michael Köppl wrote: > Signed-off-by: Michael Köppl <m.koe...@proxmox.com> > --- > src/PVE/API2/HA/Resources.pm | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/API2/HA/Resources.pm b/src/PVE/API2/HA/Resources.pm > index 894fe90..09fe954 100644 > --- a/src/PVE/API2/HA/Resources.pm > +++ b/src/PVE/API2/HA/Resources.pm > @@ -284,6 +284,13 @@ __PACKAGE__->register_method({ > 'pve-ha-resource-or-vm-id', > { completion => \&PVE::HA::Tools::complete_sid }, > ), > + purge => { > + type => 'boolean', > + description => > + "Remove this resource from rules that reference it, > deleting the rule if this resource is the only resource in the rule", > + optional => 1, > + default => 1, > + }, > }, > }, > returns => { type => 'null' }, > @@ -291,12 +298,13 @@ __PACKAGE__->register_method({ > my ($param) = @_; > > my ($sid, $type, $name) = > PVE::HA::Config::parse_sid(extract_param($param, 'sid')); > + my $purge = extract_param($param, 'purge') // 1;
This could be deemed as "API-breaking" because now the same API request does something different than before.. I'm still unsure about it, but it should at least be noted that this is because of consistency with the web interface (where purge is enabled by default now). > > if (!PVE::HA::Config::service_is_configured($sid)) { > die "cannot delete service '$sid', not HA managed!\n"; > } > > - PVE::HA::Config::delete_service_from_config($sid); > + PVE::HA::Config::delete_service_from_config($sid, $purge); > > return undef; > }, _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel