proxmox_api/generated/nodes/node/qemu/vmid/
cloudinit.rs

1pub mod dump;
2pub struct CloudinitClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> CloudinitClient<T>
7where
8    T: crate::client::Client,
9{
10    pub fn new(client: T, parent_path: &str) -> Self {
11        Self {
12            client,
13            path: format!("{}{}", parent_path, "/cloudinit"),
14        }
15    }
16}
17impl<T> CloudinitClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Get the cloudinit configuration with both current and pending values."]
22    pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
23        let path = self.path.to_string();
24        self.client.get(&path, &())
25    }
26}
27impl<T> CloudinitClient<T>
28where
29    T: crate::client::Client,
30{
31    #[doc = "Regenerate and change cloudinit config drive."]
32    pub fn put(&self) -> Result<(), T::Error> {
33        let path = self.path.to_string();
34        self.client.put(&path, &())
35    }
36}
37impl GetOutputItems {
38    pub fn new(key: String) -> Self {
39        Self {
40            key,
41            delete: Default::default(),
42            pending: Default::default(),
43            value: Default::default(),
44            additional_properties: Default::default(),
45        }
46    }
47}
48#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
49pub struct GetOutputItems {
50    #[serde(
51        serialize_with = "crate::types::serialize_int_optional",
52        deserialize_with = "crate::types::deserialize_int_optional"
53    )]
54    #[serde(skip_serializing_if = "Option::is_none", default)]
55    #[doc = "Indicates a pending delete request if present and not 0. "]
56    pub delete: Option<u64>,
57    #[doc = "Configuration option name."]
58    pub key: String,
59    #[serde(skip_serializing_if = "Option::is_none", default)]
60    #[doc = "The new pending value."]
61    pub pending: Option<String>,
62    #[serde(skip_serializing_if = "Option::is_none", default)]
63    #[doc = "Value as it was used to generate the current cloudinit image."]
64    pub value: Option<String>,
65    #[serde(
66        flatten,
67        default,
68        skip_serializing_if = "::std::collections::HashMap::is_empty"
69    )]
70    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
71}
72impl<T> CloudinitClient<T>
73where
74    T: crate::client::Client,
75{
76    pub fn dump(&self) -> dump::DumpClient<T> {
77        dump::DumpClient::<T>::new(self.client.clone(), &self.path)
78    }
79}