--- Begin Message ---
PVE::Tools::download_file_from_url already supports allow_overwrite,
expose this option via the API.

Signed-off-by: Sebastian Fleer <d...@dwurp.de>
---
 PVE/API2/Storage/Status.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm
index e028423..12e5356 100644
--- a/PVE/API2/Storage/Status.pm
+++ b/PVE/API2/Storage/Status.pm
@@ -590,6 +590,12 @@ __PACKAGE__->register_method({
                optional => 1,
                default => 1,
            },
+               'allow-overwrite' => {
+               description => "If true, overwriting existing files is 
allowed.",
+               type => 'boolean',
+               optional => 1,
+               default => 0,
+           },
        },
     },
     returns => {
@@ -638,6 +644,7 @@ __PACKAGE__->register_method({
        my $opts = {
            hash_required => 0,
            verify_certificates => $param->{'verify-certificates'} // 1,
+               allow_overwrite => $param->{'allow-overwrite'} // 0,
            http_proxy => $dccfg->{http_proxy},
        };
 
-- 
2.39.2



--- End Message ---
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to