proxmox_api/generated/nodes/node/
config.rs

1pub struct ConfigClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> ConfigClient<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, "/config"),
13        }
14    }
15}
16impl<T> ConfigClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Get node configuration options."]
21    pub fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
22        let path = self.path.to_string();
23        self.client.get(&path, &params)
24    }
25}
26impl<T> ConfigClient<T>
27where
28    T: crate::client::Client,
29{
30    #[doc = "Set node configuration options."]
31    pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
32        let path = self.path.to_string();
33        self.client.put(&path, &params)
34    }
35}
36#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
37pub struct GetOutput {
38    #[serde(skip_serializing_if = "Option::is_none", default)]
39    #[doc = "Node specific ACME settings."]
40    pub acme: Option<String>,
41    #[serde(rename = "acmedomain[n]")]
42    #[serde(
43        serialize_with = "crate::types::serialize_multi::<NumberedAcmedomains, _>",
44        deserialize_with = "crate::types::deserialize_multi::<NumberedAcmedomains, _>"
45    )]
46    #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
47    #[serde(flatten)]
48    #[doc = "ACME domain and validation plugin"]
49    pub acmedomains: ::std::collections::HashMap<u32, String>,
50    #[serde(skip_serializing_if = "Option::is_none", default)]
51    #[doc = "Description for the Node. Shown in the web-interface node notes panel. This is saved as comment inside the configuration file."]
52    pub description: Option<String>,
53    #[serde(skip_serializing_if = "Option::is_none", default)]
54    #[doc = "Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications."]
55    pub digest: Option<String>,
56    #[serde(rename = "startall-onboot-delay")]
57    #[serde(
58        serialize_with = "crate::types::serialize_int_optional",
59        deserialize_with = "crate::types::deserialize_int_optional"
60    )]
61    #[serde(skip_serializing_if = "Option::is_none", default)]
62    #[doc = "Initial delay in seconds, before starting all the Virtual Guests with on-boot enabled."]
63    pub startall_onboot_delay: Option<u64>,
64    #[serde(skip_serializing_if = "Option::is_none", default)]
65    #[doc = "Node specific wake on LAN settings."]
66    pub wakeonlan: Option<String>,
67    #[serde(
68        flatten,
69        deserialize_with = "crate::types::multi::deserialize_additional_data::<'_, GetOutput, _, _>"
70    )]
71    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
72}
73impl crate::types::multi::Test for GetOutput {
74    fn test_fn() -> fn(&str) -> bool {
75        fn the_test(input: &str) -> bool {
76            let array = [
77                <NumberedAcmedomains as crate::types::multi::NumberedItems>::key_matches
78                    as fn(&str) -> bool,
79            ];
80            array.iter().any(|f| f(input))
81        }
82        the_test as _
83    }
84}
85#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
86pub struct GetParams {
87    #[serde(skip_serializing_if = "Option::is_none", default)]
88    #[doc = "Return only a specific property from the node configuration."]
89    pub property: Option<Property>,
90    #[serde(
91        flatten,
92        default,
93        skip_serializing_if = "::std::collections::HashMap::is_empty"
94    )]
95    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
96}
97#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
98pub struct PutParams {
99    #[serde(skip_serializing_if = "Option::is_none", default)]
100    #[doc = "Node specific ACME settings."]
101    pub acme: Option<String>,
102    #[serde(rename = "acmedomain[n]")]
103    #[serde(
104        serialize_with = "crate::types::serialize_multi::<NumberedAcmedomains, _>",
105        deserialize_with = "crate::types::deserialize_multi::<NumberedAcmedomains, _>"
106    )]
107    #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
108    #[serde(flatten)]
109    #[doc = "ACME domain and validation plugin"]
110    pub acmedomains: ::std::collections::HashMap<u32, String>,
111    #[serde(skip_serializing_if = "Option::is_none", default)]
112    #[doc = "A list of settings you want to delete."]
113    pub delete: Option<String>,
114    #[serde(skip_serializing_if = "Option::is_none", default)]
115    #[doc = "Description for the Node. Shown in the web-interface node notes panel. This is saved as comment inside the configuration file."]
116    pub description: Option<String>,
117    #[serde(skip_serializing_if = "Option::is_none", default)]
118    #[doc = "Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications."]
119    pub digest: Option<String>,
120    #[serde(rename = "startall-onboot-delay")]
121    #[serde(
122        serialize_with = "crate::types::serialize_int_optional",
123        deserialize_with = "crate::types::deserialize_int_optional"
124    )]
125    #[serde(skip_serializing_if = "Option::is_none", default)]
126    #[doc = "Initial delay in seconds, before starting all the Virtual Guests with on-boot enabled."]
127    pub startall_onboot_delay: Option<u64>,
128    #[serde(skip_serializing_if = "Option::is_none", default)]
129    #[doc = "Node specific wake on LAN settings."]
130    pub wakeonlan: Option<String>,
131    #[serde(
132        flatten,
133        deserialize_with = "crate::types::multi::deserialize_additional_data::<'_, PutParams, _, _>"
134    )]
135    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
136}
137impl crate::types::multi::Test for PutParams {
138    fn test_fn() -> fn(&str) -> bool {
139        fn the_test(input: &str) -> bool {
140            let array = [
141                <NumberedAcmedomains as crate::types::multi::NumberedItems>::key_matches
142                    as fn(&str) -> bool,
143            ];
144            array.iter().any(|f| f(input))
145        }
146        the_test as _
147    }
148}
149#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
150pub enum Property {
151    #[serde(rename = "acme")]
152    Acme,
153    #[serde(rename = "acmedomain0")]
154    Acmedomain0,
155    #[serde(rename = "acmedomain1")]
156    Acmedomain1,
157    #[serde(rename = "acmedomain2")]
158    Acmedomain2,
159    #[serde(rename = "acmedomain3")]
160    Acmedomain3,
161    #[serde(rename = "acmedomain4")]
162    Acmedomain4,
163    #[serde(rename = "acmedomain5")]
164    Acmedomain5,
165    #[serde(rename = "description")]
166    Description,
167    #[serde(rename = "startall-onboot-delay")]
168    StartallOnbootDelay,
169    #[serde(rename = "wakeonlan")]
170    Wakeonlan,
171}
172#[derive(Default)]
173struct NumberedAcmedomains;
174impl crate::types::multi::NumberedItems for NumberedAcmedomains {
175    type Item = String;
176    const PREFIX: &'static str = "acmedomain";
177}