proxmox_api/generated/cluster/ha/groups/
group.rs1pub struct GroupClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> GroupClient<T>
6where
7 T: crate::client::Client,
8{
9 pub fn new(client: T, parent_path: &str, group: &str) -> Self {
10 Self {
11 client,
12 path: format!("{}/{}", parent_path, group),
13 }
14 }
15}
16impl<T> GroupClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Delete ha group configuration."]
21 pub fn delete(&self) -> Result<(), T::Error> {
22 let path = self.path.to_string();
23 self.client.delete(&path, &())
24 }
25}
26impl<T> GroupClient<T>
27where
28 T: crate::client::Client,
29{
30 #[doc = "Read ha group configuration."]
31 pub fn get(&self) -> Result<(), T::Error> {
32 let path = self.path.to_string();
33 self.client.get(&path, &())
34 }
35}
36impl<T> GroupClient<T>
37where
38 T: crate::client::Client,
39{
40 #[doc = "Update ha group configuration."]
41 pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
42 let path = self.path.to_string();
43 self.client.put(&path, ¶ms)
44 }
45}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
47pub struct PutParams {
48 #[serde(skip_serializing_if = "Option::is_none", default)]
49 #[doc = "Description."]
50 pub comment: Option<String>,
51 #[serde(skip_serializing_if = "Option::is_none", default)]
52 #[doc = "A list of settings you want to delete."]
53 pub delete: Option<String>,
54 #[serde(skip_serializing_if = "Option::is_none", default)]
55 #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
56 pub digest: Option<String>,
57 #[serde(skip_serializing_if = "Option::is_none", default)]
58 #[doc = "List of cluster node names with optional priority."]
59 #[doc = "List of cluster node members, where a priority can be given to each node. A resource bound to a group will run on the available nodes with the highest priority. If there are more nodes in the highest priority class, the services will get distributed to those nodes. The priorities have a relative meaning only."]
60 pub nodes: Option<String>,
61 #[serde(
62 serialize_with = "crate::types::serialize_bool_optional",
63 deserialize_with = "crate::types::deserialize_bool_optional"
64 )]
65 #[serde(skip_serializing_if = "Option::is_none", default)]
66 #[doc = "The CRM tries to run services on the node with the highest priority. If a node with higher priority comes online, the CRM migrates the service to that node. Enabling nofailback prevents that behavior."]
67 pub nofailback: Option<bool>,
68 #[serde(
69 serialize_with = "crate::types::serialize_bool_optional",
70 deserialize_with = "crate::types::deserialize_bool_optional"
71 )]
72 #[serde(skip_serializing_if = "Option::is_none", default)]
73 #[doc = "Resources bound to restricted groups may only run on nodes defined by the group."]
74 #[doc = "Resources bound to restricted groups may only run on nodes defined by the group. The resource will be placed in the stopped state if no group node member is online. Resources on unrestricted groups may run on any cluster node if all group members are offline, but they will migrate back as soon as a group member comes online. One can implement a 'preferred node' behavior using an unrestricted group with only one member."]
75 pub restricted: Option<bool>,
76 #[serde(
77 flatten,
78 default,
79 skip_serializing_if = "::std::collections::HashMap::is_empty"
80 )]
81 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
82}