proxmox_api/generated/nodes/node/ceph/
osd.rs1pub mod osdid;
2pub struct OsdClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> OsdClient<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, "/osd"),
14 }
15 }
16}
17impl<T> OsdClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Get Ceph osd list/tree."]
22 pub fn get(&self) -> Result<GetOutput, T::Error> {
23 let path = self.path.to_string();
24 self.client.get(&path, &())
25 }
26}
27impl<T> OsdClient<T>
28where
29 T: crate::client::Client,
30{
31 #[doc = "Create OSD"]
32 pub fn post(&self, params: PostParams) -> Result<String, T::Error> {
33 let path = self.path.to_string();
34 self.client.post(&path, ¶ms)
35 }
36}
37#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
38pub struct GetOutput {
39 #[serde(
40 flatten,
41 default,
42 skip_serializing_if = "::std::collections::HashMap::is_empty"
43 )]
44 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
45}
46impl PostParams {
47 pub fn new(dev: String) -> Self {
48 Self {
49 dev,
50 crush_device_class: Default::default(),
51 db_dev: Default::default(),
52 db_dev_size: Default::default(),
53 encrypted: Default::default(),
54 osds_per_device: Default::default(),
55 wal_dev: Default::default(),
56 wal_dev_size: Default::default(),
57 additional_properties: Default::default(),
58 }
59 }
60}
61#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
62pub struct PostParams {
63 #[serde(rename = "crush-device-class")]
64 #[serde(skip_serializing_if = "Option::is_none", default)]
65 #[doc = "Set the device class of the OSD in crush."]
66 pub crush_device_class: Option<String>,
67 #[serde(skip_serializing_if = "Option::is_none", default)]
68 #[doc = "Block device name for block.db."]
69 pub db_dev: Option<String>,
70 #[serde(skip_serializing_if = "Option::is_none", default)]
71 #[doc = "Size in GiB for block.db."]
72 #[doc = "If a block.db is requested but the size is not given, will be automatically selected by: bluestore_block_db_size from the ceph database (osd or global section) or config (osd or global section) in that order. If this is not available, it will be sized 10% of the size of the OSD device. Fails if the available size is not enough."]
73 pub db_dev_size: Option<()>,
74 #[doc = "Block device name."]
75 pub dev: String,
76 #[serde(
77 serialize_with = "crate::types::serialize_bool_optional",
78 deserialize_with = "crate::types::deserialize_bool_optional"
79 )]
80 #[serde(skip_serializing_if = "Option::is_none", default)]
81 #[doc = "Enables encryption of the OSD."]
82 pub encrypted: Option<bool>,
83 #[serde(rename = "osds-per-device")]
84 #[serde(skip_serializing_if = "Option::is_none", default)]
85 #[doc = "OSD services per physical device. Only useful for fast NVMe devices\"\n\t\t .\" to utilize their performance better."]
86 pub osds_per_device: Option<()>,
87 #[serde(skip_serializing_if = "Option::is_none", default)]
88 #[doc = "Block device name for block.wal."]
89 pub wal_dev: Option<String>,
90 #[serde(skip_serializing_if = "Option::is_none", default)]
91 #[doc = "Size in GiB for block.wal."]
92 #[doc = "If a block.wal is requested but the size is not given, will be automatically selected by: bluestore_block_wal_size from the ceph database (osd or global section) or config (osd or global section) in that order. If this is not available, it will be sized 1% of the size of the OSD device. Fails if the available size is not enough."]
93 pub wal_dev_size: Option<()>,
94 #[serde(
95 flatten,
96 default,
97 skip_serializing_if = "::std::collections::HashMap::is_empty"
98 )]
99 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
100}
101impl<T> OsdClient<T>
102where
103 T: crate::client::Client,
104{
105 pub fn osdid(&self, osdid: &str) -> osdid::OsdidClient<T> {
106 osdid::OsdidClient::<T>::new(self.client.clone(), &self.path, osdid)
107 }
108}