Skip to main content

clientapi_pve/models/
pve_storage_dir_config.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct PveStorageDirConfig {
16
17    /// File system path.
18    #[serde(rename = "path")]
19    pub path: String,
20
21    /// Overrides for default content type directories.
22    #[serde(rename = "content-dirs", skip_serializing_if = "Option::is_none")]
23    pub content_dirs: Option<String>,
24
25    /// List of nodes for which the storage configuration applies.
26    #[serde(rename = "nodes", skip_serializing_if = "Option::is_none")]
27    pub nodes: Option<String>,
28
29    /// 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!
30    #[serde(rename = "shared", skip_serializing_if = "Option::is_none")]
31    pub shared: Option<models::PveBoolean>,
32
33    /// Flag to disable the storage.
34    #[serde(rename = "disable", skip_serializing_if = "Option::is_none")]
35    pub disable: Option<models::PveBoolean>,
36
37    /// 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.
38    #[serde(rename = "prune-backups", skip_serializing_if = "Option::is_none")]
39    pub prune_backups: Option<String>,
40
41    /// Maximal number of protected backups per guest. Use '-1' for unlimited.
42    #[serde(rename = "max-protected-backups", skip_serializing_if = "Option::is_none")]
43    pub max_protected_backups: Option<i64>,
44
45    /// Allowed content types.  NOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs. 
46    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
47    pub content: Option<String>,
48
49    /// Default image format.
50    #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
51    pub format: Option<models::PveFormatFormatEnum>,
52
53    /// 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.
54    #[serde(rename = "mkdir", skip_serializing_if = "Option::is_none")]
55    pub mkdir: Option<models::PveBoolean>,
56
57    /// Create the base directory if it doesn't exist.
58    #[serde(rename = "create-base-path", skip_serializing_if = "Option::is_none")]
59    pub create_base_path: Option<models::PveBoolean>,
60
61    /// Populate the directory with the default structure.
62    #[serde(rename = "create-subdirs", skip_serializing_if = "Option::is_none")]
63    pub create_subdirs: Option<models::PveBoolean>,
64
65    /// 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.
66    #[serde(rename = "is_mountpoint", skip_serializing_if = "Option::is_none")]
67    pub is_mountpoint: Option<String>,
68
69    /// Set I/O bandwidth limit for various operations (in KiB/s).
70    #[serde(rename = "bwlimit", skip_serializing_if = "Option::is_none")]
71    pub bwlimit: Option<Box<models::PveBwlimitField>>,
72
73    /// Preallocation mode for raw and qcow2 images. Using 'metadata' on raw images results in preallocation=off.
74    #[serde(rename = "preallocation", skip_serializing_if = "Option::is_none")]
75    pub preallocation: Option<models::PvePreallocationEnum>,
76
77    /// Enable support for creating storage-vendor agnostic snapshot through volume backing-chains.
78    #[serde(rename = "snapshot-as-volume-chain", skip_serializing_if = "Option::is_none")]
79    pub snapshot_as_volume_chain: Option<models::PveBoolean>,
80
81    #[serde(rename = "type")]
82    pub r#type: Type,
83
84
85}
86
87impl PveStorageDirConfig {
88    pub fn new(path: String, r#type: Type) -> PveStorageDirConfig {
89        PveStorageDirConfig {
90            
91            path,
92            
93            content_dirs: None,
94            
95            nodes: None,
96            
97            shared: None,
98            
99            disable: None,
100            
101            prune_backups: None,
102            
103            max_protected_backups: None,
104            
105            content: None,
106            
107            format: None,
108            
109            mkdir: None,
110            
111            create_base_path: None,
112            
113            create_subdirs: None,
114            
115            is_mountpoint: None,
116            
117            bwlimit: None,
118            
119            preallocation: None,
120            
121            snapshot_as_volume_chain: None,
122            
123            r#type,
124            
125        }
126    }
127}
128
129/// 
130#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
131pub enum Type {
132    #[serde(rename = "dir")]
133    Dir,
134}
135
136impl Default for Type {
137    fn default() -> Type {
138        Self::Dir
139    }
140}
141