src/api2/admin/datastore.rs: rename get_group_list to list_groups, cleanups

This commit is contained in:
Dietmar Maurer
2019-03-02 16:28:36 +01:00
parent 184f17afad
commit ad20d19877
2 changed files with 19 additions and 11 deletions

View File

@ -52,7 +52,7 @@ fn mark_selections<F: Fn(DateTime<Local>, &BackupInfo) -> String> (
}
}
fn get_group_list(
fn list_groups(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
@ -76,10 +76,11 @@ fn get_group_list(
let group = &info.backup_dir.group;
groups.push(json!({
"backup_type": group.backup_type,
"backup_id": group.backup_id,
"last_backup": info.backup_dir.backup_time.timestamp(),
"num_backups": list.len() as u64,
"backup-type": group.backup_type,
"backup-id": group.backup_id,
"last-backup": info.backup_dir.backup_time.timestamp(),
"backup-count": list.len() as u64,
"files": info.files,
}));
}
@ -372,7 +373,7 @@ pub fn router() -> Router {
"groups",
Router::new()
.get(ApiMethod::new(
get_group_list,
list_groups,
ObjectSchema::new("List backup groups.")
.required("store", store_schema.clone()))))
.subdir(