podman_client/models/podman/images/
inspect.rs

1use core::fmt;
2use std::collections::HashMap;
3
4use chrono::{DateTime, Utc};
5use serde::{Deserialize, Serialize};
6
7use crate::models::podman::common::schema2_health_config::Schema2HealthConfig;
8
9pub struct ImageInspectOptions<'a> {
10    pub name: &'a str,
11}
12
13#[derive(Deserialize, Serialize)]
14#[serde(rename_all = "PascalCase")]
15pub struct ImageInspect {
16    pub annotations: HashMap<String, String>,
17    pub architecture: String,
18    pub author: String,
19    pub comment: String,
20    pub config: ImageInspectConfig,
21    pub created: DateTime<Utc>,
22    pub digest: String,
23    pub graph_driver: ImageInspectGraphDriver,
24    pub healthcheck: Schema2HealthConfig,
25    pub history: Vec<ImageInspectHistory>,
26    pub id: String,
27    pub labels: HashMap<String, String>,
28    pub manifest_type: String,
29    pub names_history: Vec<String>,
30    pub os: String,
31    pub parent: String,
32    pub repo_digests: Vec<String>,
33    pub repo_tags: Vec<String>,
34    pub root_fs: ImageInspectRootFs,
35    pub size: i64,
36    pub user: String,
37    pub version: String,
38    pub virtual_size: i64,
39}
40
41impl fmt::Debug for ImageInspect {
42    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
43        let json = serde_json::to_string_pretty(self).map_err(|_| fmt::Error)?;
44        f.write_str(&json)
45    }
46}
47
48#[derive(Deserialize, Serialize)]
49#[serde(rename_all = "PascalCase")]
50pub struct ImageInspectConfig {
51    pub args_escaped: bool,
52    pub cmd: Vec<String>,
53    pub entrypoint: Vec<String>,
54    pub env: Vec<String>,
55    pub exposed_ports: HashMap<String, serde_json::Value>,
56    pub labels: HashMap<String, String>,
57    pub stop_signal: String,
58    pub user: String,
59    pub volumes: HashMap<String, serde_json::Value>,
60    pub working_dir: String,
61}
62
63#[derive(Deserialize, Serialize)]
64#[serde(rename_all = "PascalCase")]
65pub struct ImageInspectGraphDriver {
66    pub data: HashMap<String, String>,
67    pub name: String,
68}
69
70#[derive(Deserialize, Serialize)]
71#[serde(rename_all = "snake_case")]
72pub struct ImageInspectHistory {
73    pub author: String,
74    pub comment: String,
75    pub created: DateTime<Utc>,
76    pub created_by: String,
77    pub empty_layer: bool,
78}
79
80#[derive(Deserialize, Serialize)]
81#[serde(rename_all = "PascalCase")]
82pub struct ImageInspectRootFs {
83    pub layers: Vec<String>,
84    pub r#type: String,
85}