mirror of
https://git.proxmox.com/git/proxmox
synced 2025-04-29 20:39:08 +00:00
rrd: add api-types
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
parent
7ea63a6fb9
commit
88731c52f0
@ -28,4 +28,5 @@ proxmox-time.workspace = true
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "rrd_v1" ]
|
default = [ "rrd_v1" ]
|
||||||
|
api-types = []
|
||||||
rrd_v1 = []
|
rrd_v1 = []
|
||||||
|
33
proxmox-rrd/src/api_types.rs
Normal file
33
proxmox-rrd/src/api_types.rs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use proxmox_schema::api;
|
||||||
|
|
||||||
|
#[api()]
|
||||||
|
#[derive(Copy, Clone, Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "UPPERCASE")]
|
||||||
|
/// RRD consolidation mode
|
||||||
|
pub enum RRDMode {
|
||||||
|
/// Maximum
|
||||||
|
Max,
|
||||||
|
/// Average
|
||||||
|
Average,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[api()]
|
||||||
|
#[derive(Copy, Clone, Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "lowercase")]
|
||||||
|
/// RRD time frame
|
||||||
|
pub enum RRDTimeFrame {
|
||||||
|
/// Hour
|
||||||
|
Hour,
|
||||||
|
/// Day
|
||||||
|
Day,
|
||||||
|
/// Week
|
||||||
|
Week,
|
||||||
|
/// Month
|
||||||
|
Month,
|
||||||
|
/// Year
|
||||||
|
Year,
|
||||||
|
/// Decade (10 years)
|
||||||
|
Decade,
|
||||||
|
}
|
@ -17,3 +17,6 @@ pub use rrd::Entry;
|
|||||||
|
|
||||||
mod cache;
|
mod cache;
|
||||||
pub use cache::*;
|
pub use cache::*;
|
||||||
|
|
||||||
|
#[cfg(feature = "api-types")]
|
||||||
|
pub mod api_types;
|
||||||
|
Loading…
Reference in New Issue
Block a user