podman_client/models/podman/system/
info.rs

1use core::fmt;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Deserialize, Serialize)]
6#[serde(rename_all = "camelCase")]
7pub struct Info {
8    pub host: InfoHost,
9    pub store: InfoStore,
10    pub registries: InfoRegistries,
11    pub plugins: InfoPlugins,
12    pub version: InfoVersion,
13}
14
15impl fmt::Debug for Info {
16    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17        let json = serde_json::to_string_pretty(self).map_err(|_| fmt::Error)?;
18        f.write_str(&json)
19    }
20}
21
22#[derive(Deserialize, Serialize)]
23#[serde(rename_all = "camelCase")]
24pub struct InfoHost {
25    pub arch: String,
26    pub buildah_version: String,
27    pub cgroup_manager: String,
28    pub cgroup_controllers: Vec<String>,
29    pub conmon: InfoHostConmon,
30    pub cpus: u32,
31    pub cpu_utilization: InfoHostCpuUtilization,
32    pub database_backend: String,
33    pub distribution: InfoHostDistribution,
34    pub event_logger: String,
35    pub free_locks: u64,
36    pub hostname: String,
37    pub id_mappings: InfoHostIdMappings,
38    pub kernel: String,
39    pub log_driver: String,
40    pub mem_free: u64,
41    pub mem_total: u64,
42    pub network_backend: String,
43    pub network_backend_info: InfoHostNetworkBackendInfo,
44    pub oci_runtime: InfoHostOciRuntime,
45    pub os: String,
46    pub remote_socket: InfoHostRemoteSocket,
47    pub rootless_network_cmd: String,
48    pub service_is_remote: bool,
49    pub security: InfoHostSecurity,
50    pub slirp4netns: InfoHostSlirp4netns,
51    pub pasta: InfoHostPasta,
52    pub swap_free: u64,
53    pub swap_total: u64,
54    pub uptime: String,
55    pub variant: String,
56    pub linkmode: String,
57}
58
59#[derive(Deserialize, Serialize)]
60#[serde(rename_all = "camelCase")]
61pub struct InfoHostConmon {
62    pub package: String,
63    pub path: String,
64    pub version: String,
65}
66
67#[derive(Deserialize, Serialize)]
68#[serde(rename_all = "camelCase")]
69pub struct InfoHostCpuUtilization {
70    pub user_percent: f32,
71    pub system_percent: f32,
72    pub idle_percent: f32,
73}
74
75#[derive(Deserialize, Serialize)]
76#[serde(rename_all = "camelCase")]
77pub struct InfoHostDistribution {
78    pub distribution: String,
79    pub variant: String,
80    pub version: String,
81}
82
83#[derive(Deserialize, Serialize)]
84#[serde(rename_all = "camelCase")]
85pub struct InfoHostIdMappings {
86    pub gidmap: Vec<InfoHostIdMappingsIdMap>,
87    pub uidmap: Vec<InfoHostIdMappingsIdMap>,
88}
89
90#[derive(Deserialize, Serialize)]
91pub struct InfoHostIdMappingsIdMap {
92    pub container_id: u32,
93    pub host_id: u32,
94    pub size: u32,
95}
96
97#[derive(Deserialize, Serialize)]
98#[serde(rename_all = "camelCase")]
99pub struct InfoHostNetworkBackendInfo {
100    pub backend: String,
101    pub version: String,
102    pub package: String,
103    pub path: String,
104    pub dns: InfoHostNetworkBackendInfoDns,
105}
106
107#[derive(Deserialize, Serialize)]
108#[serde(rename_all = "camelCase")]
109pub struct InfoHostNetworkBackendInfoDns {
110    pub version: String,
111    pub package: String,
112    pub path: String,
113}
114
115#[derive(Deserialize, Serialize)]
116#[serde(rename_all = "camelCase")]
117pub struct InfoHostOciRuntime {
118    pub name: String,
119    pub package: String,
120    pub path: String,
121    pub version: String,
122}
123
124#[derive(Deserialize, Serialize)]
125#[serde(rename_all = "camelCase")]
126pub struct InfoHostRemoteSocket {
127    pub path: String,
128    pub exists: bool,
129}
130
131#[derive(Deserialize, Serialize)]
132#[serde(rename_all = "camelCase")]
133pub struct InfoHostSecurity {
134    pub apparmor_enabled: bool,
135    pub capabilities: String,
136    pub rootless: bool,
137    pub seccomp_enabled: bool,
138    pub seccomp_profile_path: String,
139    pub selinux_enabled: bool,
140}
141
142#[derive(Deserialize, Serialize)]
143#[serde(rename_all = "camelCase")]
144pub struct InfoHostSlirp4netns {
145    pub executable: String,
146    pub package: String,
147    pub version: String,
148}
149
150#[derive(Deserialize, Serialize)]
151#[serde(rename_all = "camelCase")]
152pub struct InfoHostPasta {
153    pub executable: String,
154    pub package: String,
155    pub version: String,
156}
157
158#[derive(Deserialize, Serialize)]
159#[serde(rename_all = "camelCase")]
160pub struct InfoStore {
161    pub config_file: String,
162    pub container_store: InfoStoreContainerStore,
163    pub graph_driver_name: String,
164    pub graph_options: serde_json::Value,
165    pub graph_root: String,
166    pub graph_root_allocated: u64,
167    pub graph_root_used: u64,
168    pub graph_status: InfoStoreGraphStatus,
169    pub image_copy_tmp_dir: String,
170    pub image_store: InfoStoreImageStore,
171    pub run_root: String,
172    pub volume_path: String,
173    pub transient_store: bool,
174}
175
176#[derive(Deserialize, Serialize)]
177#[serde(rename_all = "camelCase")]
178pub struct InfoStoreContainerStore {
179    pub number: u32,
180    pub paused: u32,
181    pub running: u32,
182    pub stopped: u32,
183}
184
185#[derive(Deserialize, Serialize)]
186pub struct InfoStoreGraphStatus {
187    #[serde(rename = "Backing Filesystem")]
188    pub backing_filesystem: String,
189
190    #[serde(rename = "Native Overlay Diff")]
191    pub native_overlay_diff: String,
192
193    #[serde(rename = "Supports d_type")]
194    pub supports_d_type: String,
195
196    #[serde(rename = "Supports shifting")]
197    pub supports_shifting: String,
198
199    #[serde(rename = "Supports volatile")]
200    pub supports_volatile: String,
201
202    #[serde(rename = "Using metacopy")]
203    pub using_metacopy: String,
204}
205
206#[derive(Deserialize, Serialize)]
207#[serde(rename_all = "camelCase")]
208pub struct InfoStoreImageStore {
209    pub number: u32,
210}
211
212#[derive(Deserialize, Serialize)]
213#[serde(rename_all = "camelCase")]
214pub struct InfoRegistries {
215    pub search: Vec<String>,
216}
217
218#[derive(Deserialize, Serialize)]
219#[serde(rename_all = "camelCase")]
220pub struct InfoPlugins {
221    pub volume: Vec<String>,
222    pub network: Vec<String>,
223    pub log: Vec<String>,
224    pub authorization: Option<serde_json::Value>,
225}
226
227#[derive(Deserialize, Serialize)]
228pub struct InfoVersion {
229    #[serde(rename = "APIVersion")]
230    pub api_version: String,
231
232    #[serde(rename = "Version")]
233    pub version: String,
234
235    #[serde(rename = "GoVersion")]
236    pub go_version: String,
237
238    #[serde(rename = "GitCommit")]
239    pub git_commit: String,
240
241    #[serde(rename = "BuiltTime")]
242    pub built_time: String,
243
244    #[serde(rename = "Built")]
245    pub built: u64,
246
247    #[serde(rename = "BuildOrigin")]
248    pub build_origin: String,
249
250    #[serde(rename = "OsArch")]
251    pub os_arch: String,
252
253    #[serde(rename = "Os")]
254    pub os: String,
255}