proxmox_api/generated/
nodes.rs1pub mod node;
2pub struct NodesClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> NodesClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T) -> Self {
11 Self {
12 client,
13 path: "/nodes".to_string(),
14 }
15 }
16}
17impl<T> NodesClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Cluster node index."]
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(node: String, status: Status) -> Self {
29 Self {
30 node,
31 status,
32 cpu: Default::default(),
33 level: Default::default(),
34 maxcpu: Default::default(),
35 maxmem: Default::default(),
36 mem: Default::default(),
37 ssl_fingerprint: Default::default(),
38 uptime: Default::default(),
39 additional_properties: Default::default(),
40 }
41 }
42}
43#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
44pub struct GetOutputItems {
45 #[serde(
46 serialize_with = "crate::types::serialize_number_optional",
47 deserialize_with = "crate::types::deserialize_number_optional"
48 )]
49 #[serde(skip_serializing_if = "Option::is_none", default)]
50 #[doc = "CPU utilization."]
51 pub cpu: Option<f64>,
52 #[serde(skip_serializing_if = "Option::is_none", default)]
53 #[doc = "Support level."]
54 pub level: Option<String>,
55 #[serde(
56 serialize_with = "crate::types::serialize_int_optional",
57 deserialize_with = "crate::types::deserialize_int_optional"
58 )]
59 #[serde(skip_serializing_if = "Option::is_none", default)]
60 #[doc = "Number of available CPUs."]
61 pub maxcpu: Option<u64>,
62 #[serde(
63 serialize_with = "crate::types::serialize_int_optional",
64 deserialize_with = "crate::types::deserialize_int_optional"
65 )]
66 #[serde(skip_serializing_if = "Option::is_none", default)]
67 #[doc = "Number of available memory in bytes."]
68 pub maxmem: Option<u64>,
69 #[serde(
70 serialize_with = "crate::types::serialize_int_optional",
71 deserialize_with = "crate::types::deserialize_int_optional"
72 )]
73 #[serde(skip_serializing_if = "Option::is_none", default)]
74 #[doc = "Used memory in bytes."]
75 pub mem: Option<u64>,
76 #[doc = "The cluster node name."]
77 pub node: String,
78 #[serde(skip_serializing_if = "Option::is_none", default)]
79 #[doc = "The SSL fingerprint for the node certificate."]
80 pub ssl_fingerprint: Option<String>,
81 #[doc = "Node status."]
82 pub status: Status,
83 #[serde(
84 serialize_with = "crate::types::serialize_int_optional",
85 deserialize_with = "crate::types::deserialize_int_optional"
86 )]
87 #[serde(skip_serializing_if = "Option::is_none", default)]
88 #[doc = "Node uptime in seconds."]
89 pub uptime: Option<u64>,
90 #[serde(
91 flatten,
92 default,
93 skip_serializing_if = "::std::collections::HashMap::is_empty"
94 )]
95 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
96}
97#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
98pub enum Status {
99 #[serde(rename = "offline")]
100 Offline,
101 #[serde(rename = "online")]
102 Online,
103 #[serde(rename = "unknown")]
104 Unknown,
105}
106impl<T> NodesClient<T>
107where
108 T: crate::client::Client,
109{
110 pub fn node(&self, node: &str) -> node::NodeClient<T> {
111 node::NodeClient::<T>::new(self.client.clone(), &self.path, node)
112 }
113}