Code Monkey home page Code Monkey logo

Comments (6)

vv9k avatar vv9k commented on August 16, 2024

Thanks for the report! Could you provide an example of which fields do not match the API spec?

from docker-api-rs.

avalon1610 avatar avalon1610 commented on August 16, 2024

well, there is lot of fields has changed. new ContainerInfo may be like:

#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ContainerInfo {
    pub id: String,
    #[cfg(feature = "chrono")]
    pub created: DateTime<Utc>,
    #[cfg(not(feature = "chrono"))]
    pub created: u64,
    pub path: String,
    pub args: Vec<String>,
    pub state: ContainerState,
    pub image: String,
    pub resolv_conf_path: String,
    pub hostname_path: String,
    pub hosts_path: String,
    pub log_path: String,
    pub name: String,
    pub restart_count: i64,
    pub driver: String,
    pub platform: String,
    pub mount_label: String,
    pub process_label: String,
    pub app_armor_profile: String,
    #[serde(rename = "ExecIDs")]
    pub exec_ids: Option<Vec<String>>,
    pub host_config: HostConfig,
    pub graph_driver: DriverData,
    pub size_rw: Option<i64>,
    pub size_root_fs: Option<i64>,
    pub mounts: Vec<MountPoint>,
    pub config: ContainerConfig,
    pub network_settings: NetworkSettings,
}

and some associated struct also changed

pub struct HealthcheckResult {
    #[cfg(feature = "chrono")]
    pub start: DateTime<Utc>,
    #[cfg(not(feature = "chrono"))]
    pub start: String, // ...
}

pub struct HostConfig {
    // ...
    pub blkio_weight: u16, // new field
    pub blkio_weight_device: Option<Vec<ThrottleDeviceObject>>,
    // ...
    pub device_cgroup_rules: Option<Vec<String>>,
    // ...
    pub kernel_memory: Option<i16>, // new field
    // ...
}

// new struct
#[dervice(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ThrottleDeviceObject {
    pub path: String,
    pub weight: u64,
}

pub struct NetworkSettings {
    // ...
    #[serde(rename = "GlobalIPv6PrefixLen")]
    pub global_ipv6_prefix_len: u32, 
    // ...
}

from docker-api-rs.

vv9k avatar vv9k commented on August 16, 2024

Thanks for the report!

Oh, I didn't notice that Container::inspect was using the wrong struct. ContainerInfo is supposed to be used with Containers::list and ContainerDetails should be used with Container::inspect.

Should be resolved when #8 gets merged.

from docker-api-rs.

avalon1610 avatar avalon1610 commented on August 16, 2024

Thanks for the working!
Could you publish a new crate so I can get update?

from docker-api-rs.

vv9k avatar vv9k commented on August 16, 2024

Sure thing.

from docker-api-rs.

vv9k avatar vv9k commented on August 16, 2024

Should be up on crates.io .

from docker-api-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.