docs: api-viewer - add backup and restore APIs

This commit is contained in:
Dietmar Maurer 2021-02-21 10:38:33 +01:00
parent c9dd5a2452
commit 0bf4b81370
1 changed files with 14 additions and 5 deletions

View File

@ -60,17 +60,26 @@ fn main() -> Result<(), Error> {
fn generate_api_tree() -> String {
//let api = api2::reader::READER_API_ROUTER;
let api = api2::ROUTER;
let mut tree = Vec::new();
let mut data = dump_api_schema(&api, ".");
let mut data = dump_api_schema(& api2::ROUTER, ".");
data["path"] = "/".into();
data["text"] = "/".into();
// hack: add invisible space to sort as first entry
data["text"] = "&#x200b;Management API (HTTP)".into();
data["expanded"] = true.into();
tree.push(data);
let mut data = dump_api_schema(&api2::backup::BACKUP_API_ROUTER, ".");
data["path"] = "/".into();
data["text"] = "Backup API (HTTP/2)".into();
tree.push(data);
let mut data = dump_api_schema(&api2::reader::READER_API_ROUTER, ".");
data["path"] = "/".into();
data["text"] = "Restore API (HTTP/2)".into();
tree.push(data);
format!("var pbsapi = {};", serde_json::to_string_pretty(&tree).unwrap())
}