api2/types: add TAPE_RESTORE_SNAPSHOT_SCHEMA

which is 'store:type/id/time'

needed to refactor SNAPSHOT_PATH_REGEX_STR from backup_info

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2021-05-06 14:20:03 +02:00
committed by Dietmar Maurer
parent 82a4bb5e80
commit 5e42d38598
3 changed files with 20 additions and 1 deletions

View File

@ -25,6 +25,13 @@ macro_rules! BACKUP_TIME_RE {
};
}
#[macro_export]
macro_rules! SNAPSHOT_PATH_REGEX_STR {
() => (
concat!(r"(", BACKUP_TYPE_RE!(), ")/(", BACKUP_ID_RE!(), ")/(", BACKUP_TIME_RE!(), r")")
);
}
const_regex! {
BACKUP_FILE_REGEX = r"^.*\.([fd]idx|blob)$";
@ -37,7 +44,7 @@ const_regex! {
GROUP_PATH_REGEX = concat!(r"^(", BACKUP_TYPE_RE!(), ")/(", BACKUP_ID_RE!(), r")$");
SNAPSHOT_PATH_REGEX = concat!(
r"^(", BACKUP_TYPE_RE!(), ")/(", BACKUP_ID_RE!(), ")/(", BACKUP_TIME_RE!(), r")$");
r"^", SNAPSHOT_PATH_REGEX_STR!(), r"$");
}
/// BackupGroup is a directory containing a list of BackupDir