podman_client/models/podman/system/
info.rs1use core::fmt;
2use std::collections::HashMap;
3
4use serde::{Deserialize, Serialize};
5
6use crate::models::podman::common::id_map::IdMap;
7
8#[derive(Deserialize, Serialize)]
9#[serde(rename_all = "camelCase")]
10pub struct SystemInfo {
11 pub host: SystemInfoHost,
12 pub store: SystemInfoStore,
13 pub registries: HashMap<String, serde_json::Value>,
14 pub plugins: SystemInfoPlugins,
15 pub version: SystemInfoVersion,
16}
17
18impl fmt::Debug for SystemInfo {
19 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
20 let json = serde_json::to_string_pretty(self).map_err(|_| fmt::Error)?;
21 f.write_str(&json)
22 }
23}
24
25#[derive(Deserialize, Serialize)]
26#[serde(rename_all = "camelCase")]
27pub struct SystemInfoHost {
28 pub arch: String,
29 pub buildah_version: String,
30 pub cgroup_manager: String,
31 pub cgroup_controllers: Vec<String>,
32 pub conmon: SystemInfoHostConmon,
33 pub cpus: u32,
34 pub cpu_utilization: SystemInfoHostCpuUtilization,
35 pub database_backend: String,
36 pub distribution: SystemInfoHostDistribution,
37 pub event_logger: String,
38 pub free_locks: u64,
39 pub hostname: String,
40 pub id_mappings: SystemInfoHostIdMappings,
41 pub kernel: String,
42 pub log_driver: String,
43 pub mem_free: u64,
44 pub mem_total: u64,
45 pub network_backend: String,
46 pub network_backend_info: SystemInfoHostNetworkBackendSystemInfo,
47 pub oci_runtime: SystemInfoHostOciRuntime,
48 pub os: String,
49 pub remote_socket: SystemInfoHostRemoteSocket,
50 pub rootless_network_cmd: String,
51 pub service_is_remote: bool,
52 pub security: SystemInfoHostSecurity,
53 pub slirp4netns: SystemInfoHostSlirp4netns,
54 pub pasta: SystemInfoHostPasta,
55 pub swap_free: u64,
56 pub swap_total: u64,
57 pub uptime: String,
58 pub variant: String,
59 pub linkmode: String,
60 pub emulated_architectures: Option<Vec<String>>,
61 pub runtime_info: Option<HashMap<String, serde_json::Value>>,
62}
63
64#[derive(Deserialize, Serialize)]
65#[serde(rename_all = "camelCase")]
66pub struct SystemInfoHostConmon {
67 pub package: String,
68 pub path: String,
69 pub version: String,
70}
71
72#[derive(Deserialize, Serialize)]
73#[serde(rename_all = "camelCase")]
74pub struct SystemInfoHostCpuUtilization {
75 pub user_percent: f32,
76 pub system_percent: f32,
77 pub idle_percent: f32,
78}
79
80#[derive(Deserialize, Serialize)]
81#[serde(rename_all = "camelCase")]
82pub struct SystemInfoHostDistribution {
83 pub distribution: String,
84 pub variant: String,
85 pub version: String,
86 pub codename: Option<String>,
87}
88
89#[derive(Deserialize, Serialize)]
90#[serde(rename_all = "camelCase")]
91pub struct SystemInfoHostIdMappings {
92 pub gidmap: Vec<IdMap>,
93 pub uidmap: Vec<IdMap>,
94}
95
96#[derive(Deserialize, Serialize)]
97#[serde(rename_all = "camelCase")]
98pub struct SystemInfoHostNetworkBackendSystemInfo {
99 pub backend: String,
100 pub version: String,
101 pub package: String,
102 pub path: String,
103 pub dns: SystemInfoHostNetworkBackendSystemInfoDns,
104}
105
106#[derive(Deserialize, Serialize)]
107#[serde(rename_all = "camelCase")]
108pub struct SystemInfoHostNetworkBackendSystemInfoDns {
109 pub version: String,
110 pub package: String,
111 pub path: String,
112}
113
114#[derive(Deserialize, Serialize)]
115#[serde(rename_all = "camelCase")]
116pub struct SystemInfoHostOciRuntime {
117 pub name: String,
118 pub package: String,
119 pub path: String,
120 pub version: String,
121}
122
123#[derive(Deserialize, Serialize)]
124#[serde(rename_all = "camelCase")]
125pub struct SystemInfoHostRemoteSocket {
126 pub path: String,
127 pub exists: bool,
128}
129
130#[derive(Deserialize, Serialize)]
131#[serde(rename_all = "camelCase")]
132pub struct SystemInfoHostSecurity {
133 pub apparmor_enabled: bool,
134 pub capabilities: String,
135 pub rootless: bool,
136 pub seccomp_enabled: bool,
137 pub seccomp_profile_path: String,
138 pub selinux_enabled: bool,
139}
140
141#[derive(Deserialize, Serialize)]
142#[serde(rename_all = "camelCase")]
143pub struct SystemInfoHostSlirp4netns {
144 pub executable: String,
145 pub package: String,
146 pub version: String,
147}
148
149#[derive(Deserialize, Serialize)]
150#[serde(rename_all = "camelCase")]
151pub struct SystemInfoHostPasta {
152 pub executable: String,
153 pub package: String,
154 pub version: String,
155}
156
157#[derive(Deserialize, Serialize)]
158#[serde(rename_all = "camelCase")]
159pub struct SystemInfoStore {
160 pub config_file: String,
161 pub container_store: SystemInfoStoreContainerStore,
162 pub graph_driver_name: String,
163 pub graph_options: HashMap<String, serde_json::Value>,
164 pub graph_root: String,
165 pub graph_root_allocated: u64,
166 pub graph_root_used: u64,
167 pub graph_status: HashMap<String, String>,
168 pub image_copy_tmp_dir: String,
169 pub image_store: SystemInfoStoreImageStore,
170 pub run_root: String,
171 pub volume_path: String,
172 pub transient_store: bool,
173}
174
175#[derive(Deserialize, Serialize)]
176#[serde(rename_all = "camelCase")]
177pub struct SystemInfoStoreContainerStore {
178 pub number: u32,
179 pub paused: u32,
180 pub running: u32,
181 pub stopped: u32,
182}
183
184#[derive(Deserialize, Serialize)]
185#[serde(rename_all = "camelCase")]
186pub struct SystemInfoStoreImageStore {
187 pub number: u32,
188}
189
190#[derive(Deserialize, Serialize)]
191#[serde(rename_all = "camelCase")]
192pub struct SystemInfoPlugins {
193 pub volume: Vec<String>,
194 pub network: Vec<String>,
195 pub log: Vec<String>,
196 pub authorization: Option<Vec<String>>,
197}
198
199#[derive(Deserialize, Serialize)]
200pub struct SystemInfoVersion {
201 #[serde(rename = "APIVersion")]
202 pub api_version: String,
203
204 #[serde(rename = "Version")]
205 pub version: String,
206
207 #[serde(rename = "GoVersion")]
208 pub go_version: String,
209
210 #[serde(rename = "GitCommit")]
211 pub git_commit: String,
212
213 #[serde(rename = "BuiltTime")]
214 pub built_time: String,
215
216 #[serde(rename = "Built")]
217 pub built: u64,
218
219 #[serde(rename = "BuildOrigin")]
220 pub build_origin: String,
221
222 #[serde(rename = "OsArch")]
223 pub os_arch: String,
224
225 #[serde(rename = "Os")]
226 pub os: String,
227}