From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH v6 proxmox-backup 3/4] client: catalog shell: use dedicated api type for patterns
Date: Tue, 12 Nov 2024 11:43:15 +0100 [thread overview]
Message-ID: <20241112104316.206282-4-c.ebner@proxmox.com> (raw)
In-Reply-To: <20241112104316.206282-1-c.ebner@proxmox.com>
Use the common api type with schema based input validation for all
match pattern parameters exposed via the api macro.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
changes since version 5:
- no changes
pbs-client/src/catalog_shell.rs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/pbs-client/src/catalog_shell.rs b/pbs-client/src/catalog_shell.rs
index 8c8e9a654..7e69970fe 100644
--- a/pbs-client/src/catalog_shell.rs
+++ b/pbs-client/src/catalog_shell.rs
@@ -14,6 +14,7 @@ use nix::fcntl::OFlag;
use nix::sys::stat::Mode;
use pathpatterns::{MatchEntry, MatchList, MatchPattern, MatchType, PatternFlag};
+use pbs_api_types::PathPattern;
use proxmox_router::cli::{self, CliCommand, CliCommandMap, CliHelper, CommandLineInterface};
use proxmox_schema::api;
use proxmox_sys::fs::{create_path, CreateOptions};
@@ -240,8 +241,7 @@ async fn list_selected_command(patterns: bool) -> Result<(), Error> {
input: {
properties: {
pattern: {
- type: String,
- description: "Match pattern for matching files in the catalog."
+ type: PathPattern,
},
select: {
type: bool,
@@ -282,9 +282,8 @@ async fn restore_selected_command(target: String) -> Result<(), Error> {
description: "target path for restore on local filesystem."
},
pattern: {
- type: String,
+ type: PathPattern,
optional: true,
- description: "match pattern to limit files for restore."
}
}
}
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-11-12 10:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 10:43 [pbs-devel] [PATCH v6 proxmox-backup 0/4] fix #2996: client: allow optional match patterns for restore Christian Ebner
2024-11-12 10:43 ` [pbs-devel] [PATCH v6 proxmox-backup 1/4] api-types: implement dedicated api type for match patterns Christian Ebner
2024-11-12 10:43 ` [pbs-devel] [PATCH v6 proxmox-backup 2/4] pxar: bin: use dedicated api type for restore pattern Christian Ebner
2024-11-12 10:43 ` Christian Ebner [this message]
2024-11-12 10:43 ` [pbs-devel] [PATCH v6 proxmox-backup 4/4] fix #2996: client: allow optional match patterns for restore Christian Ebner
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=20241112104316.206282-4-c.ebner@proxmox.com \
--to=c.ebner@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