proxmox_api/generated/nodes/node/vzdump/
defaults.rs

1pub struct DefaultsClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> DefaultsClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/defaults"),
13        }
14    }
15}
16impl<T> DefaultsClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Get the currently configured vzdump defaults."]
21    pub fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
22        let path = self.path.to_string();
23        self.client.get(&path, &params)
24    }
25}
26#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
27pub struct GetOutput {
28    #[serde(
29        serialize_with = "crate::types::serialize_bool_optional",
30        deserialize_with = "crate::types::deserialize_bool_optional"
31    )]
32    #[serde(skip_serializing_if = "Option::is_none", default)]
33    #[doc = "Backup all known guest systems on this host."]
34    pub all: Option<bool>,
35    #[serde(
36        serialize_with = "crate::types::serialize_int_optional",
37        deserialize_with = "crate::types::deserialize_int_optional"
38    )]
39    #[serde(skip_serializing_if = "Option::is_none", default)]
40    #[doc = "Limit I/O bandwidth (in KiB/s)."]
41    pub bwlimit: Option<u64>,
42    #[serde(skip_serializing_if = "Option::is_none", default)]
43    #[doc = "Compress dump file."]
44    pub compress: Option<Compress>,
45    #[serde(skip_serializing_if = "Option::is_none", default)]
46    #[doc = "Store resulting files to specified directory."]
47    pub dumpdir: Option<String>,
48    #[serde(skip_serializing_if = "Option::is_none", default)]
49    #[doc = "Exclude specified guest systems (assumes --all)"]
50    pub exclude: Option<String>,
51    #[serde(rename = "exclude-path")]
52    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
53    #[doc = "Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory."]
54    pub exclude_path: Vec<String>,
55    #[serde(
56        serialize_with = "crate::types::serialize_int_optional",
57        deserialize_with = "crate::types::deserialize_int_optional"
58    )]
59    #[serde(skip_serializing_if = "Option::is_none", default)]
60    #[doc = "Set IO priority when using the BFQ scheduler. For snapshot and suspend mode backups of VMs, this only affects the compressor. A value of 8 means the idle priority is used, otherwise the best-effort priority is used with the specified value."]
61    pub ionice: Option<u64>,
62    #[serde(
63        serialize_with = "crate::types::serialize_int_optional",
64        deserialize_with = "crate::types::deserialize_int_optional"
65    )]
66    #[serde(skip_serializing_if = "Option::is_none", default)]
67    #[doc = "Maximal time to wait for the global lock (minutes)."]
68    pub lockwait: Option<u64>,
69    #[serde(skip_serializing_if = "Option::is_none", default)]
70    #[doc = "Deprecated: use notification targets/matchers instead. Specify when to send a notification mail"]
71    pub mailnotification: Option<Mailnotification>,
72    #[serde(skip_serializing_if = "Option::is_none", default)]
73    #[doc = "Deprecated: Use notification targets/matchers instead. Comma-separated list of email addresses or users that should receive email notifications."]
74    pub mailto: Option<String>,
75    #[serde(
76        serialize_with = "crate::types::serialize_int_optional",
77        deserialize_with = "crate::types::deserialize_int_optional"
78    )]
79    #[serde(skip_serializing_if = "Option::is_none", default)]
80    #[doc = "Deprecated: use 'prune-backups' instead. Maximal number of backup files per guest system."]
81    pub maxfiles: Option<u64>,
82    #[serde(skip_serializing_if = "Option::is_none", default)]
83    #[doc = "Backup mode."]
84    pub mode: Option<Mode>,
85    #[serde(skip_serializing_if = "Option::is_none", default)]
86    #[doc = "Only run if executed on this node."]
87    pub node: Option<String>,
88    #[serde(rename = "notes-template")]
89    #[serde(skip_serializing_if = "Option::is_none", default)]
90    #[doc = "Template string for generating notes for the backup(s). It can contain variables which will be replaced by their values. Currently supported are {{cluster}}, {{guestname}}, {{node}}, and {{vmid}}, but more might be added in the future. Needs to be a single line, newline and backslash need to be escaped as '\\n' and '\\\\' respectively."]
91    pub notes_template: Option<String>,
92    #[serde(rename = "notification-mode")]
93    #[serde(skip_serializing_if = "Option::is_none", default)]
94    #[doc = "Determine which notification system to use. If set to 'legacy-sendmail', vzdump will consider the mailto/mailnotification parameters and send emails to the specified address(es) via the 'sendmail' command. If set to 'notification-system', a notification will be sent via PVE's notification system, and the mailto and mailnotification will be ignored. If set to 'auto' (default setting), an email will be sent if mailto is set, and the notification system will be used if not."]
95    pub notification_mode: Option<NotificationMode>,
96    #[serde(rename = "notification-policy")]
97    #[serde(skip_serializing_if = "Option::is_none", default)]
98    #[doc = "Deprecated: Do not use"]
99    pub notification_policy: Option<NotificationPolicy>,
100    #[serde(rename = "notification-target")]
101    #[serde(skip_serializing_if = "Option::is_none", default)]
102    #[doc = "Deprecated: Do not use"]
103    pub notification_target: Option<String>,
104    #[serde(skip_serializing_if = "Option::is_none", default)]
105    #[doc = "Other performance-related settings."]
106    pub performance: Option<String>,
107    #[serde(
108        serialize_with = "crate::types::serialize_int_optional",
109        deserialize_with = "crate::types::deserialize_int_optional"
110    )]
111    #[serde(skip_serializing_if = "Option::is_none", default)]
112    #[doc = "Use pigz instead of gzip when N\\>0. N=1 uses half of cores, N\\>1 uses N as thread count."]
113    pub pigz: Option<u64>,
114    #[serde(skip_serializing_if = "Option::is_none", default)]
115    #[doc = "Backup all known guest systems included in the specified pool."]
116    pub pool: Option<String>,
117    #[serde(
118        serialize_with = "crate::types::serialize_bool_optional",
119        deserialize_with = "crate::types::deserialize_bool_optional"
120    )]
121    #[serde(skip_serializing_if = "Option::is_none", default)]
122    #[doc = "If true, mark backup(s) as protected."]
123    pub protected: Option<bool>,
124    #[serde(rename = "prune-backups")]
125    #[serde(skip_serializing_if = "Option::is_none", default)]
126    #[doc = "Use these retention options instead of those from the storage configuration."]
127    pub prune_backups: Option<String>,
128    #[serde(
129        serialize_with = "crate::types::serialize_bool_optional",
130        deserialize_with = "crate::types::deserialize_bool_optional"
131    )]
132    #[serde(skip_serializing_if = "Option::is_none", default)]
133    #[doc = "Be quiet."]
134    pub quiet: Option<bool>,
135    #[serde(
136        serialize_with = "crate::types::serialize_bool_optional",
137        deserialize_with = "crate::types::deserialize_bool_optional"
138    )]
139    #[serde(skip_serializing_if = "Option::is_none", default)]
140    #[doc = "Prune older backups according to 'prune-backups'."]
141    pub remove: Option<bool>,
142    #[serde(skip_serializing_if = "Option::is_none", default)]
143    #[doc = "Use specified hook script."]
144    pub script: Option<String>,
145    #[serde(
146        serialize_with = "crate::types::serialize_bool_optional",
147        deserialize_with = "crate::types::deserialize_bool_optional"
148    )]
149    #[serde(skip_serializing_if = "Option::is_none", default)]
150    #[doc = "Exclude temporary files and logs."]
151    pub stdexcludes: Option<bool>,
152    #[serde(
153        serialize_with = "crate::types::serialize_bool_optional",
154        deserialize_with = "crate::types::deserialize_bool_optional"
155    )]
156    #[serde(skip_serializing_if = "Option::is_none", default)]
157    #[doc = "Stop running backup jobs on this host."]
158    pub stop: Option<bool>,
159    #[serde(
160        serialize_with = "crate::types::serialize_int_optional",
161        deserialize_with = "crate::types::deserialize_int_optional"
162    )]
163    #[serde(skip_serializing_if = "Option::is_none", default)]
164    #[doc = "Maximal time to wait until a guest system is stopped (minutes)."]
165    pub stopwait: Option<u64>,
166    #[serde(skip_serializing_if = "Option::is_none", default)]
167    #[doc = "Store resulting file to this storage."]
168    pub storage: Option<String>,
169    #[serde(skip_serializing_if = "Option::is_none", default)]
170    #[doc = "Store temporary files to specified directory."]
171    pub tmpdir: Option<String>,
172    #[serde(skip_serializing_if = "Option::is_none", default)]
173    #[doc = "The ID of the guest system you want to backup."]
174    pub vmid: Option<String>,
175    #[serde(
176        serialize_with = "crate::types::serialize_int_optional",
177        deserialize_with = "crate::types::deserialize_int_optional"
178    )]
179    #[serde(skip_serializing_if = "Option::is_none", default)]
180    #[doc = "Zstd threads. N=0 uses half of the available cores, if N is set to a value bigger than 0, N is used as thread count."]
181    pub zstd: Option<u64>,
182}
183#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
184pub struct GetParams {
185    #[serde(skip_serializing_if = "Option::is_none", default)]
186    #[doc = "The storage identifier."]
187    pub storage: Option<String>,
188    #[serde(
189        flatten,
190        default,
191        skip_serializing_if = "::std::collections::HashMap::is_empty"
192    )]
193    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
194}
195#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
196pub enum Compress {
197    #[serde(rename = "0")]
198    _0,
199    #[serde(rename = "1")]
200    _1,
201    #[serde(rename = "gzip")]
202    Gzip,
203    #[serde(rename = "lzo")]
204    Lzo,
205    #[serde(rename = "zstd")]
206    Zstd,
207}
208impl Default for Compress {
209    fn default() -> Self {
210        Self::_0
211    }
212}
213#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
214pub enum Mailnotification {
215    #[serde(rename = "always")]
216    Always,
217    #[serde(rename = "failure")]
218    Failure,
219}
220impl Default for Mailnotification {
221    fn default() -> Self {
222        Self::Always
223    }
224}
225#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
226pub enum Mode {
227    #[serde(rename = "snapshot")]
228    Snapshot,
229    #[serde(rename = "stop")]
230    Stop,
231    #[serde(rename = "suspend")]
232    Suspend,
233}
234impl Default for Mode {
235    fn default() -> Self {
236        Self::Snapshot
237    }
238}
239#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
240pub enum NotificationMode {
241    #[serde(rename = "auto")]
242    Auto,
243    #[serde(rename = "legacy-sendmail")]
244    LegacySendmail,
245    #[serde(rename = "notification-system")]
246    NotificationSystem,
247}
248impl Default for NotificationMode {
249    fn default() -> Self {
250        Self::Auto
251    }
252}
253#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
254pub enum NotificationPolicy {
255    #[serde(rename = "always")]
256    Always,
257    #[serde(rename = "failure")]
258    Failure,
259    #[serde(rename = "never")]
260    Never,
261}
262impl Default for NotificationPolicy {
263    fn default() -> Self {
264        Self::Always
265    }
266}