proxmox_api/generated/nodes/node/
rrd.rs

1pub struct RrdClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> RrdClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/rrd"),
13        }
14    }
15}
16impl<T> RrdClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Read node RRD statistics (returns PNG)"]
21    pub fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
22        let path = self.path.to_string();
23        self.client.get(&path, &params)
24    }
25}
26impl GetOutput {
27    pub fn new(filename: String) -> Self {
28        Self {
29            filename,
30            additional_properties: Default::default(),
31        }
32    }
33}
34#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
35pub struct GetOutput {
36    pub filename: String,
37    #[serde(
38        flatten,
39        default,
40        skip_serializing_if = "::std::collections::HashMap::is_empty"
41    )]
42    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
43}
44impl GetParams {
45    pub fn new(ds: String, timeframe: Timeframe) -> Self {
46        Self {
47            ds,
48            timeframe,
49            cf: Default::default(),
50            additional_properties: Default::default(),
51        }
52    }
53}
54#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
55pub struct GetParams {
56    #[serde(skip_serializing_if = "Option::is_none", default)]
57    #[doc = "The RRD consolidation function"]
58    pub cf: Option<Cf>,
59    #[doc = "The list of datasources you want to display."]
60    pub ds: String,
61    #[doc = "Specify the time frame you are interested in."]
62    pub timeframe: Timeframe,
63    #[serde(
64        flatten,
65        default,
66        skip_serializing_if = "::std::collections::HashMap::is_empty"
67    )]
68    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
69}
70#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
71pub enum Cf {
72    AVERAGE,
73    MAX,
74}
75#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
76pub enum Timeframe {
77    #[serde(rename = "day")]
78    Day,
79    #[serde(rename = "hour")]
80    Hour,
81    #[serde(rename = "month")]
82    Month,
83    #[serde(rename = "week")]
84    Week,
85    #[serde(rename = "year")]
86    Year,
87}