proxmox_api/generated/cluster/backup/id/
included_volumes.rs

1pub struct IncludedVolumesClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> IncludedVolumesClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/included_volumes"),
13        }
14    }
15}
16impl<T> IncludedVolumesClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Returns included guests and the backup status of their disks. Optimized to be used in ExtJS tree views."]
21    pub fn get(&self) -> Result<GetOutput, T::Error> {
22        let path = self.path.to_string();
23        self.client.get(&path, &())
24    }
25}
26impl ChildrenGetOutputChildrenItems {
27    pub fn new(id: u64, ty: Type) -> Self {
28        Self {
29            id,
30            ty,
31            children: Default::default(),
32            name: Default::default(),
33            additional_properties: Default::default(),
34        }
35    }
36}
37#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
38pub struct ChildrenGetOutputChildrenItems {
39    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
40    #[doc = "The volumes of the guest with the information if they will be included in backups."]
41    pub children: Vec<ChildrenGetOutputChildrenItemsChildrenItems>,
42    #[serde(
43        serialize_with = "crate::types::serialize_int",
44        deserialize_with = "crate::types::deserialize_int"
45    )]
46    #[doc = "VMID of the guest."]
47    pub id: u64,
48    #[serde(skip_serializing_if = "Option::is_none", default)]
49    #[doc = "Name of the guest"]
50    pub name: Option<String>,
51    #[serde(rename = "type")]
52    #[doc = "Type of the guest, VM, CT or unknown for removed but not purged guests."]
53    pub ty: Type,
54    #[serde(
55        flatten,
56        default,
57        skip_serializing_if = "::std::collections::HashMap::is_empty"
58    )]
59    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
60}
61impl ChildrenGetOutputChildrenItemsChildrenItems {
62    pub fn new(id: String, included: bool, name: String, reason: String) -> Self {
63        Self {
64            id,
65            included,
66            name,
67            reason,
68            additional_properties: Default::default(),
69        }
70    }
71}
72#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
73pub struct ChildrenGetOutputChildrenItemsChildrenItems {
74    #[doc = "Configuration key of the volume."]
75    pub id: String,
76    #[serde(
77        serialize_with = "crate::types::serialize_bool",
78        deserialize_with = "crate::types::deserialize_bool"
79    )]
80    #[doc = "Whether the volume is included in the backup or not."]
81    pub included: bool,
82    #[doc = "Name of the volume."]
83    pub name: String,
84    #[doc = "The reason why the volume is included (or excluded)."]
85    pub reason: String,
86    #[serde(
87        flatten,
88        default,
89        skip_serializing_if = "::std::collections::HashMap::is_empty"
90    )]
91    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
92}
93impl GetOutput {
94    pub fn new(children: Vec<ChildrenGetOutputChildrenItems>) -> Self {
95        Self {
96            children,
97            additional_properties: Default::default(),
98        }
99    }
100}
101#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
102pub struct GetOutput {
103    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
104    pub children: Vec<ChildrenGetOutputChildrenItems>,
105    #[serde(
106        flatten,
107        default,
108        skip_serializing_if = "::std::collections::HashMap::is_empty"
109    )]
110    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
111}
112#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
113pub enum Type {
114    #[serde(rename = "lxc")]
115    Lxc,
116    #[serde(rename = "qemu")]
117    Qemu,
118    #[serde(rename = "unknown")]
119    Unknown,
120}