proxmox_api/generated/nodes/node/services/
service.rs

1pub mod reload;
2pub mod restart;
3pub mod start;
4pub mod state;
5pub mod stop;
6pub struct ServiceClient<T> {
7    client: T,
8    path: String,
9}
10impl<T> ServiceClient<T>
11where
12    T: crate::client::Client,
13{
14    pub fn new(client: T, parent_path: &str, service: &str) -> Self {
15        Self {
16            client,
17            path: format!("{}/{}", parent_path, service),
18        }
19    }
20}
21impl<T> ServiceClient<T>
22where
23    T: crate::client::Client,
24{
25    #[doc = "Directory index"]
26    pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
27        let path = self.path.to_string();
28        self.client.get(&path, &())
29    }
30}
31impl GetOutputItems {
32    pub fn new(subdir: String) -> Self {
33        Self {
34            subdir,
35            additional_properties: Default::default(),
36        }
37    }
38}
39#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
40pub struct GetOutputItems {
41    pub subdir: String,
42    #[serde(
43        flatten,
44        default,
45        skip_serializing_if = "::std::collections::HashMap::is_empty"
46    )]
47    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
48}
49impl<T> ServiceClient<T>
50where
51    T: crate::client::Client,
52{
53    pub fn state(&self) -> state::StateClient<T> {
54        state::StateClient::<T>::new(self.client.clone(), &self.path)
55    }
56}
57impl<T> ServiceClient<T>
58where
59    T: crate::client::Client,
60{
61    pub fn start(&self) -> start::StartClient<T> {
62        start::StartClient::<T>::new(self.client.clone(), &self.path)
63    }
64}
65impl<T> ServiceClient<T>
66where
67    T: crate::client::Client,
68{
69    pub fn stop(&self) -> stop::StopClient<T> {
70        stop::StopClient::<T>::new(self.client.clone(), &self.path)
71    }
72}
73impl<T> ServiceClient<T>
74where
75    T: crate::client::Client,
76{
77    pub fn restart(&self) -> restart::RestartClient<T> {
78        restart::RestartClient::<T>::new(self.client.clone(), &self.path)
79    }
80}
81impl<T> ServiceClient<T>
82where
83    T: crate::client::Client,
84{
85    pub fn reload(&self) -> reload::ReloadClient<T> {
86        reload::ReloadClient::<T>::new(self.client.clone(), &self.path)
87    }
88}