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

@ -523,7 +523,7 @@ pub fn complete_remote_datastore_group(_arg: &str, param: &HashMap<String, Strin
.await
}) {
for item in data {
list.push(format!("{}/{}", item.backup_type, item.backup_id));
list.push(format!("{}/{}", item.backup.ty, item.backup.id));
}
}
}