Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Add RootFS property to InspectImage response #835

Merged
merged 3 commits into from
Jul 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
}
}
48 changes: 48 additions & 0 deletions src/main/java/com/spotify/docker/client/messages/RootFs.java
Original file line number Diff line number Diff line change
@@ -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<String> layers();

@JsonCreator
static RootFs create(
@JsonProperty("Type") final String type,
@JsonProperty("Layers") final List<String> layers) {
return new AutoValue_RootFs(type, layers);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ public void testInspectImage() throws Exception {

assertThat(info.size(), notNullValue());
assertThat(info.virtualSize(), notNullValue());
assertThat(info.rootFs(), notNullValue());
}

@Test
Expand Down