all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Daniel Kral" <d.kral@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Cc: "pve-devel" <pve-devel-bounces@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH ha-manager 2/2] api: add purge parameter for resource deletion
Date: Tue, 23 Sep 2025 09:51:03 +0200	[thread overview]
Message-ID: <DD00L3VO36HP.LLOOJERT661C@proxmox.com> (raw)
In-Reply-To: <20250917115316.131793-3-m.koeppl@proxmox.com>

On Wed Sep 17, 2025 at 1:53 PM CEST, Michael Köppl wrote:
> Signed-off-by: Michael Köppl <m.koeppl@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

  reply	other threads:[~2025-09-23  7:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 11:53 [pve-devel] [PATCH container/docs/ha-manager/manager/qemu-server 0/7] fix #6613: update HA rules upon " Michael Köppl
2025-09-17 11:53 ` [pve-devel] [PATCH ha-manager 1/2] fix #6613: update rules containing the resource to be deleted Michael Köppl
2025-09-23  7:53   ` Daniel Kral
2025-09-23  8:06     ` Michael Köppl
2025-09-17 11:53 ` [pve-devel] [PATCH ha-manager 2/2] api: add purge parameter for resource deletion Michael Köppl
2025-09-23  7:51   ` Daniel Kral [this message]
2025-09-17 11:53 ` [pve-devel] [PATCH qemu-server 1/1] fix #6613: pass purge param to delete_service_from_config Michael Köppl
2025-09-17 11:53 ` [pve-devel] [PATCH container " Michael Köppl
2025-09-17 11:53 ` [pve-devel] [PATCH manager 1/2] ui: add SafeDestroyResource window Michael Köppl
2025-09-23  7:50   ` Daniel Kral
2025-09-17 11:53 ` [pve-devel] [PATCH manager 2/2] ui: use SafeDestroyResource window for removing resources Michael Köppl
2025-09-23  7:50   ` Daniel Kral
2025-09-23  8:56     ` Michael Köppl
2025-09-17 11:53 ` [pve-devel] [PATCH docs 1/1] add notes about effects of purge flag for resource and guest removal Michael Köppl
2025-09-23  8:04 ` [pve-devel] [PATCH container/docs/ha-manager/manager/qemu-server 0/7] fix #6613: update HA rules upon resource deletion Daniel Kral

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DD00L3VO36HP.LLOOJERT661C@proxmox.com \
    --to=d.kral@proxmox.com \
    --cc=pve-devel-bounces@lists.proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal