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
/*
* 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 PveStorageNfsConfig {
/// File system path.
#[serde(rename = "path")]
pub path: String,
/// Overrides for default content type directories.
#[serde(rename = "content-dirs", skip_serializing_if = "Option::is_none")]
pub content_dirs: Option<String>,
/// Server IP or DNS name.
#[serde(rename = "server")]
pub server: String,
/// NFS export path.
#[serde(rename = "export")]
pub export: String,
/// List of nodes for which the storage configuration applies.
#[serde(rename = "nodes", skip_serializing_if = "Option::is_none")]
pub nodes: Option<String>,
/// 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>,
/// NFS/CIFS mount options (see 'man nfs' or 'man mount.cifs')
#[serde(rename = "options", skip_serializing_if = "Option::is_none")]
pub options: Option<String>,
/// 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>,
/// 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>,
/// Set I/O bandwidth limit for various operations (in KiB/s).
#[serde(rename = "bwlimit", skip_serializing_if = "Option::is_none")]
pub bwlimit: Option<Box<models::PveBwlimitField>>,
/// 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>,
/// Enable support for creating storage-vendor agnostic snapshot through volume backing-chains.
#[serde(rename = "snapshot-as-volume-chain", skip_serializing_if = "Option::is_none")]
pub snapshot_as_volume_chain: Option<models::PveBoolean>,
#[serde(rename = "type")]
pub r#type: Type,
}
impl PveStorageNfsConfig {
pub fn new(path: String, server: String, export: String, r#type: Type) -> PveStorageNfsConfig {
PveStorageNfsConfig {
path,
content_dirs: None,
server,
export,
nodes: None,
disable: None,
prune_backups: None,
max_protected_backups: None,
options: None,
content: None,
format: None,
mkdir: None,
create_base_path: None,
create_subdirs: None,
bwlimit: None,
preallocation: None,
snapshot_as_volume_chain: None,
r#type,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "nfs")]
Nfs,
}
impl Default for Type {
fn default() -> Type {
Self::Nfs
}
}