proxmox_api/generated/cluster/
options.rs

1pub struct OptionsClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> OptionsClient<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, "/options"),
13        }
14    }
15}
16impl<T> OptionsClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Get datacenter options. Without 'Sys.Audit' on '/' not all options are returned."]
21    pub fn get(&self) -> Result<GetOutput, T::Error> {
22        let path = self.path.to_string();
23        self.client.get(&path, &())
24    }
25}
26impl<T> OptionsClient<T>
27where
28    T: crate::client::Client,
29{
30    #[doc = "Set datacenter 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(
39        flatten,
40        default,
41        skip_serializing_if = "::std::collections::HashMap::is_empty"
42    )]
43    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
44}
45#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
46pub struct PutParams {
47    #[serde(skip_serializing_if = "Option::is_none", default)]
48    #[doc = "Set I/O bandwidth limit for various operations (in KiB/s)."]
49    pub bwlimit: Option<String>,
50    #[serde(skip_serializing_if = "Option::is_none", default)]
51    #[doc = "Select the default Console viewer. You can either use the builtin java applet (VNC; deprecated and maps to html5), an external virt-viewer comtatible application (SPICE), an HTML5 based vnc viewer (noVNC), or an HTML5 based console client (xtermjs). If the selected viewer is not available (e.g. SPICE not activated for the VM), the fallback is noVNC."]
52    pub console: Option<Console>,
53    #[serde(skip_serializing_if = "Option::is_none", default)]
54    #[doc = "Cluster resource scheduling settings."]
55    pub crs: Option<String>,
56    #[serde(skip_serializing_if = "Option::is_none", default)]
57    #[doc = "A list of settings you want to delete."]
58    pub delete: Option<String>,
59    #[serde(skip_serializing_if = "Option::is_none", default)]
60    #[doc = "Datacenter description. Shown in the web-interface datacenter notes panel. This is saved as comment inside the configuration file."]
61    pub description: Option<String>,
62    #[serde(skip_serializing_if = "Option::is_none", default)]
63    #[doc = "Specify email address to send notification from (default is root@$hostname)"]
64    pub email_from: Option<String>,
65    #[serde(skip_serializing_if = "Option::is_none", default)]
66    #[doc = "Set the fencing mode of the HA cluster. Hardware mode needs a valid configuration of fence devices in /etc/pve/ha/fence.cfg. With both all two modes are used.\n\nWARNING: 'hardware' and 'both' are EXPERIMENTAL & WIP"]
67    pub fencing: Option<Fencing>,
68    #[serde(skip_serializing_if = "Option::is_none", default)]
69    #[doc = "Cluster wide HA settings."]
70    pub ha: Option<String>,
71    #[serde(skip_serializing_if = "Option::is_none", default)]
72    #[doc = "Specify external http proxy which is used for downloads (example: 'http://username:password@host:port/')"]
73    pub http_proxy: Option<String>,
74    #[serde(skip_serializing_if = "Option::is_none", default)]
75    #[doc = "Default keybord layout for vnc server."]
76    pub keyboard: Option<Keyboard>,
77    #[serde(skip_serializing_if = "Option::is_none", default)]
78    #[doc = "Default GUI language."]
79    pub language: Option<Language>,
80    #[serde(skip_serializing_if = "Option::is_none", default)]
81    #[doc = "Prefix for the auto-generated MAC addresses of virtual guests. The default 'BC:24:11' is the OUI assigned by the IEEE to Proxmox Server Solutions GmbH for a 24-bit large MAC block. You're allowed to use this in local networks, i.e., those not directly reachable by the public (e.g., in a LAN or behind NAT)."]
82    #[doc = "Prefix for the auto-generated MAC addresses of virtual guests. The default `BC:24:11` is the Organizationally Unique Identifier (OUI) assigned by the IEEE to Proxmox Server Solutions GmbH for a MAC Address Block Large (MA-L). You're allowed to use this in local networks, i.e., those not directly reachable by the public (e.g., in a LAN or NAT/Masquerading).\n \nNote that when you run multiple cluster that (partially) share the networks of their virtual guests, it's highly recommended that you extend the default MAC prefix, or generate a custom (valid) one, to reduce the chance of MAC collisions. For example, add a separate extra hexadecimal to the Proxmox OUI for each cluster, like `BC:24:11:0` for the first, `BC:24:11:1` for the second, and so on.\n Alternatively, you can also separate the networks of the guests logically, e.g., by using VLANs.\n\nFor publicly accessible guests it's recommended that you get your own https://standards.ieee.org/products-programs/regauth/[OUI from the IEEE] registered or coordinate with your, or your hosting providers, network admins."]
83    pub mac_prefix: Option<String>,
84    #[serde(
85        serialize_with = "crate::types::serialize_int_optional",
86        deserialize_with = "crate::types::deserialize_int_optional"
87    )]
88    #[serde(skip_serializing_if = "Option::is_none", default)]
89    #[doc = "Defines how many workers (per node) are maximal started  on actions like 'stopall VMs' or task from the ha-manager."]
90    pub max_workers: Option<u64>,
91    #[serde(skip_serializing_if = "Option::is_none", default)]
92    #[doc = "For cluster wide migration settings."]
93    pub migration: Option<String>,
94    #[serde(
95        serialize_with = "crate::types::serialize_bool_optional",
96        deserialize_with = "crate::types::deserialize_bool_optional"
97    )]
98    #[serde(skip_serializing_if = "Option::is_none", default)]
99    #[doc = "Migration is secure using SSH tunnel by default. For secure private networks you can disable it to speed up migration. Deprecated, use the 'migration' property instead!"]
100    pub migration_unsecure: Option<bool>,
101    #[serde(rename = "next-id")]
102    #[serde(skip_serializing_if = "Option::is_none", default)]
103    #[doc = "Control the range for the free VMID auto-selection pool."]
104    pub next_id: Option<String>,
105    #[serde(skip_serializing_if = "Option::is_none", default)]
106    #[doc = "Cluster-wide notification settings."]
107    pub notify: Option<String>,
108    #[serde(rename = "registered-tags")]
109    #[serde(skip_serializing_if = "Option::is_none", default)]
110    #[doc = "A list of tags that require a `Sys.Modify` on '/' to set and delete. Tags set here that are also in 'user-tag-access' also require `Sys.Modify`."]
111    pub registered_tags: Option<String>,
112    #[serde(rename = "tag-style")]
113    #[serde(skip_serializing_if = "Option::is_none", default)]
114    #[doc = "Tag style options."]
115    pub tag_style: Option<String>,
116    #[serde(skip_serializing_if = "Option::is_none", default)]
117    #[doc = "u2f"]
118    pub u2f: Option<String>,
119    #[serde(rename = "user-tag-access")]
120    #[serde(skip_serializing_if = "Option::is_none", default)]
121    #[doc = "Privilege options for user-settable tags"]
122    pub user_tag_access: Option<String>,
123    #[serde(skip_serializing_if = "Option::is_none", default)]
124    #[doc = "webauthn configuration"]
125    pub webauthn: Option<String>,
126    #[serde(
127        flatten,
128        default,
129        skip_serializing_if = "::std::collections::HashMap::is_empty"
130    )]
131    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
132}
133#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
134pub enum Console {
135    #[serde(rename = "applet")]
136    Applet,
137    #[serde(rename = "html5")]
138    Html5,
139    #[serde(rename = "vv")]
140    Vv,
141    #[serde(rename = "xtermjs")]
142    Xtermjs,
143}
144#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
145pub enum Fencing {
146    #[serde(rename = "both")]
147    Both,
148    #[serde(rename = "hardware")]
149    Hardware,
150    #[serde(rename = "watchdog")]
151    Watchdog,
152}
153impl Default for Fencing {
154    fn default() -> Self {
155        Self::Watchdog
156    }
157}
158#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
159pub enum Keyboard {
160    #[serde(rename = "da")]
161    Da,
162    #[serde(rename = "de")]
163    De,
164    #[serde(rename = "de-ch")]
165    DeCh,
166    #[serde(rename = "en-gb")]
167    EnGb,
168    #[serde(rename = "en-us")]
169    EnUs,
170    #[serde(rename = "es")]
171    Es,
172    #[serde(rename = "fi")]
173    Fi,
174    #[serde(rename = "fr")]
175    Fr,
176    #[serde(rename = "fr-be")]
177    FrBe,
178    #[serde(rename = "fr-ca")]
179    FrCa,
180    #[serde(rename = "fr-ch")]
181    FrCh,
182    #[serde(rename = "hu")]
183    Hu,
184    #[serde(rename = "is")]
185    Is,
186    #[serde(rename = "it")]
187    It,
188    #[serde(rename = "ja")]
189    Ja,
190    #[serde(rename = "lt")]
191    Lt,
192    #[serde(rename = "mk")]
193    Mk,
194    #[serde(rename = "nl")]
195    Nl,
196    #[serde(rename = "no")]
197    No,
198    #[serde(rename = "pl")]
199    Pl,
200    #[serde(rename = "pt")]
201    Pt,
202    #[serde(rename = "pt-br")]
203    PtBr,
204    #[serde(rename = "sl")]
205    Sl,
206    #[serde(rename = "sv")]
207    Sv,
208    #[serde(rename = "tr")]
209    Tr,
210}
211#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
212pub enum Language {
213    #[serde(rename = "ar")]
214    Ar,
215    #[serde(rename = "ca")]
216    Ca,
217    #[serde(rename = "da")]
218    Da,
219    #[serde(rename = "de")]
220    De,
221    #[serde(rename = "en")]
222    En,
223    #[serde(rename = "es")]
224    Es,
225    #[serde(rename = "eu")]
226    Eu,
227    #[serde(rename = "fa")]
228    Fa,
229    #[serde(rename = "fr")]
230    Fr,
231    #[serde(rename = "he")]
232    He,
233    #[serde(rename = "hr")]
234    Hr,
235    #[serde(rename = "it")]
236    It,
237    #[serde(rename = "ja")]
238    Ja,
239    #[serde(rename = "ka")]
240    Ka,
241    #[serde(rename = "kr")]
242    Kr,
243    #[serde(rename = "nb")]
244    Nb,
245    #[serde(rename = "nl")]
246    Nl,
247    #[serde(rename = "nn")]
248    Nn,
249    #[serde(rename = "pl")]
250    Pl,
251    #[serde(rename = "pt_BR")]
252    PtBR,
253    #[serde(rename = "ru")]
254    Ru,
255    #[serde(rename = "sl")]
256    Sl,
257    #[serde(rename = "sv")]
258    Sv,
259    #[serde(rename = "tr")]
260    Tr,
261    #[serde(rename = "ukr")]
262    Ukr,
263    #[serde(rename = "zh_CN")]
264    ZhCN,
265    #[serde(rename = "zh_TW")]
266    ZhTW,
267}