]> git.proxmox.com Git - proxmox-backup.git/blob - src/api2/node/report.rs
api: apt: adapt to proxmox-apt back-end changes
[proxmox-backup.git] / src / api2 / node / report.rs
1 use anyhow::Error;
2 use proxmox::api::{api, ApiMethod, Permission, Router, RpcEnvironment};
3 use serde_json::{json, Value};
4
5 use crate::api2::types::*;
6 use crate::config::acl::PRIV_SYS_AUDIT;
7 use crate::server::generate_report;
8
9 #[api(
10 input: {
11 properties: {
12 node: {
13 schema: NODE_SCHEMA,
14 },
15 },
16 },
17 returns: {
18 type: String,
19 description: "Returns report of the node"
20 },
21 access: {
22 permission: &Permission::Privilege(&["system", "status"], PRIV_SYS_AUDIT, false),
23 },
24 )]
25 /// Generate a report
26 fn get_report(
27 _param: Value,
28 _info: &ApiMethod,
29 _rpcenv: &mut dyn RpcEnvironment,
30 ) -> Result<Value, Error> {
31 Ok(json!(generate_report()))
32 }
33
34 pub const ROUTER: Router = Router::new()
35 .get(&API_METHOD_GET_REPORT);