forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainer.java
More file actions
167 lines (135 loc) · 3.57 KB
/
Copy pathContainer.java
File metadata and controls
167 lines (135 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
package com.github.dockerjava.api.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.dockerjava.api.command.ListContainersCmd;
import com.github.dockerjava.core.RemoteApiVersion;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import javax.annotation.CheckForNull;
import java.util.Map;
/**
* Used for Listing containers.
*
* @author Konstantin Pelykh (kpelykh@gmail.com)
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(Include.NON_NULL)
public class Container {
@JsonProperty("Command")
private String command;
@JsonProperty("Created")
private Long created;
@JsonProperty("Id")
private String id;
@JsonProperty("Image")
private String image;
/**
* @since since {@link RemoteApiVersion#VERSION_1_21}
*/
@JsonProperty("ImageID")
private String imageId;
@JsonProperty("Names")
private String[] names;
@JsonProperty("Ports")
public ContainerPort[] ports;
@JsonProperty("Labels")
public Map<String, String> labels;
@JsonProperty("Status")
private String status;
/**
* @since ~{@link RemoteApiVersion#VERSION_1_19}
*/
@JsonProperty("SizeRw")
private Long sizeRw;
/**
* Returns only when {@link ListContainersCmd#withShowSize(java.lang.Boolean)} set
*
* @since ~{@link RemoteApiVersion#VERSION_1_19}
*/
@JsonProperty("SizeRootFs")
private Long sizeRootFs;
/**
* @since ~{@link RemoteApiVersion#VERSION_1_20}
*/
@JsonProperty("HostConfig")
private ContainerHostConfig hostConfig;
/**
* Docker API docs says "list of networks", but json names `networkSettings`.
* So, reusing existed NetworkSettings model object.
*
* @since ~{@link RemoteApiVersion#VERSION_1_22}
*/
@JsonProperty("NetworkSettings")
private ContainerNetworkSettings networkSettings;
public String getId() {
return id;
}
public String getCommand() {
return command;
}
public String getImage() {
return image;
}
@CheckForNull
public String getImageId() {
return imageId;
}
public Long getCreated() {
return created;
}
public String getStatus() {
return status;
}
public ContainerPort[] getPorts() {
return ports;
}
public Map<String, String> getLabels() {
return labels;
}
public String[] getNames() {
return names;
}
/**
* @see #sizeRw
*/
@CheckForNull
public Long getSizeRw() {
return sizeRw;
}
/**
* @see #sizeRootFs
*/
@CheckForNull
public Long getSizeRootFs() {
return sizeRootFs;
}
/**
* @see #networkSettings
*/
@CheckForNull
public ContainerNetworkSettings getNetworkSettings() {
return networkSettings;
}
/**
* @see #hostConfig
*/
@CheckForNull
public ContainerHostConfig getHostConfig() {
return hostConfig;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
@Override
public boolean equals(Object o) {
return EqualsBuilder.reflectionEquals(this, o);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
}