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
/*
 * 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 PveStorageDirConfig {

    /// 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>,

    /// 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>,

    /// 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>,

    /// 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 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 PveStorageDirConfig {
    pub fn new(path: String, r#type: Type) -> PveStorageDirConfig {
        PveStorageDirConfig {
            
            path,
            
            content_dirs: None,
            
            nodes: None,
            
            shared: None,
            
            disable: None,
            
            prune_backups: None,
            
            max_protected_backups: None,
            
            content: None,
            
            format: None,
            
            mkdir: None,
            
            create_base_path: None,
            
            create_subdirs: None,
            
            is_mountpoint: 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 = "dir")]
    Dir,
}

impl Default for Type {
    fn default() -> Type {
        Self::Dir
    }
}