clientapi-pve 2026.5.24

Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
/*
 * Proxmox Virtual Environment API
 *
 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
 *
 * The version of the OpenAPI document: 9.x
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PveQemuSataConfig {

    /// AIO type to use.
    #[serde(rename = "aio", skip_serializing_if = "Option::is_none")]
    pub aio: Option<models::PveAioEnum>,

    /// Whether the drive should be included when making backups.
    #[serde(rename = "backup", skip_serializing_if = "Option::is_none")]
    pub backup: Option<models::PveBoolean>,

    /// Maximum r/w speed in bytes per second.
    #[serde(rename = "bps", skip_serializing_if = "Option::is_none")]
    pub bps: Option<i64>,

    /// Maximum length of I/O bursts in seconds.
    #[serde(rename = "bps_max_length", skip_serializing_if = "Option::is_none")]
    pub bps_max_length: Option<i64>,

    /// Maximum read speed in bytes per second.
    #[serde(rename = "bps_rd", skip_serializing_if = "Option::is_none")]
    pub bps_rd: Option<i64>,

    #[serde(rename = "bps_rd_length", skip_serializing_if = "Option::is_none")]
    pub bps_rd_length: Option<String>,

    /// Maximum length of read I/O bursts in seconds.
    #[serde(rename = "bps_rd_max_length", skip_serializing_if = "Option::is_none")]
    pub bps_rd_max_length: Option<i64>,

    /// Maximum write speed in bytes per second.
    #[serde(rename = "bps_wr", skip_serializing_if = "Option::is_none")]
    pub bps_wr: Option<i64>,

    #[serde(rename = "bps_wr_length", skip_serializing_if = "Option::is_none")]
    pub bps_wr_length: Option<String>,

    /// Maximum length of write I/O bursts in seconds.
    #[serde(rename = "bps_wr_max_length", skip_serializing_if = "Option::is_none")]
    pub bps_wr_max_length: Option<i64>,

    /// The drive's cache mode
    #[serde(rename = "cache", skip_serializing_if = "Option::is_none")]
    pub cache: Option<models::PveCacheEnum>,

    /// Controls whether to detect and try to optimize writes of zeroes.
    #[serde(rename = "detect_zeroes", skip_serializing_if = "Option::is_none")]
    pub detect_zeroes: Option<models::PveBoolean>,

    /// Controls whether to pass discard/trim requests to the underlying storage.
    #[serde(rename = "discard", skip_serializing_if = "Option::is_none")]
    pub discard: Option<models::PveDiscardEnum>,

    /// The drive's backing volume.
    #[serde(rename = "file")]
    pub file: String,

    /// The drive's backing file's data format.
    #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
    pub format: Option<models::PveFormatEnum>,

    /// Maximum r/w I/O in operations per second.
    #[serde(rename = "iops", skip_serializing_if = "Option::is_none")]
    pub iops: Option<i64>,

    /// Maximum unthrottled r/w I/O pool in operations per second.
    #[serde(rename = "iops_max", skip_serializing_if = "Option::is_none")]
    pub iops_max: Option<i64>,

    /// Maximum length of I/O bursts in seconds.
    #[serde(rename = "iops_max_length", skip_serializing_if = "Option::is_none")]
    pub iops_max_length: Option<i64>,

    /// Maximum read I/O in operations per second.
    #[serde(rename = "iops_rd", skip_serializing_if = "Option::is_none")]
    pub iops_rd: Option<i64>,

    #[serde(rename = "iops_rd_length", skip_serializing_if = "Option::is_none")]
    pub iops_rd_length: Option<String>,

    /// Maximum unthrottled read I/O pool in operations per second.
    #[serde(rename = "iops_rd_max", skip_serializing_if = "Option::is_none")]
    pub iops_rd_max: Option<i64>,

    /// Maximum length of read I/O bursts in seconds.
    #[serde(rename = "iops_rd_max_length", skip_serializing_if = "Option::is_none")]
    pub iops_rd_max_length: Option<i64>,

    /// Maximum write I/O in operations per second.
    #[serde(rename = "iops_wr", skip_serializing_if = "Option::is_none")]
    pub iops_wr: Option<i64>,

    #[serde(rename = "iops_wr_length", skip_serializing_if = "Option::is_none")]
    pub iops_wr_length: Option<String>,

    /// Maximum unthrottled write I/O pool in operations per second.
    #[serde(rename = "iops_wr_max", skip_serializing_if = "Option::is_none")]
    pub iops_wr_max: Option<i64>,

    /// Maximum length of write I/O bursts in seconds.
    #[serde(rename = "iops_wr_max_length", skip_serializing_if = "Option::is_none")]
    pub iops_wr_max_length: Option<i64>,

    /// Maximum r/w speed in megabytes per second.
    #[serde(rename = "mbps", skip_serializing_if = "Option::is_none")]
    pub mbps: Option<f64>,

    /// Maximum unthrottled r/w pool in megabytes per second.
    #[serde(rename = "mbps_max", skip_serializing_if = "Option::is_none")]
    pub mbps_max: Option<f64>,

    /// Maximum read speed in megabytes per second.
    #[serde(rename = "mbps_rd", skip_serializing_if = "Option::is_none")]
    pub mbps_rd: Option<f64>,

    /// Maximum unthrottled read pool in megabytes per second.
    #[serde(rename = "mbps_rd_max", skip_serializing_if = "Option::is_none")]
    pub mbps_rd_max: Option<f64>,

    /// Maximum write speed in megabytes per second.
    #[serde(rename = "mbps_wr", skip_serializing_if = "Option::is_none")]
    pub mbps_wr: Option<f64>,

    /// Maximum unthrottled write pool in megabytes per second.
    #[serde(rename = "mbps_wr_max", skip_serializing_if = "Option::is_none")]
    pub mbps_wr_max: Option<f64>,

    /// The drive's media type.
    #[serde(rename = "media", skip_serializing_if = "Option::is_none")]
    pub media: Option<models::PveMediaEnum>,

    /// Whether the drive should considered for replication jobs.
    #[serde(rename = "replicate", skip_serializing_if = "Option::is_none")]
    pub replicate: Option<models::PveBoolean>,

    /// Read error action.
    #[serde(rename = "rerror", skip_serializing_if = "Option::is_none")]
    pub rerror: Option<models::PveRerrorEnum>,

    /// The drive's reported serial number, url-encoded, up to 20 bytes long.
    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
    pub serial: Option<String>,

    /// Mark this locally-managed volume as available on all nodes.  WARNING: This option does not share the volume automatically, it assumes it is shared already!
    #[serde(rename = "shared", skip_serializing_if = "Option::is_none")]
    pub shared: Option<models::PveBoolean>,

    /// Disk size. This is purely informational and has no effect.
    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
    pub size: Option<String>,

    /// Controls qemu's snapshot mode feature. If activated, changes made to the disk are temporary and will be discarded when the VM is shutdown.
    #[serde(rename = "snapshot", skip_serializing_if = "Option::is_none")]
    pub snapshot: Option<models::PveBoolean>,

    /// Whether to expose this drive as an SSD, rather than a rotational hard disk.
    #[serde(rename = "ssd", skip_serializing_if = "Option::is_none")]
    pub ssd: Option<models::PveBoolean>,

    #[serde(rename = "volume", skip_serializing_if = "Option::is_none")]
    pub volume: Option<String>,

    /// Write error action.
    #[serde(rename = "werror", skip_serializing_if = "Option::is_none")]
    pub werror: Option<models::PveWerrorEnum>,

    /// The drive's worldwide name, encoded as 16 bytes hex string, prefixed by '0x'.
    #[serde(rename = "wwn", skip_serializing_if = "Option::is_none")]
    pub wwn: Option<String>,


}

impl PveQemuSataConfig {
    pub fn new(file: String) -> PveQemuSataConfig {
        PveQemuSataConfig {
            
            aio: None,
            
            backup: None,
            
            bps: None,
            
            bps_max_length: None,
            
            bps_rd: None,
            
            bps_rd_length: None,
            
            bps_rd_max_length: None,
            
            bps_wr: None,
            
            bps_wr_length: None,
            
            bps_wr_max_length: None,
            
            cache: None,
            
            detect_zeroes: None,
            
            discard: None,
            
            file,
            
            format: None,
            
            iops: None,
            
            iops_max: None,
            
            iops_max_length: None,
            
            iops_rd: None,
            
            iops_rd_length: None,
            
            iops_rd_max: None,
            
            iops_rd_max_length: None,
            
            iops_wr: None,
            
            iops_wr_length: None,
            
            iops_wr_max: None,
            
            iops_wr_max_length: None,
            
            mbps: None,
            
            mbps_max: None,
            
            mbps_rd: None,
            
            mbps_rd_max: None,
            
            mbps_wr: None,
            
            mbps_wr_max: None,
            
            media: None,
            
            replicate: None,
            
            rerror: None,
            
            serial: None,
            
            shared: None,
            
            size: None,
            
            snapshot: None,
            
            ssd: None,
            
            volume: None,
            
            werror: None,
            
            wwn: None,
            
        }
    }
}


impl PveQemuSataConfig {
    /// Serialise this PveQemuSataConfig into Proxmox's CLI-style shorthand
    /// string (`key=value,…`). The property marked `x-pve-default-key`
    /// is emitted positionally without a `key=` prefix; aliases collapse
    /// multiple property names to the same wire key.
    ///
    /// Example: `PveQemuSataConfig `
    /// → `"virtio,bridge=vmbr0"`
    pub fn to_shorthand(&self) -> String {
        let mut parts: Vec<String> = Vec::new();
        
        
        parts.push(format!("{}", self.file));
        
        
        
        
        if let Some(ref v) = self.aio {
            parts.push(format!("aio={}", v));
        }
        
        
        if let Some(ref v) = self.backup {
            parts.push(format!("backup={}", v));
        }
        
        
        if let Some(ref v) = self.bps {
            parts.push(format!("bps={}", v));
        }
        
        
        if let Some(ref v) = self.bps_max_length {
            parts.push(format!("bps_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.bps_rd {
            parts.push(format!("bps_rd={}", v));
        }
        
        
        if let Some(ref v) = self.bps_rd_length {
            parts.push(format!("bps_rd_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.bps_rd_max_length {
            parts.push(format!("bps_rd_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.bps_wr {
            parts.push(format!("bps_wr={}", v));
        }
        
        
        if let Some(ref v) = self.bps_wr_length {
            parts.push(format!("bps_wr_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.bps_wr_max_length {
            parts.push(format!("bps_wr_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.cache {
            parts.push(format!("cache={}", v));
        }
        
        
        if let Some(ref v) = self.detect_zeroes {
            parts.push(format!("detect_zeroes={}", v));
        }
        
        
        if let Some(ref v) = self.discard {
            parts.push(format!("discard={}", v));
        }
        
        
        if let Some(ref v) = self.format {
            parts.push(format!("format={}", v));
        }
        
        
        if let Some(ref v) = self.iops {
            parts.push(format!("iops={}", v));
        }
        
        
        if let Some(ref v) = self.iops_max {
            parts.push(format!("iops_max={}", v));
        }
        
        
        if let Some(ref v) = self.iops_max_length {
            parts.push(format!("iops_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.iops_rd {
            parts.push(format!("iops_rd={}", v));
        }
        
        
        if let Some(ref v) = self.iops_rd_length {
            parts.push(format!("iops_rd_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.iops_rd_max {
            parts.push(format!("iops_rd_max={}", v));
        }
        
        
        if let Some(ref v) = self.iops_rd_max_length {
            parts.push(format!("iops_rd_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.iops_wr {
            parts.push(format!("iops_wr={}", v));
        }
        
        
        if let Some(ref v) = self.iops_wr_length {
            parts.push(format!("iops_wr_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.iops_wr_max {
            parts.push(format!("iops_wr_max={}", v));
        }
        
        
        if let Some(ref v) = self.iops_wr_max_length {
            parts.push(format!("iops_wr_max_length={}", v));
        }
        
        
        if let Some(ref v) = self.mbps {
            parts.push(format!("mbps={}", v));
        }
        
        
        if let Some(ref v) = self.mbps_max {
            parts.push(format!("mbps_max={}", v));
        }
        
        
        if let Some(ref v) = self.mbps_rd {
            parts.push(format!("mbps_rd={}", v));
        }
        
        
        if let Some(ref v) = self.mbps_rd_max {
            parts.push(format!("mbps_rd_max={}", v));
        }
        
        
        if let Some(ref v) = self.mbps_wr {
            parts.push(format!("mbps_wr={}", v));
        }
        
        
        if let Some(ref v) = self.mbps_wr_max {
            parts.push(format!("mbps_wr_max={}", v));
        }
        
        
        if let Some(ref v) = self.media {
            parts.push(format!("media={}", v));
        }
        
        
        if let Some(ref v) = self.replicate {
            parts.push(format!("replicate={}", v));
        }
        
        
        if let Some(ref v) = self.rerror {
            parts.push(format!("rerror={}", v));
        }
        
        
        if let Some(ref v) = self.serial {
            parts.push(format!("serial={}", v));
        }
        
        
        if let Some(ref v) = self.shared {
            parts.push(format!("shared={}", v));
        }
        
        
        if let Some(ref v) = self.size {
            parts.push(format!("size={}", v));
        }
        
        
        if let Some(ref v) = self.snapshot {
            parts.push(format!("snapshot={}", v));
        }
        
        
        if let Some(ref v) = self.ssd {
            parts.push(format!("ssd={}", v));
        }
        
        
        if let Some(ref v) = self.volume {
            parts.push(format!("file={}", v));
        }
        
        
        if let Some(ref v) = self.werror {
            parts.push(format!("werror={}", v));
        }
        
        
        if let Some(ref v) = self.wwn {
            parts.push(format!("wwn={}", v));
        }
        
        parts.join(",")
    }
}