pve/nodes/node/ceph/
cfg.rs

1pub mod db;
2pub mod raw;
3
4#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
5pub struct GetResponseItem {}
6
7#[derive(Debug, Clone)]
8pub struct CfgClient<T> {
9    client: T,
10    path: String,
11}
12
13impl<T> CfgClient<T>
14where
15    T: Clone,
16{
17    pub fn new(client: T, parent_path: &str) -> Self {
18        Self {
19            client,
20            path: format!("{}/{}", parent_path, "cfg"),
21        }
22    }
23
24    pub fn raw(&self) -> raw::RawClient<T> {
25        raw::RawClient::<T>::new(self.client.clone(), &self.path)
26    }
27
28    pub fn db(&self) -> db::DbClient<T> {
29        db::DbClient::<T>::new(self.client.clone(), &self.path)
30    }
31}
32impl<T> CfgClient<T>
33where
34    T: crate::client::HttpClient,
35{
36    #[doc = "Directory index."]
37    pub fn get(&self) -> Result<Vec<GetResponseItem>, T::Error> {
38        self.client.get(&self.path, &())
39    }
40}
41#[derive(Debug, Clone)]
42pub struct AsyncCfgClient<T> {
43    client: T,
44    path: String,
45}
46
47impl<T> AsyncCfgClient<T>
48where
49    T: Clone,
50{
51    pub fn new(client: T, parent_path: &str) -> Self {
52        Self {
53            client,
54            path: format!("{}/{}", parent_path, "cfg"),
55        }
56    }
57
58    pub fn raw(&self) -> raw::AsyncRawClient<T> {
59        raw::AsyncRawClient::<T>::new(self.client.clone(), &self.path)
60    }
61
62    pub fn db(&self) -> db::AsyncDbClient<T> {
63        db::AsyncDbClient::<T>::new(self.client.clone(), &self.path)
64    }
65}
66impl<T> AsyncCfgClient<T>
67where
68    T: crate::client::AsyncHttpClient,
69{
70    #[doc = "Directory index."]
71    pub async fn get(&self) -> Result<Vec<GetResponseItem>, T::Error> {
72        self.client.get(&self.path, &()).await
73    }
74}