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
170 lines (137 loc) · 3.39 KB
/
Copy pathContainer.java
File metadata and controls
170 lines (137 loc) · 3.39 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
168
169
170
package com.github.dockerjava.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.dockerjava.api.command.ListContainersCmd;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.annotation.CheckForNull;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* Used for Listing containers.
*
* @author Konstantin Pelykh (kpelykh@gmail.com)
*/
@EqualsAndHashCode
@ToString
public class Container implements Serializable {
private static final long serialVersionUID = 1L;
@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_23}
*/
@JsonProperty("State")
private String state;
/**
* @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;
/**
* @since ~{@link RemoteApiVersion#VERSION_1_23}
*/
@JsonProperty("Mounts")
private List<ContainerMount> mounts;
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 String getState() {
return state;
}
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;
}
public List<ContainerMount> getMounts() {
return mounts;
}
}