public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [RFC PATCH proxmox-backup 2/6] client: Add `--protected` CLI flag to backup command
Date: Wed, 18 Jan 2023 12:13:52 +0100	[thread overview]
Message-ID: <1674040346.a6cksp257q.astroid@yuna.none> (raw)
In-Reply-To: <20230118104903.441554-3-c.heiss@proxmox.com>

On January 18, 2023 11:48 am, Christoph Heiss wrote:
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
>  proxmox-backup-client/src/main.rs | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/proxmox-backup-client/src/main.rs b/proxmox-backup-client/src/main.rs
> index 55198108..ee09db83 100644
> --- a/proxmox-backup-client/src/main.rs
> +++ b/proxmox-backup-client/src/main.rs
> @@ -663,6 +663,12 @@ fn spawn_catalog_upload(
>                 optional: true,
>                 default: false,
>             },
> +           "protected": {
> +               type: Boolean,
> +               description: "Set backup as protected after upload.",
> +               optional: true,
> +               default: false,
> +           },
>         }
>     }
>  )]
> @@ -716,6 +722,7 @@ async fn create_backup(
> 
>      let empty = Vec::new();
>      let exclude_args = param["exclude"].as_array().unwrap_or(&empty);
> +    let protected = param["protected"].as_bool().unwrap_or(false);
> 
>      let mut pattern_list = Vec::with_capacity(exclude_args.len());
>      for entry in exclude_args {
> @@ -1082,7 +1089,9 @@ async fn create_backup(
>          .upload_blob_from_data(manifest.into_bytes(), MANIFEST_BLOB_NAME, options)
>          .await?;
> 
> -    client.finish().await?;
> +    client.finish(Some(json!({
> +        "protected": protected,
> +    }))).await?;

this fails the backup with new client + --protected, at the very end, if the
server doesn't have patch #1 of this series.

we need some sort of compat mechanism...

> 
>      let end_time = std::time::Instant::now();
>      let elapsed = end_time.duration_since(start_time);
> --
> 2.34.1
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 




  reply	other threads:[~2023-01-18 11:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 10:48 [pbs-devel] [RFC PATCH proxmox-backup{, -qemu}, pve-{qemu, manager}, qemu-server 0/6] fix #4289: Set protected flag on backup creation Christoph Heiss
2023-01-18 10:48 ` [pbs-devel] [RFC PATCH proxmox-backup 1/6] api2: Add `protected` parameter to `finish` endpoint Christoph Heiss
2023-01-18 11:12   ` Fabian Grünbichler
2023-01-18 10:48 ` [pbs-devel] [RFC PATCH proxmox-backup 2/6] client: Add `--protected` CLI flag to backup command Christoph Heiss
2023-01-18 11:13   ` Fabian Grünbichler [this message]
2023-01-18 11:50     ` Christoph Heiss
2023-01-18 10:49 ` [pbs-devel] [RFC PATCH proxmox-backup-qemu 3/6] api: Supply `protected` parameter to the `finish` API call Christoph Heiss
2023-01-18 10:49 ` [pbs-devel] [RFC PATCH pve-qemu 4/6] pve: Add patch to support new proxmox-backup-qemu API Christoph Heiss
2023-01-18 10:49 ` [pbs-devel] [RFC PATCH qemu-server 5/6] vzdump: Set protected flag on backup start if supported Christoph Heiss
2023-01-18 10:49 ` [pbs-devel] [RFC PATCH pve-manager 6/6] vzdump: Only set protected attribute if not already done Christoph Heiss

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=1674040346.a6cksp257q.astroid@yuna.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=pbs-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal