diff --git a/src/main/java/com/spotify/docker/client/messages/ImageInfo.java b/src/main/java/com/spotify/docker/client/messages/ImageInfo.java index 06b5f7d49..02a75433d 100644 --- a/src/main/java/com/spotify/docker/client/messages/ImageInfo.java +++ b/src/main/java/com/spotify/docker/client/messages/ImageInfo.java @@ -73,6 +73,9 @@ public abstract class ImageInfo { @JsonProperty("VirtualSize") public abstract Long virtualSize(); + @JsonProperty("RootFS") + public abstract RootFs rootFs(); + @JsonCreator static ImageInfo create( @JsonProperty("Id") final String id, @@ -87,8 +90,9 @@ static ImageInfo create( @JsonProperty("Architecture") final String architecture, @JsonProperty("Os") final String os, @JsonProperty("Size") final Long size, - @JsonProperty("VirtualSize") final Long virtualSize) { + @JsonProperty("VirtualSize") final Long virtualSize, + @JsonProperty("RootFS") final RootFs rootFs) { return new AutoValue_ImageInfo(id, parent, comment, created, container, containerConfig, - dockerVersion, author, config, architecture, os, size, virtualSize); + dockerVersion, author, config, architecture, os, size, virtualSize, rootFs); } } diff --git a/src/main/java/com/spotify/docker/client/messages/RootFs.java b/src/main/java/com/spotify/docker/client/messages/RootFs.java new file mode 100644 index 000000000..a03216818 --- /dev/null +++ b/src/main/java/com/spotify/docker/client/messages/RootFs.java @@ -0,0 +1,48 @@ +/*- + * -\-\- + * docker-client + * -- + * Copyright (C) 2016 Spotify AB + * -- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * -/-/- + */ + +package com.spotify.docker.client.messages; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.ANY; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.auto.value.AutoValue; + +import java.util.List; + +@AutoValue +@JsonAutoDetect(fieldVisibility = ANY, getterVisibility = NONE, setterVisibility = NONE) +public abstract class RootFs { + @JsonProperty("Type") + public abstract String type(); + + @JsonProperty("Layers") + public abstract List layers(); + + @JsonCreator + static RootFs create( + @JsonProperty("Type") final String type, + @JsonProperty("Layers") final List layers) { + return new AutoValue_RootFs(type, layers); + } +} diff --git a/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java b/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java index 135e866f7..da9709c88 100644 --- a/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java +++ b/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java @@ -870,6 +870,7 @@ public void testInspectImage() throws Exception { assertThat(info.size(), notNullValue()); assertThat(info.virtualSize(), notNullValue()); + assertThat(info.rootFs(), notNullValue()); } @Test