proxmox_api/generated/nodes/node/
journal.rs1#[derive(Debug, Clone)]
2pub struct JournalClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> JournalClient<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, "/journal"),
14 }
15 }
16}
17impl<T> JournalClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Read Journal"]
22 #[doc = ""]
23 #[doc = "Permission check: perm(\"/nodes/{node}\", [\"Sys.Syslog\"])"]
24 pub async fn get(&self, params: GetParams) -> Result<Vec<String>, T::Error> {
25 let path = self.path.to_string();
26 let optional_vec: Option<Vec<String>> = 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 GetParams {
32 #[serde(skip_serializing_if = "Option::is_none", default)]
33 #[doc = "End before the given Cursor. Conflicts with 'until'"]
34 #[doc = ""]
35 pub endcursor: Option<String>,
36 #[serde(
37 serialize_with = "crate::types::serialize_unsigned_int_optional",
38 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
39 )]
40 #[serde(skip_serializing_if = "Option::is_none", default)]
41 #[doc = "Limit to the last X lines. Conflicts with a range."]
42 #[doc = ""]
43 pub lastentries: Option<u64>,
44 #[serde(
45 serialize_with = "crate::types::serialize_unsigned_int_optional",
46 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
47 )]
48 #[serde(skip_serializing_if = "Option::is_none", default)]
49 #[doc = "Display all log since this UNIX epoch. Conflicts with 'startcursor'."]
50 #[doc = ""]
51 pub since: Option<u64>,
52 #[serde(skip_serializing_if = "Option::is_none", default)]
53 #[doc = "Start after the given Cursor. Conflicts with 'since'"]
54 #[doc = ""]
55 pub startcursor: Option<String>,
56 #[serde(
57 serialize_with = "crate::types::serialize_unsigned_int_optional",
58 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
59 )]
60 #[serde(skip_serializing_if = "Option::is_none", default)]
61 #[doc = "Display all log until this UNIX epoch. Conflicts with 'endcursor'."]
62 #[doc = ""]
63 pub until: Option<u64>,
64 #[serde(
65 flatten,
66 default,
67 skip_serializing_if = "::std::collections::HashMap::is_empty"
68 )]
69 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
70}