proxmox_api/generated/nodes/node/ceph/osd/osdid/
metadata.rs1pub struct MetadataClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> MetadataClient<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, "/metadata"),
13 }
14 }
15}
16impl<T> MetadataClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Get OSD details"]
21 pub fn get(&self) -> Result<GetOutput, T::Error> {
22 let path = self.path.to_string();
23 self.client.get(&path, &())
24 }
25}
26impl DevicesGetOutputDevicesItems {
27 pub fn new(
28 dev_node: String,
29 device: Device,
30 devices: String,
31 size: u64,
32 support_discard: bool,
33 ty: String,
34 ) -> Self {
35 Self {
36 dev_node,
37 device,
38 devices,
39 size,
40 support_discard,
41 ty,
42 additional_properties: Default::default(),
43 }
44 }
45}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
47pub struct DevicesGetOutputDevicesItems {
48 #[doc = "Device node"]
49 pub dev_node: String,
50 #[doc = "Kind of OSD device"]
51 pub device: Device,
52 #[doc = "Physical disks used"]
53 pub devices: String,
54 #[serde(
55 serialize_with = "crate::types::serialize_int",
56 deserialize_with = "crate::types::deserialize_int"
57 )]
58 #[doc = "Size in bytes"]
59 pub size: u64,
60 #[serde(
61 serialize_with = "crate::types::serialize_bool",
62 deserialize_with = "crate::types::deserialize_bool"
63 )]
64 #[doc = "Discard support of the physical device"]
65 pub support_discard: bool,
66 #[serde(rename = "type")]
67 #[doc = "Type of device. For example, hdd or ssd"]
68 pub ty: String,
69 #[serde(
70 flatten,
71 default,
72 skip_serializing_if = "::std::collections::HashMap::is_empty"
73 )]
74 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
75}
76impl GetOutput {
77 pub fn new(devices: Vec<DevicesGetOutputDevicesItems>, osd: OsdGetOutputOsd) -> Self {
78 Self {
79 devices,
80 osd,
81 additional_properties: Default::default(),
82 }
83 }
84}
85#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
86pub struct GetOutput {
87 #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
88 #[doc = "Array containing data about devices"]
89 pub devices: Vec<DevicesGetOutputDevicesItems>,
90 #[doc = "General information about the OSD"]
91 pub osd: OsdGetOutputOsd,
92 #[serde(
93 flatten,
94 default,
95 skip_serializing_if = "::std::collections::HashMap::is_empty"
96 )]
97 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
98}
99impl OsdGetOutputOsd {
100 pub fn new(
101 back_addr: String,
102 front_addr: String,
103 hb_back_addr: String,
104 hb_front_addr: String,
105 hostname: String,
106 id: u64,
107 mem_usage: u64,
108 osd_data: String,
109 osd_objectstore: String,
110 pid: u64,
111 version: String,
112 ) -> Self {
113 Self {
114 back_addr,
115 front_addr,
116 hb_back_addr,
117 hb_front_addr,
118 hostname,
119 id,
120 mem_usage,
121 osd_data,
122 osd_objectstore,
123 pid,
124 version,
125 additional_properties: Default::default(),
126 }
127 }
128}
129#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
130pub struct OsdGetOutputOsd {
131 #[doc = "Address and port used to talk to other OSDs."]
132 pub back_addr: String,
133 #[doc = "Address and port used to talk to clients and monitors."]
134 pub front_addr: String,
135 #[doc = "Heartbeat address and port for other OSDs."]
136 pub hb_back_addr: String,
137 #[doc = "Heartbeat address and port for clients and monitors."]
138 pub hb_front_addr: String,
139 #[doc = "Name of the host containing the OSD."]
140 pub hostname: String,
141 #[serde(
142 serialize_with = "crate::types::serialize_int",
143 deserialize_with = "crate::types::deserialize_int"
144 )]
145 #[doc = "ID of the OSD."]
146 pub id: u64,
147 #[serde(
148 serialize_with = "crate::types::serialize_int",
149 deserialize_with = "crate::types::deserialize_int"
150 )]
151 #[doc = "Memory usage of the OSD service."]
152 pub mem_usage: u64,
153 #[doc = "Path to the OSD's data directory."]
154 pub osd_data: String,
155 #[doc = "The type of object store used."]
156 pub osd_objectstore: String,
157 #[serde(
158 serialize_with = "crate::types::serialize_int",
159 deserialize_with = "crate::types::deserialize_int"
160 )]
161 #[doc = "OSD process ID."]
162 pub pid: u64,
163 #[doc = "Ceph version of the OSD service."]
164 pub version: String,
165 #[serde(
166 flatten,
167 default,
168 skip_serializing_if = "::std::collections::HashMap::is_empty"
169 )]
170 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
171}
172#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
173pub enum Device {
174 #[serde(rename = "block")]
175 Block,
176 #[serde(rename = "db")]
177 Db,
178 #[serde(rename = "wal")]
179 Wal,
180}