proxmox_api/generated/nodes/node/qemu/vmid/
agent.rs

1pub mod exec;
2pub mod exec_status;
3pub mod file_read;
4pub mod file_write;
5pub mod fsfreeze_freeze;
6pub mod fsfreeze_status;
7pub mod fsfreeze_thaw;
8pub mod fstrim;
9pub mod get_fsinfo;
10pub mod get_host_name;
11pub mod get_memory_block_info;
12pub mod get_memory_blocks;
13pub mod get_osinfo;
14pub mod get_time;
15pub mod get_timezone;
16pub mod get_users;
17pub mod get_vcpus;
18pub mod info;
19pub mod network_get_interfaces;
20pub mod ping;
21pub mod set_user_password;
22pub mod shutdown;
23pub mod suspend_disk;
24pub mod suspend_hybrid;
25pub mod suspend_ram;
26pub struct AgentClient<T> {
27    client: T,
28    path: String,
29}
30impl<T> AgentClient<T>
31where
32    T: crate::client::Client,
33{
34    pub fn new(client: T, parent_path: &str) -> Self {
35        Self {
36            client,
37            path: format!("{}{}", parent_path, "/agent"),
38        }
39    }
40}
41impl<T> AgentClient<T>
42where
43    T: crate::client::Client,
44{
45    #[doc = "QEMU Guest Agent command index."]
46    pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
47        let path = self.path.to_string();
48        self.client.get(&path, &())
49    }
50}
51impl<T> AgentClient<T>
52where
53    T: crate::client::Client,
54{
55    #[doc = "Execute QEMU Guest Agent commands."]
56    pub fn post(&self, params: PostParams) -> Result<PostOutput, T::Error> {
57        let path = self.path.to_string();
58        self.client.post(&path, &params)
59    }
60}
61#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
62pub struct GetOutputItems {
63    #[serde(
64        flatten,
65        default,
66        skip_serializing_if = "::std::collections::HashMap::is_empty"
67    )]
68    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
69}
70#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
71pub struct PostOutput {
72    #[serde(
73        flatten,
74        default,
75        skip_serializing_if = "::std::collections::HashMap::is_empty"
76    )]
77    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
78}
79impl PostParams {
80    pub fn new(command: Command) -> Self {
81        Self {
82            command,
83            additional_properties: Default::default(),
84        }
85    }
86}
87#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
88pub struct PostParams {
89    #[doc = "The QGA command."]
90    pub command: Command,
91    #[serde(
92        flatten,
93        default,
94        skip_serializing_if = "::std::collections::HashMap::is_empty"
95    )]
96    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
97}
98#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
99pub enum Command {
100    #[serde(rename = "fsfreeze-freeze")]
101    FsfreezeFreeze,
102    #[serde(rename = "fsfreeze-status")]
103    FsfreezeStatus,
104    #[serde(rename = "fsfreeze-thaw")]
105    FsfreezeThaw,
106    #[serde(rename = "fstrim")]
107    Fstrim,
108    #[serde(rename = "get-fsinfo")]
109    GetFsinfo,
110    #[serde(rename = "get-host-name")]
111    GetHostName,
112    #[serde(rename = "get-memory-block-info")]
113    GetMemoryBlockInfo,
114    #[serde(rename = "get-memory-blocks")]
115    GetMemoryBlocks,
116    #[serde(rename = "get-osinfo")]
117    GetOsinfo,
118    #[serde(rename = "get-time")]
119    GetTime,
120    #[serde(rename = "get-timezone")]
121    GetTimezone,
122    #[serde(rename = "get-users")]
123    GetUsers,
124    #[serde(rename = "get-vcpus")]
125    GetVcpus,
126    #[serde(rename = "info")]
127    Info,
128    #[serde(rename = "network-get-interfaces")]
129    NetworkGetInterfaces,
130    #[serde(rename = "ping")]
131    Ping,
132    #[serde(rename = "shutdown")]
133    Shutdown,
134    #[serde(rename = "suspend-disk")]
135    SuspendDisk,
136    #[serde(rename = "suspend-hybrid")]
137    SuspendHybrid,
138    #[serde(rename = "suspend-ram")]
139    SuspendRam,
140}
141impl<T> AgentClient<T>
142where
143    T: crate::client::Client,
144{
145    pub fn fsfreeze_freeze(&self) -> fsfreeze_freeze::FsfreezeFreezeClient<T> {
146        fsfreeze_freeze::FsfreezeFreezeClient::<T>::new(self.client.clone(), &self.path)
147    }
148}
149impl<T> AgentClient<T>
150where
151    T: crate::client::Client,
152{
153    pub fn fsfreeze_status(&self) -> fsfreeze_status::FsfreezeStatusClient<T> {
154        fsfreeze_status::FsfreezeStatusClient::<T>::new(self.client.clone(), &self.path)
155    }
156}
157impl<T> AgentClient<T>
158where
159    T: crate::client::Client,
160{
161    pub fn fsfreeze_thaw(&self) -> fsfreeze_thaw::FsfreezeThawClient<T> {
162        fsfreeze_thaw::FsfreezeThawClient::<T>::new(self.client.clone(), &self.path)
163    }
164}
165impl<T> AgentClient<T>
166where
167    T: crate::client::Client,
168{
169    pub fn fstrim(&self) -> fstrim::FstrimClient<T> {
170        fstrim::FstrimClient::<T>::new(self.client.clone(), &self.path)
171    }
172}
173impl<T> AgentClient<T>
174where
175    T: crate::client::Client,
176{
177    pub fn get_fsinfo(&self) -> get_fsinfo::GetFsinfoClient<T> {
178        get_fsinfo::GetFsinfoClient::<T>::new(self.client.clone(), &self.path)
179    }
180}
181impl<T> AgentClient<T>
182where
183    T: crate::client::Client,
184{
185    pub fn get_host_name(&self) -> get_host_name::GetHostNameClient<T> {
186        get_host_name::GetHostNameClient::<T>::new(self.client.clone(), &self.path)
187    }
188}
189impl<T> AgentClient<T>
190where
191    T: crate::client::Client,
192{
193    pub fn get_memory_block_info(&self) -> get_memory_block_info::GetMemoryBlockInfoClient<T> {
194        get_memory_block_info::GetMemoryBlockInfoClient::<T>::new(self.client.clone(), &self.path)
195    }
196}
197impl<T> AgentClient<T>
198where
199    T: crate::client::Client,
200{
201    pub fn get_memory_blocks(&self) -> get_memory_blocks::GetMemoryBlocksClient<T> {
202        get_memory_blocks::GetMemoryBlocksClient::<T>::new(self.client.clone(), &self.path)
203    }
204}
205impl<T> AgentClient<T>
206where
207    T: crate::client::Client,
208{
209    pub fn get_osinfo(&self) -> get_osinfo::GetOsinfoClient<T> {
210        get_osinfo::GetOsinfoClient::<T>::new(self.client.clone(), &self.path)
211    }
212}
213impl<T> AgentClient<T>
214where
215    T: crate::client::Client,
216{
217    pub fn get_time(&self) -> get_time::GetTimeClient<T> {
218        get_time::GetTimeClient::<T>::new(self.client.clone(), &self.path)
219    }
220}
221impl<T> AgentClient<T>
222where
223    T: crate::client::Client,
224{
225    pub fn get_timezone(&self) -> get_timezone::GetTimezoneClient<T> {
226        get_timezone::GetTimezoneClient::<T>::new(self.client.clone(), &self.path)
227    }
228}
229impl<T> AgentClient<T>
230where
231    T: crate::client::Client,
232{
233    pub fn get_users(&self) -> get_users::GetUsersClient<T> {
234        get_users::GetUsersClient::<T>::new(self.client.clone(), &self.path)
235    }
236}
237impl<T> AgentClient<T>
238where
239    T: crate::client::Client,
240{
241    pub fn get_vcpus(&self) -> get_vcpus::GetVcpusClient<T> {
242        get_vcpus::GetVcpusClient::<T>::new(self.client.clone(), &self.path)
243    }
244}
245impl<T> AgentClient<T>
246where
247    T: crate::client::Client,
248{
249    pub fn info(&self) -> info::InfoClient<T> {
250        info::InfoClient::<T>::new(self.client.clone(), &self.path)
251    }
252}
253impl<T> AgentClient<T>
254where
255    T: crate::client::Client,
256{
257    pub fn network_get_interfaces(&self) -> network_get_interfaces::NetworkGetInterfacesClient<T> {
258        network_get_interfaces::NetworkGetInterfacesClient::<T>::new(
259            self.client.clone(),
260            &self.path,
261        )
262    }
263}
264impl<T> AgentClient<T>
265where
266    T: crate::client::Client,
267{
268    pub fn ping(&self) -> ping::PingClient<T> {
269        ping::PingClient::<T>::new(self.client.clone(), &self.path)
270    }
271}
272impl<T> AgentClient<T>
273where
274    T: crate::client::Client,
275{
276    pub fn shutdown(&self) -> shutdown::ShutdownClient<T> {
277        shutdown::ShutdownClient::<T>::new(self.client.clone(), &self.path)
278    }
279}
280impl<T> AgentClient<T>
281where
282    T: crate::client::Client,
283{
284    pub fn suspend_disk(&self) -> suspend_disk::SuspendDiskClient<T> {
285        suspend_disk::SuspendDiskClient::<T>::new(self.client.clone(), &self.path)
286    }
287}
288impl<T> AgentClient<T>
289where
290    T: crate::client::Client,
291{
292    pub fn suspend_hybrid(&self) -> suspend_hybrid::SuspendHybridClient<T> {
293        suspend_hybrid::SuspendHybridClient::<T>::new(self.client.clone(), &self.path)
294    }
295}
296impl<T> AgentClient<T>
297where
298    T: crate::client::Client,
299{
300    pub fn suspend_ram(&self) -> suspend_ram::SuspendRamClient<T> {
301        suspend_ram::SuspendRamClient::<T>::new(self.client.clone(), &self.path)
302    }
303}
304impl<T> AgentClient<T>
305where
306    T: crate::client::Client,
307{
308    pub fn set_user_password(&self) -> set_user_password::SetUserPasswordClient<T> {
309        set_user_password::SetUserPasswordClient::<T>::new(self.client.clone(), &self.path)
310    }
311}
312impl<T> AgentClient<T>
313where
314    T: crate::client::Client,
315{
316    pub fn exec(&self) -> exec::ExecClient<T> {
317        exec::ExecClient::<T>::new(self.client.clone(), &self.path)
318    }
319}
320impl<T> AgentClient<T>
321where
322    T: crate::client::Client,
323{
324    pub fn exec_status(&self) -> exec_status::ExecStatusClient<T> {
325        exec_status::ExecStatusClient::<T>::new(self.client.clone(), &self.path)
326    }
327}
328impl<T> AgentClient<T>
329where
330    T: crate::client::Client,
331{
332    pub fn file_read(&self) -> file_read::FileReadClient<T> {
333        file_read::FileReadClient::<T>::new(self.client.clone(), &self.path)
334    }
335}
336impl<T> AgentClient<T>
337where
338    T: crate::client::Client,
339{
340    pub fn file_write(&self) -> file_write::FileWriteClient<T> {
341        file_write::FileWriteClient::<T>::new(self.client.clone(), &self.path)
342    }
343}