src/bin/proxmox-backup-client.rs: correctly format prune result list.
This commit is contained in:
@ -455,6 +455,11 @@ macro_rules! add_common_prune_prameters {
|
||||
}
|
||||
}
|
||||
|
||||
pub const API_RETURN_SCHEMA_PRUNE: Schema = ArraySchema::new(
|
||||
"Returns the list of snapshots and a flag indicating if there are kept or removed.",
|
||||
PruneListItem::API_SCHEMA
|
||||
).schema();
|
||||
|
||||
const API_METHOD_PRUNE: ApiMethod = ApiMethod::new(
|
||||
&ApiHandler::Sync(&prune),
|
||||
&ObjectSchema::new(
|
||||
@ -469,8 +474,9 @@ const API_METHOD_PRUNE: ApiMethod = ApiMethod::new(
|
||||
],[
|
||||
("store", false, &DATASTORE_SCHEMA),
|
||||
])
|
||||
)
|
||||
).access(None, &Permission::Privilege(
|
||||
))
|
||||
.returns(&API_RETURN_SCHEMA_PRUNE)
|
||||
.access(None, &Permission::Privilege(
|
||||
&["datastore", "{store}"],
|
||||
PRIV_DATASTORE_MODIFY | PRIV_DATASTORE_PRUNE,
|
||||
true)
|
||||
|
@ -391,6 +391,30 @@ pub struct SnapshotListItem {
|
||||
pub size: Option<u64>,
|
||||
}
|
||||
|
||||
#[api(
|
||||
properties: {
|
||||
"backup-type": {
|
||||
schema: BACKUP_TYPE_SCHEMA,
|
||||
},
|
||||
"backup-id": {
|
||||
schema: BACKUP_ID_SCHEMA,
|
||||
},
|
||||
"backup-time": {
|
||||
schema: BACKUP_TIME_SCHEMA,
|
||||
},
|
||||
},
|
||||
)]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all="kebab-case")]
|
||||
/// Prune result.
|
||||
pub struct PruneListItem {
|
||||
pub backup_type: String, // enum
|
||||
pub backup_id: String,
|
||||
pub backup_time: i64,
|
||||
/// Keep snapshot
|
||||
pub keep: bool,
|
||||
}
|
||||
|
||||
#[api(
|
||||
properties: {
|
||||
"filename": {
|
||||
|
Reference in New Issue
Block a user