Skip to content

Commit bef2275

Browse files
committed
Merge pull request #159 from docker-java/issue158
Add missing Info fields
2 parents f0c4acb + 5bed982 commit bef2275

File tree

3 files changed

+55
-5
lines changed

3 files changed

+55
-5
lines changed

src/main/java/com/github/dockerjava/api/model/Info.java

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public class Info {
2525

2626
@JsonProperty("Debug")
2727
private boolean debug;
28+
29+
@JsonProperty("DockerRootDir")
30+
private String DockerRootDir;
2831

2932
@JsonProperty("Driver")
3033
private String driver;
@@ -34,9 +37,12 @@ public class Info {
3437

3538
@JsonProperty("ExecutionDriver")
3639
private String executionDriver;
40+
41+
@JsonProperty("ID")
42+
private String ID;
3743

3844
@JsonProperty("IPv4Forwarding")
39-
private String IPv4Forwarding;
45+
private boolean IPv4Forwarding;
4046

4147
@JsonProperty("Images")
4248
private int images;
@@ -52,9 +58,21 @@ public class Info {
5258

5359
@JsonProperty("KernelVersion")
5460
private String kernelVersion;
61+
62+
@JsonProperty("Labels")
63+
private String Labels;
5564

5665
@JsonProperty("MemoryLimit")
5766
private boolean memoryLimit;
67+
68+
@JsonProperty("MemTotal")
69+
private long memTotal;
70+
71+
@JsonProperty("Name")
72+
private String name;
73+
74+
@JsonProperty("NCPU")
75+
private int NCPU;
5876

5977
@JsonProperty("NEventsListener")
6078
private long nEventListener;
@@ -64,12 +82,15 @@ public class Info {
6482

6583
@JsonProperty("NGoroutines")
6684
private int NGoroutines;
85+
86+
@JsonProperty("OperatingSystem")
87+
private String OperatingSystem;
6788

6889
@JsonProperty("Sockets")
6990
private String[] sockets;
7091

7192
@JsonProperty("SwapLimit")
72-
private int swapLimit;
93+
private boolean swapLimit;
7394

7495
public boolean isDebug() {
7596
return debug;
@@ -78,6 +99,10 @@ public boolean isDebug() {
7899
public int getContainers() {
79100
return containers;
80101
}
102+
103+
public String getDockerRootDir() {
104+
return DockerRootDir;
105+
}
81106

82107
public String getDriver() {
83108
return driver;
@@ -90,8 +115,12 @@ public List<Object> getDriverStatuses() {
90115
public int getImages() {
91116
return images;
92117
}
118+
119+
public String getID() {
120+
return ID;
121+
}
93122

94-
public String getIPv4Forwarding() {
123+
public boolean getIPv4Forwarding() {
95124
return IPv4Forwarding;
96125
}
97126

@@ -110,6 +139,10 @@ public String getInitSha1() {
110139
public String getKernelVersion() {
111140
return kernelVersion;
112141
}
142+
143+
public String getLabels() {
144+
return Labels;
145+
}
113146

114147
public String[] getSockets() {
115148
return sockets;
@@ -122,6 +155,18 @@ public boolean isMemoryLimit() {
122155
public long getnEventListener() {
123156
return nEventListener;
124157
}
158+
159+
public long getMemTotal() {
160+
return memTotal;
161+
}
162+
163+
public String getName() {
164+
return name;
165+
}
166+
167+
public int getNCPU() {
168+
return NCPU;
169+
}
125170

126171
public int getNFd() {
127172
return NFd;
@@ -130,8 +175,12 @@ public int getNFd() {
130175
public int getNGoroutines() {
131176
return NGoroutines;
132177
}
178+
179+
public String getOperatingSystem() {
180+
return OperatingSystem;
181+
}
133182

134-
public int getSwapLimit() {
183+
public boolean getSwapLimit() {
135184
return swapLimit;
136185
}
137186

src/test/java/com/github/dockerjava/core/command/InfoCmdImplTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ public void info() throws DockerException {
6868
assertTrue(dockerInfo.getImages() > 0);
6969
assertTrue(dockerInfo.getNFd() > 0);
7070
assertTrue(dockerInfo.getNGoroutines() > 0);
71+
assertTrue(dockerInfo.getNCPU() > 0);
7172
}
7273
}

src/test/java/com/github/dockerjava/core/command/StartContainerCmdImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ public void startContainerWithLinking() throws DockerException {
283283
}
284284

285285
CreateContainerResponse container2 = dockerClient
286-
.createContainerCmd("busybox").withCmd("true")
286+
.createContainerCmd("busybox").withCmd("sleep", "9999")
287287
.withName("container2").exec();
288288

289289
LOG.info("Created container2 {}", container2.toString());

0 commit comments

Comments
 (0)