all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Hannes Laimer <h.laimer@proxmox.com>
Subject: Re: [pbs-devel] [PATCH v1 proxmox-backup 2/3] api2: add ignore-verified and outdated-after to datastore verify endpoint
Date: Fri, 11 Jun 2021 15:20:29 +0200	[thread overview]
Message-ID: <1209e33c-a334-28a3-db38-408ddb018e3d@proxmox.com> (raw)
In-Reply-To: <20210611075046.34449-3-h.laimer@proxmox.com>

comment(s) inline

On 6/11/21 09:50, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
>   src/api2/admin/datastore.rs | 18 +++++++++++++++---
>   1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
> index e0dfeecc..13830298 100644
> --- a/src/api2/admin/datastore.rs
> +++ b/src/api2/admin/datastore.rs
> @@ -646,6 +646,14 @@ pub fn status(
>                   schema: BACKUP_ID_SCHEMA,
>                   optional: true,
>               },
> +            "ignore-verified": {
> +                schema: IGNORE_VERIFIED_BACKUPS_SCHEMA,
> +                optional: true,

if we add a 'default: true' here, we can
|
v

> +            },
> +            "outdated-after": {
> +                schema: VERIFICATION_OUTDATED_AFTER_SCHEMA,
> +                optional: true,
> +            },
>               "backup-time": {
>                   schema: BACKUP_TIME_SCHEMA,
>                   optional: true,
> @@ -668,9 +676,12 @@ pub fn verify(
>       backup_type: Option<String>,
>       backup_id: Option<String>,
>       backup_time: Option<i64>,
> +    ignore_verified: Option<bool>,

omit the Option here and simply make that a bool then
|
v

> +    outdated_after: Option<i64>,
>       rpcenv: &mut dyn RpcEnvironment,
>   ) -> Result<Value, Error> {
>       let datastore = DataStore::lookup_datastore(&store)?;
> +    let ignore_verified = ignore_verified.unwrap_or(true);

this line can be removed

>   
>       let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
>       let worker_id;
> @@ -712,6 +723,7 @@ pub fn verify(
>           auth_id.clone(),
>           to_stdout,
>           move |worker| {
> +            let filter = build_verify_filter(ignore_verified, outdated_after);
>               let verify_worker = crate::backup::VerifyWorker::new(worker.clone(), datastore);
>               let failed_dirs = if let Some(backup_dir) = backup_dir {
>                   let mut res = Vec::new();
> @@ -719,7 +731,7 @@ pub fn verify(
>                       &verify_worker,
>                       &backup_dir,
>                       worker.upid().clone(),
> -                    None,
> +                    Some(&filter),
>                   )? {
>                       res.push(backup_dir.to_string());
>                   }
> @@ -730,7 +742,7 @@ pub fn verify(
>                       &backup_group,
>                       &mut StoreProgress::new(1),
>                       worker.upid(),
> -                    None,
> +                    Some(&filter),
>                   )?;
>                   failed_dirs
>               } else {
> @@ -743,7 +755,7 @@ pub fn verify(
>                       None
>                   };
>   
> -                verify_all_backups(&verify_worker, worker.upid(), owner, None)?
> +                verify_all_backups(&verify_worker, worker.upid(), owner, Some(&filter))?
>               };
>               if !failed_dirs.is_empty() {
>                   worker.log("Failed to verify the following snapshots/groups:");
> 





  reply	other threads:[~2021-06-11 13:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11  7:50 [pbs-devel] [PATCH v1 proxmox-backup 0/3] close #3459: add --ignore-verified and --outdated-after to CLI and api2 Hannes Laimer
2021-06-11  7:50 ` [pbs-devel] [PATCH v1 proxmox-backup 1/3] verify-job: move building of snapshot filter into function Hannes Laimer
2021-06-11 13:18   ` Dominik Csapak
2021-06-11  7:50 ` [pbs-devel] [PATCH v1 proxmox-backup 2/3] api2: add ignore-verified and outdated-after to datastore verify endpoint Hannes Laimer
2021-06-11 13:20   ` Dominik Csapak [this message]
2021-06-11  7:50 ` [pbs-devel] [PATCH v1 proxmox-backup 3/3] manager_bin: add --ignore-verified and --outdated-after parameters Hannes Laimer
2021-06-11 13:21   ` Dominik Csapak

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=1209e33c-a334-28a3-db38-408ddb018e3d@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=h.laimer@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 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