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
/*
* 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 PveStorageBtrfsConfig {
/// File system path.
#[serde(rename = "path")]
pub path: String,
/// List of nodes for which the storage configuration applies.
#[serde(rename = "nodes", skip_serializing_if = "Option::is_none")]
pub nodes: Option<String>,
/// Indicate that this is a single storage with the same contents on all nodes (or all listed in the 'nodes' option). It will not make the contents of a local storage automatically accessible to other nodes, it just marks an already shared storage as such!
#[serde(rename = "shared", skip_serializing_if = "Option::is_none")]
pub shared: Option<models::PveBoolean>,
/// Flag to disable the storage.
#[serde(rename = "disable", skip_serializing_if = "Option::is_none")]
pub disable: Option<models::PveBoolean>,
/// The retention options with shorter intervals are processed first with --keep-last being the very first one. Each option covers a specific period of time. We say that backups within this period are covered by this option. The next option does not take care of already covered backups and only considers older backups.
#[serde(rename = "prune-backups", skip_serializing_if = "Option::is_none")]
pub prune_backups: Option<String>,
/// Maximal number of protected backups per guest. Use '-1' for unlimited.
#[serde(rename = "max-protected-backups", skip_serializing_if = "Option::is_none")]
pub max_protected_backups: Option<i64>,
/// Allowed content types. NOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs.
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
/// Default image format.
#[serde(rename = "format", skip_serializing_if = "Option::is_none")]
pub format: Option<models::PveFormatFormatEnum>,
/// Assume the given path is an externally managed mountpoint and consider the storage offline if it is not mounted. Using a boolean (yes/no) value serves as a shortcut to using the target path in this field.
#[serde(rename = "is_mountpoint", skip_serializing_if = "Option::is_none")]
pub is_mountpoint: Option<String>,
/// Set the NOCOW flag on files. Disables data checksumming and causes data errors to be unrecoverable from while allowing direct I/O. Only use this if data does not need to be any more safe than on a single ext4 formatted disk with no underlying raid system.
#[serde(rename = "nocow", skip_serializing_if = "Option::is_none")]
pub nocow: Option<models::PveBoolean>,
/// Create the directory if it doesn't exist and populate it with default sub-dirs. NOTE: Deprecated, use the 'create-base-path' and 'create-subdirs' options instead.
#[serde(rename = "mkdir", skip_serializing_if = "Option::is_none")]
pub mkdir: Option<models::PveBoolean>,
/// Create the base directory if it doesn't exist.
#[serde(rename = "create-base-path", skip_serializing_if = "Option::is_none")]
pub create_base_path: Option<models::PveBoolean>,
/// Populate the directory with the default structure.
#[serde(rename = "create-subdirs", skip_serializing_if = "Option::is_none")]
pub create_subdirs: Option<models::PveBoolean>,
/// Preallocation mode for raw and qcow2 images. Using 'metadata' on raw images results in preallocation=off.
#[serde(rename = "preallocation", skip_serializing_if = "Option::is_none")]
pub preallocation: Option<models::PvePreallocationEnum>,
#[serde(rename = "type")]
pub r#type: Type,
}
impl PveStorageBtrfsConfig {
pub fn new(path: String, r#type: Type) -> PveStorageBtrfsConfig {
PveStorageBtrfsConfig {
path,
nodes: None,
shared: None,
disable: None,
prune_backups: None,
max_protected_backups: None,
content: None,
format: None,
is_mountpoint: None,
nocow: None,
mkdir: None,
create_base_path: None,
create_subdirs: None,
preallocation: None,
r#type,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "btrfs")]
Btrfs,
}
impl Default for Type {
fn default() -> Type {
Self::Btrfs
}
}