src/api2/types.rs: define struct BackupContent, and use it with list_snapshot_files

This commit is contained in:
Dietmar Maurer
2020-01-23 11:16:57 +01:00
parent 51534c8de9
commit 09b1f7b202
2 changed files with 72 additions and 39 deletions

View File

@ -259,6 +259,24 @@ pub struct SnapshotListItem {
pub size: Option<u64>,
}
#[api(
properties: {
"filename": {
schema: BACKUP_ARCHIVE_NAME_SCHEMA,
},
},
)]
#[derive(Serialize, Deserialize)]
#[serde(rename_all="kebab-case")]
/// Basic information about archive files inside a backup snapshot.
pub struct BackupContent {
pub filename: String,
/// Archive size (from backup manifest).
#[serde(skip_serializing_if="Option::is_none")]
pub size: Option<u64>,
}
// Regression tests