forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerClient.java
More file actions
243 lines (181 loc) · 8.54 KB
/
Copy pathDockerClient.java
File metadata and controls
243 lines (181 loc) · 8.54 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
package com.github.dockerjava.api;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import javax.annotation.Nonnull;
import com.github.dockerjava.api.command.AttachContainerCmd;
import com.github.dockerjava.api.command.AuthCmd;
import com.github.dockerjava.api.command.BuildImageCmd;
import com.github.dockerjava.api.command.CommitCmd;
import com.github.dockerjava.api.command.ConnectToNetworkCmd;
import com.github.dockerjava.api.command.ContainerDiffCmd;
import com.github.dockerjava.api.command.CopyArchiveFromContainerCmd;
import com.github.dockerjava.api.command.CopyArchiveToContainerCmd;
import com.github.dockerjava.api.command.CopyFileFromContainerCmd;
import com.github.dockerjava.api.command.CreateContainerCmd;
import com.github.dockerjava.api.command.CreateImageCmd;
import com.github.dockerjava.api.command.CreateNetworkCmd;
import com.github.dockerjava.api.command.CreateVolumeCmd;
import com.github.dockerjava.api.command.DisconnectFromNetworkCmd;
import com.github.dockerjava.api.command.EventsCmd;
import com.github.dockerjava.api.command.ExecCreateCmd;
import com.github.dockerjava.api.command.ExecStartCmd;
import com.github.dockerjava.api.command.InfoCmd;
import com.github.dockerjava.api.command.InspectContainerCmd;
import com.github.dockerjava.api.command.InspectExecCmd;
import com.github.dockerjava.api.command.InspectImageCmd;
import com.github.dockerjava.api.command.InspectNetworkCmd;
import com.github.dockerjava.api.command.InspectVolumeCmd;
import com.github.dockerjava.api.command.KillContainerCmd;
import com.github.dockerjava.api.command.ListContainersCmd;
import com.github.dockerjava.api.command.ListImagesCmd;
import com.github.dockerjava.api.command.ListNetworksCmd;
import com.github.dockerjava.api.command.ListVolumesCmd;
import com.github.dockerjava.api.command.LogContainerCmd;
import com.github.dockerjava.api.command.PauseContainerCmd;
import com.github.dockerjava.api.command.PingCmd;
import com.github.dockerjava.api.command.PullImageCmd;
import com.github.dockerjava.api.command.PushImageCmd;
import com.github.dockerjava.api.command.RemoveContainerCmd;
import com.github.dockerjava.api.command.RemoveImageCmd;
import com.github.dockerjava.api.command.RemoveNetworkCmd;
import com.github.dockerjava.api.command.RemoveVolumeCmd;
import com.github.dockerjava.api.command.RestartContainerCmd;
import com.github.dockerjava.api.command.SaveImageCmd;
import com.github.dockerjava.api.command.SearchImagesCmd;
import com.github.dockerjava.api.command.StartContainerCmd;
import com.github.dockerjava.api.command.StatsCmd;
import com.github.dockerjava.api.command.StopContainerCmd;
import com.github.dockerjava.api.command.TagImageCmd;
import com.github.dockerjava.api.command.TopContainerCmd;
import com.github.dockerjava.api.command.UnpauseContainerCmd;
import com.github.dockerjava.api.command.UpdateContainerCmd;
import com.github.dockerjava.api.command.VersionCmd;
import com.github.dockerjava.api.command.WaitContainerCmd;
import com.github.dockerjava.api.command.RenameContainerCmd;
import com.github.dockerjava.api.exception.DockerException;
import com.github.dockerjava.api.model.AuthConfig;
import com.github.dockerjava.api.model.Identifier;
import com.github.dockerjava.core.RemoteApiVersion;
// https://godoc.org/github.com/fsouza/go-dockerclient
public interface DockerClient extends Closeable {
AuthConfig authConfig() throws DockerException;
/**
* Authenticate with the server, useful for checking authentication.
*/
AuthCmd authCmd();
InfoCmd infoCmd();
PingCmd pingCmd();
VersionCmd versionCmd();
/**
* * IMAGE API *
*/
PullImageCmd pullImageCmd(@Nonnull String repository);
PushImageCmd pushImageCmd(@Nonnull String name);
PushImageCmd pushImageCmd(@Nonnull Identifier identifier);
CreateImageCmd createImageCmd(@Nonnull String repository, @Nonnull InputStream imageStream);
SearchImagesCmd searchImagesCmd(@Nonnull String term);
RemoveImageCmd removeImageCmd(@Nonnull String imageId);
ListImagesCmd listImagesCmd();
InspectImageCmd inspectImageCmd(@Nonnull String imageId);
SaveImageCmd saveImageCmd(@Nonnull String name);
/**
* * CONTAINER API *
*/
ListContainersCmd listContainersCmd();
CreateContainerCmd createContainerCmd(@Nonnull String image);
/**
* Creates a new {@link StartContainerCmd} for the container with the given ID. The command can then be further customized by using
* builder methods on it like {@link StartContainerCmd#withDns(String...)}.
* <p>
* <b>If you customize the command, any existing configuration of the target container will get reset to its default before applying the
* new configuration. To preserve the existing configuration, use an unconfigured {@link StartContainerCmd}.</b>
* <p>
* This command corresponds to the <code>/containers/{id}/start</code> endpoint of the Docker Remote API.
*/
StartContainerCmd startContainerCmd(@Nonnull String containerId);
ExecCreateCmd execCreateCmd(@Nonnull String containerId);
InspectContainerCmd inspectContainerCmd(@Nonnull String containerId);
RemoveContainerCmd removeContainerCmd(@Nonnull String containerId);
WaitContainerCmd waitContainerCmd(@Nonnull String containerId);
AttachContainerCmd attachContainerCmd(@Nonnull String containerId);
ExecStartCmd execStartCmd(@Nonnull String execId);
InspectExecCmd inspectExecCmd(@Nonnull String execId);
LogContainerCmd logContainerCmd(@Nonnull String containerId);
/**
* Copy resource from container to local machine.
*
* @param containerId
* id of the container
* @param resource
* path to container's resource
* @return created command
* @since {@link RemoteApiVersion#VERSION_1_20}
*/
CopyArchiveFromContainerCmd copyArchiveFromContainerCmd(@Nonnull String containerId, @Nonnull String resource);
/**
* Copy resource from container to local machine.
*
* @param containerId
* id of the container
* @param resource
* path to container's resource
* @return created command
* @see #copyArchiveFromContainerCmd(String, String)
* @deprecated since docker API version 1.20, replaced by {@link #copyArchiveFromContainerCmd(String, String)}
*/
@Deprecated
CopyFileFromContainerCmd copyFileFromContainerCmd(@Nonnull String containerId, @Nonnull String resource);
/**
* Copy archive from local machine to remote container
*
* @param containerId
* id of the container
* @return created command
* @since {@link RemoteApiVersion#VERSION_1_20}
*/
CopyArchiveToContainerCmd copyArchiveToContainerCmd(@Nonnull String containerId);
ContainerDiffCmd containerDiffCmd(@Nonnull String containerId);
StopContainerCmd stopContainerCmd(@Nonnull String containerId);
KillContainerCmd killContainerCmd(@Nonnull String containerId);
/**
* Update container settings
*
* @param containerId id of the container
* @return command
* @since {@link RemoteApiVersion#VERSION_1_22}
*/
UpdateContainerCmd updateContainerCmd(@Nonnull String containerId);
/**
* Rename container.
*
* @param containerId id of the container
* @return command
* @since {@link RemoteApiVersion#VERSION_1_17}
*/
RenameContainerCmd renameContainerCmd(@Nonnull String containerId);
RestartContainerCmd restartContainerCmd(@Nonnull String containerId);
CommitCmd commitCmd(@Nonnull String containerId);
BuildImageCmd buildImageCmd();
BuildImageCmd buildImageCmd(File dockerFileOrFolder);
BuildImageCmd buildImageCmd(InputStream tarInputStream);
TopContainerCmd topContainerCmd(String containerId);
TagImageCmd tagImageCmd(String imageId, String repository, String tag);
PauseContainerCmd pauseContainerCmd(String containerId);
UnpauseContainerCmd unpauseContainerCmd(String containerId);
EventsCmd eventsCmd();
StatsCmd statsCmd(String containerId);
CreateVolumeCmd createVolumeCmd();
InspectVolumeCmd inspectVolumeCmd(String name);
RemoveVolumeCmd removeVolumeCmd(String name);
ListVolumesCmd listVolumesCmd();
ListNetworksCmd listNetworksCmd();
InspectNetworkCmd inspectNetworkCmd();
CreateNetworkCmd createNetworkCmd();
RemoveNetworkCmd removeNetworkCmd(@Nonnull String networkId);
ConnectToNetworkCmd connectToNetworkCmd();
DisconnectFromNetworkCmd disconnectFromNetworkCmd();
@Override
void close() throws IOException;
}