proxmox_api/generated/cluster/
ha.rs1pub mod groups;
2pub mod resources;
3pub mod rules;
4pub mod status;
5#[derive(Debug, Clone)]
6pub struct HaClient<T> {
7 client: T,
8 path: String,
9}
10impl<T> HaClient<T>
11where
12 T: crate::client::Client,
13{
14 pub fn new(client: T, parent_path: &str) -> Self {
15 Self {
16 client,
17 path: format!("{}{}", parent_path, "/ha"),
18 }
19 }
20}
21impl<T> HaClient<T>
22where
23 T: crate::client::Client,
24{
25 #[doc = "Directory index."]
26 #[doc = ""]
27 #[doc = "Permission check: perm(\"/\", [\"Sys.Audit\"])"]
28 pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
29 let path = self.path.to_string();
30 let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
31 Ok(optional_vec.unwrap_or_default())
32 }
33}
34impl GetOutputItems {
35 pub fn new(id: String) -> Self {
36 Self {
37 id,
38 additional_properties: ::std::default::Default::default(),
39 }
40 }
41}
42#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
43pub struct GetOutputItems {
44 pub id: String,
45 #[serde(
46 flatten,
47 default,
48 skip_serializing_if = "::std::collections::HashMap::is_empty"
49 )]
50 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
51}
52impl<T> HaClient<T>
53where
54 T: crate::client::Client,
55{
56 pub fn resources(&self) -> resources::ResourcesClient<T> {
57 resources::ResourcesClient::<T>::new(self.client.clone(), &self.path)
58 }
59}
60impl<T> HaClient<T>
61where
62 T: crate::client::Client,
63{
64 pub fn groups(&self) -> groups::GroupsClient<T> {
65 groups::GroupsClient::<T>::new(self.client.clone(), &self.path)
66 }
67}
68impl<T> HaClient<T>
69where
70 T: crate::client::Client,
71{
72 pub fn rules(&self) -> rules::RulesClient<T> {
73 rules::RulesClient::<T>::new(self.client.clone(), &self.path)
74 }
75}
76impl<T> HaClient<T>
77where
78 T: crate::client::Client,
79{
80 pub fn status(&self) -> status::StatusClient<T> {
81 status::StatusClient::<T>::new(self.client.clone(), &self.path)
82 }
83}