Skip to main content

proxmox_api/generated/nodes/node/ceph/
rules.rs

1#[derive(Debug, Clone)]
2pub struct RulesClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> RulesClient<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, "/rules"),
14        }
15    }
16}
17impl<T> RulesClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "List ceph rules."]
22    #[doc = ""]
23    #[doc = "Permission check: perm(\"/\", [\"Sys.Audit\", \"Datastore.Audit\"], any)"]
24    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
25        let path = self.path.to_string();
26        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
27        Ok(optional_vec.unwrap_or_default())
28    }
29}
30impl GetOutputItems {
31    pub fn new(name: String) -> Self {
32        Self {
33            name,
34            additional_properties: ::std::default::Default::default(),
35        }
36    }
37}
38#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
39pub struct GetOutputItems {
40    #[doc = "Name of the CRUSH rule."]
41    #[doc = ""]
42    pub name: String,
43    #[serde(
44        flatten,
45        default,
46        skip_serializing_if = "::std::collections::HashMap::is_empty"
47    )]
48    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
49}