Skip to main content

monitord/dbus/
zbus_machines.rs

1//! # D-Bus interface proxy for: `org.freedesktop.machine1.Manager`
2//!
3//! This code was generated by `zbus-xmlgen` `4.1.0` from D-Bus introspection data and approprietly adapted.
4//! Source: `Interface '/org/freedesktop/machine1' from service 'org.freedesktop.machine1' on system bus`.
5//!
6//! More information can be found in the [Writing a client proxy] section of the zbus
7//! documentation.
8//!
9//! This type implements the [D-Bus standard interfaces], (`org.freedesktop.DBus.*`) for which the
10//! following zbus API can be used:
11//!
12//! * [`zbus::fdo::PeerProxy`]
13//! * [`zbus::fdo::IntrospectableProxy`]
14//! * [`zbus::fdo::PropertiesProxy`]
15//!
16//! Consequently `zbus-xmlgen` did not generate code for the above interfaces.
17//!
18//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html
19//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces,
20
21#![allow(warnings)]
22use serde_tuple::Deserialize_tuple;
23use zbus::proxy;
24use zbus::zvariant::Type;
25
26use crate::dbus::zbus_machine::MachineProxy;
27
28#[derive(Deserialize_tuple, PartialEq, Eq, Debug, Type)]
29pub struct ListedMachine {
30    pub name: String,
31    pub class: String,
32    pub service: String,
33    pub path: zbus::zvariant::OwnedObjectPath,
34}
35
36#[proxy(
37    interface = "org.freedesktop.machine1.Manager",
38    default_service = "org.freedesktop.machine1",
39    default_path = "/org/freedesktop/machine1"
40)]
41pub trait Manager {
42    /// BindMountMachine method
43    fn bind_mount_machine(
44        &self,
45        name: &str,
46        source: &str,
47        destination: &str,
48        read_only: bool,
49        mkdir: bool,
50    ) -> zbus::Result<()>;
51
52    /// CleanPool method
53    fn clean_pool(&self, mode: &str) -> zbus::Result<Vec<(String, u64)>>;
54
55    /// CloneImage method
56    fn clone_image(&self, name: &str, new_name: &str, read_only: bool) -> zbus::Result<()>;
57
58    /// CopyFromMachine method
59    fn copy_from_machine(&self, name: &str, source: &str, destination: &str) -> zbus::Result<()>;
60
61    /// CopyFromMachineWithFlags method
62    fn copy_from_machine_with_flags(
63        &self,
64        name: &str,
65        source: &str,
66        destination: &str,
67        flags: u64,
68    ) -> zbus::Result<()>;
69
70    /// CopyToMachine method
71    fn copy_to_machine(&self, name: &str, source: &str, destination: &str) -> zbus::Result<()>;
72
73    /// CopyToMachineWithFlags method
74    fn copy_to_machine_with_flags(
75        &self,
76        name: &str,
77        source: &str,
78        destination: &str,
79        flags: u64,
80    ) -> zbus::Result<()>;
81
82    /// CreateMachine method
83    #[allow(clippy::too_many_arguments)]
84    fn create_machine(
85        &self,
86        name: &str,
87        id: &[u8],
88        service: &str,
89        class: &str,
90        leader: u32,
91        root_directory: &str,
92        scope_properties: &[&(&str, &zbus::zvariant::Value<'_>)],
93    ) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
94
95    /// CreateMachineWithNetwork method
96    #[allow(clippy::too_many_arguments)]
97    fn create_machine_with_network(
98        &self,
99        name: &str,
100        id: &[u8],
101        service: &str,
102        class: &str,
103        leader: u32,
104        root_directory: &str,
105        ifindices: &[i32],
106        scope_properties: &[&(&str, &zbus::zvariant::Value<'_>)],
107    ) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
108
109    /// GetImage method
110    fn get_image(&self, name: &str) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
111
112    /// GetImageHostname method
113    fn get_image_hostname(&self, name: &str) -> zbus::Result<String>;
114
115    /// GetImageMachineID method
116    #[zbus(name = "GetImageMachineID")]
117    fn get_image_machine_id(&self, name: &str) -> zbus::Result<Vec<u8>>;
118
119    /// GetImageMachineInfo method
120    fn get_image_machine_info(
121        &self,
122        name: &str,
123    ) -> zbus::Result<std::collections::HashMap<String, String>>;
124
125    /// GetImageOSRelease method
126    #[zbus(name = "GetImageOSRelease")]
127    fn get_image_osrelease(
128        &self,
129        name: &str,
130    ) -> zbus::Result<std::collections::HashMap<String, String>>;
131
132    /// GetMachine method
133    #[zbus(object = "Machine")]
134    fn get_machine(&self, name: &str) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
135
136    /// GetMachineAddresses method
137    fn get_machine_addresses(&self, name: &str) -> zbus::Result<Vec<(i32, Vec<u8>)>>;
138
139    /// GetMachineByPID method
140    #[zbus(name = "GetMachineByPID", object = "Machine")]
141    fn get_machine_by_pid(&self, pid: u32) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
142
143    /// GetMachineOSRelease method
144    #[zbus(name = "GetMachineOSRelease")]
145    fn get_machine_osrelease(
146        &self,
147        name: &str,
148    ) -> zbus::Result<std::collections::HashMap<String, String>>;
149
150    /// GetMachineUIDShift method
151    #[zbus(name = "GetMachineUIDShift")]
152    fn get_machine_uidshift(&self, name: &str) -> zbus::Result<u32>;
153
154    /// KillMachine method
155    fn kill_machine(&self, name: &str, who: &str, signal: i32) -> zbus::Result<()>;
156
157    /// ListImages method
158    fn list_images(
159        &self,
160    ) -> zbus::Result<
161        Vec<(
162            String,
163            String,
164            bool,
165            u64,
166            u64,
167            u64,
168            zbus::zvariant::OwnedObjectPath,
169        )>,
170    >;
171
172    /// ListMachines method
173    fn list_machines(&self) -> zbus::Result<Vec<ListedMachine>>;
174
175    /// MapFromMachineGroup method
176    fn map_from_machine_group(&self, name: &str, gid_inner: u32) -> zbus::Result<u32>;
177
178    /// MapFromMachineUser method
179    fn map_from_machine_user(&self, name: &str, uid_inner: u32) -> zbus::Result<u32>;
180
181    /// MapToMachineGroup method
182    fn map_to_machine_group(
183        &self,
184        gid_outer: u32,
185    ) -> zbus::Result<(String, zbus::zvariant::OwnedObjectPath, u32)>;
186
187    /// MapToMachineUser method
188    fn map_to_machine_user(
189        &self,
190        uid_outer: u32,
191    ) -> zbus::Result<(String, zbus::zvariant::OwnedObjectPath, u32)>;
192
193    /// MarkImageReadOnly method
194    fn mark_image_read_only(&self, name: &str, read_only: bool) -> zbus::Result<()>;
195
196    /// OpenMachineLogin method
197    fn open_machine_login(&self, name: &str) -> zbus::Result<(zbus::zvariant::OwnedFd, String)>;
198
199    /// OpenMachinePTY method
200    #[zbus(name = "OpenMachinePTY")]
201    fn open_machine_pty(&self, name: &str) -> zbus::Result<(zbus::zvariant::OwnedFd, String)>;
202
203    /// OpenMachineRootDirectory method
204    fn open_machine_root_directory(&self, name: &str) -> zbus::Result<zbus::zvariant::OwnedFd>;
205
206    /// OpenMachineShell method
207    #[allow(clippy::too_many_arguments)]
208    fn open_machine_shell(
209        &self,
210        name: &str,
211        user: &str,
212        path: &str,
213        args: &[&str],
214        environment: &[&str],
215    ) -> zbus::Result<(zbus::zvariant::OwnedFd, String)>;
216
217    /// RegisterMachine method
218    #[allow(clippy::too_many_arguments)]
219    fn register_machine(
220        &self,
221        name: &str,
222        id: &[u8],
223        service: &str,
224        class: &str,
225        leader: u32,
226        root_directory: &str,
227    ) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
228
229    /// RegisterMachineWithNetwork method
230    #[allow(clippy::too_many_arguments)]
231    fn register_machine_with_network(
232        &self,
233        name: &str,
234        id: &[u8],
235        service: &str,
236        class: &str,
237        leader: u32,
238        root_directory: &str,
239        ifindices: &[i32],
240    ) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
241
242    /// RemoveImage method
243    fn remove_image(&self, name: &str) -> zbus::Result<()>;
244
245    /// RenameImage method
246    fn rename_image(&self, name: &str, new_name: &str) -> zbus::Result<()>;
247
248    /// SetImageLimit method
249    fn set_image_limit(&self, name: &str, size: u64) -> zbus::Result<()>;
250
251    /// SetPoolLimit method
252    fn set_pool_limit(&self, size: u64) -> zbus::Result<()>;
253
254    /// TerminateMachine method
255    fn terminate_machine(&self, id: &str) -> zbus::Result<()>;
256
257    /// UnregisterMachine method
258    fn unregister_machine(&self, name: &str) -> zbus::Result<()>;
259
260    /// MachineNew signal
261    #[zbus(signal)]
262    fn machine_new(&self, machine: &str, path: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
263
264    /// MachineRemoved signal
265    #[zbus(signal)]
266    fn machine_removed(
267        &self,
268        machine: &str,
269        path: zbus::zvariant::ObjectPath<'_>,
270    ) -> zbus::Result<()>;
271
272    /// PoolLimit property
273    #[zbus(property)]
274    fn pool_limit(&self) -> zbus::Result<u64>;
275
276    /// PoolPath property
277    #[zbus(property)]
278    fn pool_path(&self) -> zbus::Result<String>;
279
280    /// PoolUsage property
281    #[zbus(property)]
282    fn pool_usage(&self) -> zbus::Result<u64>;
283}