api-types: introduce BackupType enum and Group/Dir api types

The type is a real enum.

All are API types and implement Display and FromStr. The
ordering is the same as it is in pbs-datastore.

Also, they are now flattened into a few structs instead of
being copied manually.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2022-04-14 15:05:58 +02:00
committed by Thomas Lamprecht
parent 33eb23d57e
commit 988d575dbb
23 changed files with 449 additions and 278 deletions

View File

@ -441,7 +441,7 @@ pub fn list_content(
for (store, snapshot) in media_catalog_snapshot_list(status_path, &media_id)? {
let backup_dir: BackupDir = snapshot.parse()?;
if let Some(ref backup_type) = filter.backup_type {
if let Some(backup_type) = filter.backup_type {
if backup_dir.group().backup_type() != backup_type {
continue;
}