src/api2/types.rs: fix SnapshotListItem schema definition

This commit is contained in:
Dietmar Maurer 2020-01-09 10:36:19 +01:00
parent 7d2396859c
commit 71da3d6a1b
1 changed files with 8 additions and 1 deletions

View File

@ -121,7 +121,6 @@ pub const DATASTORE_SCHEMA: Schema = StringSchema::new("Datastore name.")
// Complex type definitions
#[api(
description: "Basic information about backup snapshot.",
properties: {
"backup-type": {
schema: BACKUP_TYPE_SCHEMA,
@ -132,15 +131,23 @@ pub const DATASTORE_SCHEMA: Schema = StringSchema::new("Datastore name.")
"backup-time": {
schema: BACKUP_TIME_SCHEMA,
},
files: {
items: {
schema: BACKUP_ARCHIVE_NAME_SCHEMA
},
},
},
)]
#[derive(Serialize, Deserialize)]
#[serde(rename_all="kebab-case")]
/// Basic information about backup snapshot.
pub struct SnapshotListItem {
pub backup_type: String, // enum
pub backup_id: String,
pub backup_time: i64,
/// List of contained archive files.
pub files: Vec<String>,
/// Overall snapshot size (sum of all archive sizes).
#[serde(skip_serializing_if="Option::is_none")]
pub size: Option<u64>,
}