Skip to content

Commit dc8b025

Browse files
author
Christopher Dancy
committed
Added support for HostConfig.LogConfig
1 parent da2b9d9 commit dc8b025

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public class HostConfig {
1717

1818
@JsonProperty("LxcConf")
1919
private LxcConf[] lxcConf;
20+
21+
@JsonProperty("LogConfig")
22+
private LogConfig logConfig;
2023

2124
@JsonProperty("PortBindings")
2225
private Ports portBindings;
@@ -66,13 +69,14 @@ public class HostConfig {
6669
public HostConfig() {
6770
}
6871

69-
public HostConfig(Bind[] binds, Link[] links, LxcConf[] lxcConf, Ports portBindings, boolean publishAllPorts,
72+
public HostConfig(Bind[] binds, Link[] links, LxcConf[] lxcConf, LogConfig logConfig, Ports portBindings, boolean publishAllPorts,
7073
boolean privileged, boolean readonlyRootfs, String[] dns, String[] dnsSearch, VolumesFrom[] volumesFrom,
7174
String containerIDFile, Capability[] capAdd, Capability[] capDrop, RestartPolicy restartPolicy,
7275
String networkMode, Device[] devices, String[] extraHosts, Ulimit[] ulimits) {
7376
this.binds = new Binds(binds);
7477
this.links = new Links(links);
7578
this.lxcConf = lxcConf;
79+
this.logConfig = logConfig;
7680
this.portBindings = portBindings;
7781
this.publishAllPorts = publishAllPorts;
7882
this.privileged = privileged;
@@ -98,6 +102,11 @@ public Bind[] getBinds() {
98102
public LxcConf[] getLxcConf() {
99103
return lxcConf;
100104
}
105+
106+
@JsonIgnore
107+
public LogConfig getLogConfig() {
108+
return (logConfig == null) ? new LogConfig() : logConfig;
109+
}
101110

102111
public Ports getPortBindings() {
103112
return portBindings;
@@ -177,6 +186,11 @@ public void setLinks(Link... links) {
177186
public void setLxcConf(LxcConf[] lxcConf) {
178187
this.lxcConf = lxcConf;
179188
}
189+
190+
@JsonIgnore
191+
public void setLogConfig(LogConfig logConfig) {
192+
this.logConfig = logConfig;
193+
}
180194

181195
public void setPortBindings(Ports portBindings) {
182196
this.portBindings = portBindings;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.github.dockerjava.api.model;
2+
3+
import java.util.List;
4+
5+
import com.fasterxml.jackson.annotation.JsonIgnore;
6+
import com.fasterxml.jackson.annotation.JsonProperty;
7+
8+
public class LogConfig {
9+
10+
@JsonProperty("Type")
11+
public String type = "json-file";
12+
13+
@JsonProperty("Config")
14+
public List<String> config = null;
15+
16+
public LogConfig(String type) {
17+
this.type = type;
18+
}
19+
20+
public LogConfig() {
21+
}
22+
23+
public String getType() {
24+
return type;
25+
}
26+
27+
@JsonIgnore
28+
public List<String> getConfig() {
29+
return config;
30+
}
31+
32+
public LogConfig setType(String type) {
33+
this.type = type;
34+
return this;
35+
}
36+
}

0 commit comments

Comments
 (0)