5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-06 13:18:00 +03:00

client: catalog shell: use dedicated api type for patterns

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>
This commit is contained in:
Christian Ebner 2024-11-12 11:43:15 +01:00 committed by Fabian Grünbichler
parent 33031f9835
commit 70545af183

View File

@ -14,6 +14,7 @@ use nix::fcntl::OFlag;
use nix::sys::stat::Mode; use nix::sys::stat::Mode;
use pathpatterns::{MatchEntry, MatchList, MatchPattern, MatchType, PatternFlag}; use pathpatterns::{MatchEntry, MatchList, MatchPattern, MatchType, PatternFlag};
use pbs_api_types::PathPattern;
use proxmox_router::cli::{self, CliCommand, CliCommandMap, CliHelper, CommandLineInterface}; use proxmox_router::cli::{self, CliCommand, CliCommandMap, CliHelper, CommandLineInterface};
use proxmox_schema::api; use proxmox_schema::api;
use proxmox_sys::fs::{create_path, CreateOptions}; use proxmox_sys::fs::{create_path, CreateOptions};
@ -240,8 +241,7 @@ async fn list_selected_command(patterns: bool) -> Result<(), Error> {
input: { input: {
properties: { properties: {
pattern: { pattern: {
type: String, type: PathPattern,
description: "Match pattern for matching files in the catalog."
}, },
select: { select: {
type: bool, type: bool,
@ -282,9 +282,8 @@ async fn restore_selected_command(target: String) -> Result<(), Error> {
description: "target path for restore on local filesystem." description: "target path for restore on local filesystem."
}, },
pattern: { pattern: {
type: String, type: PathPattern,
optional: true, optional: true,
description: "match pattern to limit files for restore."
} }
} }
} }