proxmox_api/generated/cluster/
metrics.rs1pub mod export;
2pub mod server;
3#[derive(Debug, Clone)]
4pub struct MetricsClient<T> {
5 client: T,
6 path: String,
7}
8impl<T> MetricsClient<T>
9where
10 T: crate::client::Client,
11{
12 pub fn new(client: T, parent_path: &str) -> Self {
13 Self {
14 client,
15 path: format!("{}{}", parent_path, "/metrics"),
16 }
17 }
18}
19impl<T> MetricsClient<T>
20where
21 T: crate::client::Client,
22{
23 #[doc = "Metrics index."]
24 #[doc = ""]
25 pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
26 let path = self.path.to_string();
27 let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
28 Ok(optional_vec.unwrap_or_default())
29 }
30}
31#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
32pub struct GetOutputItems {
33 #[serde(
34 flatten,
35 default,
36 skip_serializing_if = "::std::collections::HashMap::is_empty"
37 )]
38 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
39}
40impl<T> MetricsClient<T>
41where
42 T: crate::client::Client,
43{
44 pub fn server(&self) -> server::ServerClient<T> {
45 server::ServerClient::<T>::new(self.client.clone(), &self.path)
46 }
47}
48impl<T> MetricsClient<T>
49where
50 T: crate::client::Client,
51{
52 pub fn export(&self) -> export::ExportClient<T> {
53 export::ExportClient::<T>::new(self.client.clone(), &self.path)
54 }
55}