proxmox_api/generated/nodes/node/
vzdump.rs

1pub mod defaults;
2pub mod extractconfig;
3pub struct VzdumpClient<T> {
4    client: T,
5    path: String,
6}
7impl<T> VzdumpClient<T>
8where
9    T: crate::client::Client,
10{
11    pub fn new(client: T, parent_path: &str) -> Self {
12        Self {
13            client,
14            path: format!("{}{}", parent_path, "/vzdump"),
15        }
16    }
17}
18impl<T> VzdumpClient<T>
19where
20    T: crate::client::Client,
21{
22    #[doc = "Create backup."]
23    pub fn post(&self, params: PostParams) -> Result<String, T::Error> {
24        let path = self.path.to_string();
25        self.client.post(&path, &params)
26    }
27}
28#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
29pub struct PostParams {
30    #[serde(
31        serialize_with = "crate::types::serialize_bool_optional",
32        deserialize_with = "crate::types::deserialize_bool_optional"
33    )]
34    #[serde(skip_serializing_if = "Option::is_none", default)]
35    #[doc = "Backup all known guest systems on this host."]
36    pub all: Option<bool>,
37    #[serde(
38        serialize_with = "crate::types::serialize_int_optional",
39        deserialize_with = "crate::types::deserialize_int_optional"
40    )]
41    #[serde(skip_serializing_if = "Option::is_none", default)]
42    #[doc = "Limit I/O bandwidth (in KiB/s)."]
43    pub bwlimit: Option<u64>,
44    #[serde(skip_serializing_if = "Option::is_none", default)]
45    #[doc = "Compress dump file."]
46    pub compress: Option<Compress>,
47    #[serde(skip_serializing_if = "Option::is_none", default)]
48    #[doc = "Store resulting files to specified directory."]
49    pub dumpdir: Option<String>,
50    #[serde(skip_serializing_if = "Option::is_none", default)]
51    #[doc = "Exclude specified guest systems (assumes --all)"]
52    pub exclude: Option<String>,
53    #[serde(rename = "exclude-path")]
54    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
55    #[doc = "Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory."]
56    pub exclude_path: Vec<String>,
57    #[serde(
58        serialize_with = "crate::types::serialize_int_optional",
59        deserialize_with = "crate::types::deserialize_int_optional"
60    )]
61    #[serde(skip_serializing_if = "Option::is_none", default)]
62    #[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."]
63    pub ionice: Option<u64>,
64    #[serde(
65        serialize_with = "crate::types::serialize_int_optional",
66        deserialize_with = "crate::types::deserialize_int_optional"
67    )]
68    #[serde(skip_serializing_if = "Option::is_none", default)]
69    #[doc = "Maximal time to wait for the global lock (minutes)."]
70    pub lockwait: Option<u64>,
71    #[serde(skip_serializing_if = "Option::is_none", default)]
72    #[doc = "Deprecated: use notification targets/matchers instead. Specify when to send a notification mail"]
73    pub mailnotification: Option<Mailnotification>,
74    #[serde(skip_serializing_if = "Option::is_none", default)]
75    #[doc = "Deprecated: Use notification targets/matchers instead. Comma-separated list of email addresses or users that should receive email notifications."]
76    pub mailto: Option<String>,
77    #[serde(
78        serialize_with = "crate::types::serialize_int_optional",
79        deserialize_with = "crate::types::deserialize_int_optional"
80    )]
81    #[serde(skip_serializing_if = "Option::is_none", default)]
82    #[doc = "Deprecated: use 'prune-backups' instead. Maximal number of backup files per guest system."]
83    pub maxfiles: Option<u64>,
84    #[serde(skip_serializing_if = "Option::is_none", default)]
85    #[doc = "Backup mode."]
86    pub mode: Option<Mode>,
87    #[serde(rename = "notes-template")]
88    #[serde(skip_serializing_if = "Option::is_none", default)]
89    #[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."]
90    pub notes_template: Option<String>,
91    #[serde(rename = "notification-mode")]
92    #[serde(skip_serializing_if = "Option::is_none", default)]
93    #[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."]
94    pub notification_mode: Option<NotificationMode>,
95    #[serde(rename = "notification-policy")]
96    #[serde(skip_serializing_if = "Option::is_none", default)]
97    #[doc = "Deprecated: Do not use"]
98    pub notification_policy: Option<NotificationPolicy>,
99    #[serde(rename = "notification-target")]
100    #[serde(skip_serializing_if = "Option::is_none", default)]
101    #[doc = "Deprecated: Do not use"]
102    pub notification_target: Option<String>,
103    #[serde(skip_serializing_if = "Option::is_none", default)]
104    #[doc = "Other performance-related settings."]
105    pub performance: Option<String>,
106    #[serde(
107        serialize_with = "crate::types::serialize_int_optional",
108        deserialize_with = "crate::types::deserialize_int_optional"
109    )]
110    #[serde(skip_serializing_if = "Option::is_none", default)]
111    #[doc = "Use pigz instead of gzip when N\\>0. N=1 uses half of cores, N\\>1 uses N as thread count."]
112    pub pigz: Option<u64>,
113    #[serde(skip_serializing_if = "Option::is_none", default)]
114    #[doc = "Backup all known guest systems included in the specified pool."]
115    pub pool: Option<String>,
116    #[serde(
117        serialize_with = "crate::types::serialize_bool_optional",
118        deserialize_with = "crate::types::deserialize_bool_optional"
119    )]
120    #[serde(skip_serializing_if = "Option::is_none", default)]
121    #[doc = "If true, mark backup(s) as protected."]
122    pub protected: Option<bool>,
123    #[serde(rename = "prune-backups")]
124    #[serde(skip_serializing_if = "Option::is_none", default)]
125    #[doc = "Use these retention options instead of those from the storage configuration."]
126    pub prune_backups: Option<String>,
127    #[serde(
128        serialize_with = "crate::types::serialize_bool_optional",
129        deserialize_with = "crate::types::deserialize_bool_optional"
130    )]
131    #[serde(skip_serializing_if = "Option::is_none", default)]
132    #[doc = "Be quiet."]
133    pub quiet: Option<bool>,
134    #[serde(
135        serialize_with = "crate::types::serialize_bool_optional",
136        deserialize_with = "crate::types::deserialize_bool_optional"
137    )]
138    #[serde(skip_serializing_if = "Option::is_none", default)]
139    #[doc = "Prune older backups according to 'prune-backups'."]
140    pub remove: Option<bool>,
141    #[serde(skip_serializing_if = "Option::is_none", default)]
142    #[doc = "Use specified hook script."]
143    pub script: Option<String>,
144    #[serde(
145        serialize_with = "crate::types::serialize_bool_optional",
146        deserialize_with = "crate::types::deserialize_bool_optional"
147    )]
148    #[serde(skip_serializing_if = "Option::is_none", default)]
149    #[doc = "Exclude temporary files and logs."]
150    pub stdexcludes: Option<bool>,
151    #[serde(
152        serialize_with = "crate::types::serialize_bool_optional",
153        deserialize_with = "crate::types::deserialize_bool_optional"
154    )]
155    #[serde(skip_serializing_if = "Option::is_none", default)]
156    #[doc = "Write tar to stdout, not to a file."]
157    pub stdout: Option<bool>,
158    #[serde(
159        serialize_with = "crate::types::serialize_bool_optional",
160        deserialize_with = "crate::types::deserialize_bool_optional"
161    )]
162    #[serde(skip_serializing_if = "Option::is_none", default)]
163    #[doc = "Stop running backup jobs on this host."]
164    pub stop: Option<bool>,
165    #[serde(
166        serialize_with = "crate::types::serialize_int_optional",
167        deserialize_with = "crate::types::deserialize_int_optional"
168    )]
169    #[serde(skip_serializing_if = "Option::is_none", default)]
170    #[doc = "Maximal time to wait until a guest system is stopped (minutes)."]
171    pub stopwait: Option<u64>,
172    #[serde(skip_serializing_if = "Option::is_none", default)]
173    #[doc = "Store resulting file to this storage."]
174    pub storage: Option<String>,
175    #[serde(skip_serializing_if = "Option::is_none", default)]
176    #[doc = "Store temporary files to specified directory."]
177    pub tmpdir: Option<String>,
178    #[serde(skip_serializing_if = "Option::is_none", default)]
179    #[doc = "The ID of the guest system you want to backup."]
180    pub vmid: Option<String>,
181    #[serde(
182        serialize_with = "crate::types::serialize_int_optional",
183        deserialize_with = "crate::types::deserialize_int_optional"
184    )]
185    #[serde(skip_serializing_if = "Option::is_none", default)]
186    #[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."]
187    pub zstd: Option<u64>,
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}
267impl<T> VzdumpClient<T>
268where
269    T: crate::client::Client,
270{
271    pub fn defaults(&self) -> defaults::DefaultsClient<T> {
272        defaults::DefaultsClient::<T>::new(self.client.clone(), &self.path)
273    }
274}
275impl<T> VzdumpClient<T>
276where
277    T: crate::client::Client,
278{
279    pub fn extractconfig(&self) -> extractconfig::ExtractconfigClient<T> {
280        extractconfig::ExtractconfigClient::<T>::new(self.client.clone(), &self.path)
281    }
282}