proxmox_api/generated/cluster/metrics/
server.rs1pub mod id;
2pub struct ServerClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> ServerClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}{}", parent_path, "/server"),
14 }
15 }
16}
17impl<T> ServerClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "List configured metric servers."]
22 pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
23 let path = self.path.to_string();
24 self.client.get(&path, &())
25 }
26}
27impl GetOutputItems {
28 pub fn new(disable: bool, id: String, port: u64, server: String, ty: String) -> Self {
29 Self {
30 disable,
31 id,
32 port,
33 server,
34 ty,
35 additional_properties: Default::default(),
36 }
37 }
38}
39#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
40pub struct GetOutputItems {
41 #[serde(
42 serialize_with = "crate::types::serialize_bool",
43 deserialize_with = "crate::types::deserialize_bool"
44 )]
45 #[doc = "Flag to disable the plugin."]
46 pub disable: bool,
47 #[doc = "The ID of the entry."]
48 pub id: String,
49 #[serde(
50 serialize_with = "crate::types::serialize_int",
51 deserialize_with = "crate::types::deserialize_int"
52 )]
53 #[doc = "Server network port"]
54 pub port: u64,
55 #[doc = "Server dns name or IP address"]
56 pub server: String,
57 #[serde(rename = "type")]
58 #[doc = "Plugin type."]
59 pub ty: String,
60 #[serde(
61 flatten,
62 default,
63 skip_serializing_if = "::std::collections::HashMap::is_empty"
64 )]
65 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
66}
67impl<T> ServerClient<T>
68where
69 T: crate::client::Client,
70{
71 pub fn id(&self, id: &str) -> id::IdClient<T> {
72 id::IdClient::<T>::new(self.client.clone(), &self.path, id)
73 }
74}