proxmox_api/generated/cluster/
log.rs1#[derive(Debug, Clone)]
2pub struct LogClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> LogClient<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, "/log"),
14 }
15 }
16}
17impl<T> LogClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Read cluster log"]
22 #[doc = ""]
23 #[doc = "The user needs 'Sys.Syslog' on '/' in order to get all logs."]
24 pub async fn get(&self, params: GetParams) -> Result<Vec<GetOutputItems>, T::Error> {
25 let path = self.path.to_string();
26 let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, ¶ms).await?;
27 Ok(optional_vec.unwrap_or_default())
28 }
29}
30#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
31pub struct GetOutputItems {
32 #[serde(
33 flatten,
34 default,
35 skip_serializing_if = "::std::collections::HashMap::is_empty"
36 )]
37 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
38}
39#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
40pub struct GetParams {
41 #[serde(
42 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
43 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
44 )]
45 #[serde(skip_serializing_if = "Option::is_none", default)]
46 #[doc = "Maximum number of entries."]
47 #[doc = ""]
48 pub max: Option<std::num::NonZeroU64>,
49 #[serde(
50 flatten,
51 default,
52 skip_serializing_if = "::std::collections::HashMap::is_empty"
53 )]
54 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
55}