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