1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | import * as stream from 'stream';
|
18 | import * as events from 'events';
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | declare namespace Dockerode {
|
24 | class Container {
|
25 | constructor(modem: any, id: string);
|
26 |
|
27 | modem: any;
|
28 | id: string;
|
29 |
|
30 | inspect(options: {}, callback: Callback<ContainerInspectInfo>): void;
|
31 | inspect(callback: Callback<ContainerInspectInfo>): void;
|
32 | inspect(options?: {}): Promise<ContainerInspectInfo>;
|
33 |
|
34 | rename(options: {}, callback: Callback<any>): void;
|
35 | rename(options: {}): Promise<any>;
|
36 |
|
37 | update(options: {}, callback: Callback<any>): void;
|
38 | update(options: {}): Promise<any>;
|
39 |
|
40 | top(options: {}, callback: Callback<any>): void;
|
41 | top(callback: Callback<any>): void;
|
42 | top(options?: {}): Promise<any>;
|
43 |
|
44 | changes(callback: Callback<any>): void;
|
45 | changes(): Promise<any>;
|
46 |
|
47 | export(callback: Callback<NodeJS.ReadableStream>): void;
|
48 | export(): Promise<NodeJS.ReadableStream>;
|
49 |
|
50 | start(options: {}, callback: Callback<any>): void;
|
51 | start(callback: Callback<any>): void;
|
52 | start(options?: {}): Promise<any>;
|
53 |
|
54 | pause(options: {}, callback: Callback<any>): void;
|
55 | pause(callback: Callback<any>): void;
|
56 | pause(options?: {}): Promise<any>;
|
57 |
|
58 | unpause(options: {}, callback: Callback<any>): void;
|
59 | unpause(callback: Callback<any>): void;
|
60 | unpause(options?: {}): Promise<any>;
|
61 |
|
62 | exec(options: ExecCreateOptions, callback: Callback<Exec>): void;
|
63 | exec(options: ExecCreateOptions): Promise<Exec>;
|
64 |
|
65 | commit(options: {}, callback: Callback<any>): void;
|
66 | commit(callback: Callback<any>): void;
|
67 | commit(options?: {}): Promise<any>;
|
68 |
|
69 | stop(options: {}, callback: Callback<any>): void;
|
70 | stop(callback: Callback<any>): void;
|
71 | stop(options?: {}): Promise<any>;
|
72 |
|
73 | restart(options: {}, callback: Callback<any>): void;
|
74 | restart(callback: Callback<any>): void;
|
75 | restart(options?: {}): Promise<any>;
|
76 |
|
77 | kill(options: {}, callback: Callback<any>): void;
|
78 | kill(callback: Callback<any>): void;
|
79 | kill(options?: {}): Promise<any>;
|
80 |
|
81 | resize(options: {}, callback: Callback<any>): void;
|
82 | resize(callback: Callback<any>): void;
|
83 | resize(options?: {}): Promise<any>;
|
84 |
|
85 | wait(options: ContainerWaitOptions, callback: Callback<any>): void;
|
86 | wait(callback: Callback<any>): void;
|
87 | wait(options?: ContainerWaitOptions): Promise<any>;
|
88 |
|
89 | remove(options: {}, callback: Callback<any>): void;
|
90 | remove(callback: Callback<any>): void;
|
91 | remove(options?: {}): Promise<any>;
|
92 |
|
93 | /** Deprecated since RAPI v1.20 */
|
94 | copy(options: {}, callback: Callback<any>): void;
|
95 | /** Deprecated since RAPI v1.20 */
|
96 | copy(callback: Callback<any>): void;
|
97 | /** Deprecated since RAPI v1.20 */
|
98 | copy(options?: {}): Promise<any>;
|
99 |
|
100 | getArchive(options: {}, callback: Callback<NodeJS.ReadableStream>): void;
|
101 | getArchive(options: {}): Promise<NodeJS.ReadableStream>;
|
102 |
|
103 | infoArchive(options: {}, callback: Callback<any>): void;
|
104 | infoArchive(options: {}): Promise<any>;
|
105 |
|
106 | /** @param file Filename (will read synchronously), Buffer or stream */
|
107 | putArchive(
|
108 | file: string | Buffer | NodeJS.ReadableStream,
|
109 | options: {},
|
110 | callback: Callback<NodeJS.WritableStream>,
|
111 | ): void;
|
112 | putArchive(file: string | Buffer | NodeJS.ReadableStream, options: {}): Promise<NodeJS.ReadWriteStream>;
|
113 |
|
114 | logs(options: ContainerLogsOptions, callback: Callback<NodeJS.ReadableStream>): void;
|
115 | logs(callback: Callback<NodeJS.ReadableStream>): void;
|
116 | logs(options?: ContainerLogsOptions): Promise<NodeJS.ReadableStream>;
|
117 |
|
118 | stats(options: {}, callback: Callback<ContainerStats>): void;
|
119 | stats(callback: Callback<ContainerStats>): void;
|
120 | stats(options?: {}): Promise<ContainerStats>;
|
121 |
|
122 | attach(options: {}, callback: Callback<NodeJS.ReadWriteStream>): void;
|
123 | attach(options: {}): Promise<NodeJS.ReadWriteStream>;
|
124 | }
|
125 |
|
126 | class Image {
|
127 | constructor(modem: any, name: string);
|
128 |
|
129 | modem: any;
|
130 | id: string;
|
131 |
|
132 | inspect(callback: Callback<ImageInspectInfo>): void;
|
133 | inspect(): Promise<ImageInspectInfo>;
|
134 |
|
135 | history(callback: Callback<any>): void;
|
136 | history(): Promise<any>;
|
137 |
|
138 | get(callback: Callback<NodeJS.ReadableStream>): void;
|
139 | get(): Promise<NodeJS.ReadableStream>;
|
140 |
|
141 | push(options: ImagePushOptions, callback: Callback<NodeJS.ReadableStream>): void;
|
142 | push(callback: Callback<NodeJS.ReadableStream>): void;
|
143 | push(options?: ImagePushOptions): Promise<NodeJS.ReadableStream>;
|
144 |
|
145 | tag(options: {}, callback: Callback<any>): void;
|
146 | tag(callback: Callback<any>): void;
|
147 | tag(options?: {}): Promise<any>;
|
148 |
|
149 | remove(options: {}, callback: Callback<ImageRemoveInfo>): void;
|
150 | remove(callback: Callback<ImageRemoveInfo>): void;
|
151 | remove(options?: {}): Promise<any>;
|
152 | }
|
153 |
|
154 | class Volume {
|
155 | constructor(modem: any, name: string);
|
156 |
|
157 | modem: any;
|
158 | name: string;
|
159 |
|
160 | inspect(callback: Callback<VolumeInspectInfo>): void;
|
161 | inspect(): Promise<VolumeInspectInfo>;
|
162 |
|
163 | remove(options: {}, callback: Callback<any>): void;
|
164 | remove(callback: Callback<any>): void;
|
165 | remove(options?: {}): Promise<any>;
|
166 | }
|
167 |
|
168 | class Service {
|
169 | constructor(modem: any, id: string);
|
170 |
|
171 | modem: any;
|
172 | id: string;
|
173 |
|
174 | inspect(callback: Callback<any>): void;
|
175 | inspect(): Promise<any>;
|
176 |
|
177 | remove(options: {}, callback: Callback<any>): void;
|
178 | remove(callback: Callback<any>): void;
|
179 | remove(options?: {}): Promise<any>;
|
180 |
|
181 | update(options: {}, callback: Callback<any>): void;
|
182 | update(options: {}): Promise<any>;
|
183 |
|
184 | logs(options: ContainerLogsOptions, callback: Callback<NodeJS.ReadableStream>): void;
|
185 | logs(callback: Callback<NodeJS.ReadableStream>): void;
|
186 | logs(options?: ContainerLogsOptions): Promise<NodeJS.ReadableStream>;
|
187 | }
|
188 |
|
189 | class Task {
|
190 | constructor(modem: any, id: string);
|
191 |
|
192 | modem: any;
|
193 | id: string;
|
194 |
|
195 | inspect(callback: Callback<any>): void;
|
196 | inspect(): Promise<any>;
|
197 | }
|
198 |
|
199 | class Node {
|
200 | constructor(modem: any, id: string);
|
201 |
|
202 | modem: any;
|
203 | id: string;
|
204 |
|
205 | inspect(callback: Callback<any>): void;
|
206 | inspect(): Promise<any>;
|
207 |
|
208 | update(options: {}, callback: Callback<any>): void;
|
209 | update(callback: Callback<any>): void;
|
210 | update(options?: {}): Promise<any>;
|
211 |
|
212 | remove(options: {}, callback: Callback<any>): void;
|
213 | remove(callback: Callback<any>): void;
|
214 | remove(options?: {}): Promise<any>;
|
215 | }
|
216 |
|
217 | class Plugin {
|
218 | constructor(modem: any, name: string, remote?: any);
|
219 |
|
220 | modem: any;
|
221 | name: string;
|
222 | remote: any;
|
223 |
|
224 | inspect(callback: Callback<PluginInspectInfo>): void;
|
225 | inspect(): Promise<PluginInspectInfo>;
|
226 |
|
227 | remove(options: {}, callback: Callback<any>): void;
|
228 | remove(callback: Callback<any>): void;
|
229 | remove(options?: {}): Promise<any>;
|
230 |
|
231 | privileges(callback: Callback<any>): void;
|
232 | privileges(): Promise<any>;
|
233 |
|
234 | pull(options: {}, callback: Callback<any>): void;
|
235 | pull(options: {}): Promise<any>;
|
236 |
|
237 | enable(options: {}, callback: Callback<any>): void;
|
238 | enable(callback: Callback<any>): void;
|
239 | enable(options?: {}): Promise<any>;
|
240 |
|
241 | disable(options: {}, callback: Callback<any>): void;
|
242 | disable(callback: Callback<any>): void;
|
243 | disable(options?: {}): Promise<any>;
|
244 |
|
245 | push(options: {}, callback: Callback<any>): void;
|
246 | push(callback: Callback<any>): void;
|
247 | push(options?: {}): Promise<any>;
|
248 |
|
249 | configure(options: {}, callback: Callback<any>): void;
|
250 | configure(callback: Callback<any>): void;
|
251 | configure(options?: {}): Promise<any>;
|
252 |
|
253 | upgrade(auth: any, options: {}, callback: Callback<any>): void;
|
254 | upgrade(auth: any, callback: Callback<any>): void;
|
255 | upgrade(auth: any, options?: {}): Promise<any>;
|
256 | }
|
257 |
|
258 | class Secret {
|
259 | constructor(modem: any, id: string);
|
260 |
|
261 | modem: any;
|
262 | id: string;
|
263 |
|
264 | inspect(callback: Callback<Secret>): void;
|
265 | inspect(): Promise<Secret>;
|
266 |
|
267 | update(options: {}, callback: Callback<any>): void;
|
268 | update(callback: Callback<any>): void;
|
269 | update(options?: {}): Promise<any>;
|
270 |
|
271 | remove(options: {}, callback: Callback<any>): void;
|
272 | remove(callback: Callback<any>): void;
|
273 | remove(options?: {}): Promise<any>;
|
274 | }
|
275 |
|
276 | class Network {
|
277 | constructor(modem: any, id: string);
|
278 |
|
279 | modem: any;
|
280 | id: string;
|
281 |
|
282 | inspect(callback: Callback<any>): void;
|
283 | inspect(): Promise<any>;
|
284 |
|
285 | remove(options: {}, callback: Callback<any>): void;
|
286 | remove(callback: Callback<any>): void;
|
287 | remove(options?: {}): Promise<any>;
|
288 |
|
289 | connect(options: {}, callback: Callback<any>): void;
|
290 | connect(callback: Callback<any>): void;
|
291 | connect(options?: {}): Promise<any>;
|
292 |
|
293 | disconnect(options: {}, callback: Callback<any>): void;
|
294 | disconnect(callback: Callback<any>): void;
|
295 | disconnect(options?: {}): Promise<any>;
|
296 | }
|
297 |
|
298 | class Exec {
|
299 | constructor(modem: any, id: string);
|
300 |
|
301 | modem: any;
|
302 | id: string;
|
303 |
|
304 | inspect(callback: Callback<ExecInspectInfo>): void;
|
305 | inspect(): Promise<ExecInspectInfo>;
|
306 |
|
307 | start(options: ExecStartOptions, callback: Callback<stream.Duplex>): void;
|
308 | start(options: ExecStartOptions): Promise<stream.Duplex>;
|
309 |
|
310 | resize(options: {}, callback: Callback<any>): void;
|
311 | resize(options: {}): Promise<any>;
|
312 | }
|
313 |
|
314 | class Config {
|
315 | constructor(modem: any, id: string);
|
316 |
|
317 | modem: any;
|
318 | id: string;
|
319 |
|
320 | inspect(callback: Callback<ConfigInfo>): void;
|
321 | inspect(): Promise<ConfigInfo>;
|
322 |
|
323 | update(options: {}, callback: Callback<any>): void;
|
324 | update(callback: Callback<any>): void;
|
325 | update(options?: {}): Promise<any>;
|
326 |
|
327 | remove(options: {}, callback: Callback<any>): void;
|
328 | remove(callback: Callback<any>): void;
|
329 | remove(options?: {}): Promise<any>;
|
330 | }
|
331 |
|
332 | type Duration = number;
|
333 |
|
334 | interface ImageInfo {
|
335 | Id: string;
|
336 | ParentId: string;
|
337 | RepoTags: string[];
|
338 | RepoDigests?: string[];
|
339 | Created: number;
|
340 | Size: number;
|
341 | VirtualSize: number;
|
342 | Labels: { [label: string]: string };
|
343 | }
|
344 |
|
345 | interface ContainerInfo {
|
346 | Id: string;
|
347 | Names: string[];
|
348 | Image: string;
|
349 | ImageID: string;
|
350 | Command: string;
|
351 | Created: number;
|
352 | Ports: Port[];
|
353 | Labels: { [label: string]: string };
|
354 | State: string;
|
355 | Status: string;
|
356 | HostConfig: {
|
357 | NetworkMode: string;
|
358 | };
|
359 | NetworkSettings: {
|
360 | Networks: { [networkType: string]: NetworkInfo };
|
361 | };
|
362 | Mounts: Array<{
|
363 | Name?: string;
|
364 | Type: string;
|
365 | Source: string;
|
366 | Destination: string;
|
367 | Driver?: string;
|
368 | Mode: string;
|
369 | RW: boolean;
|
370 | Propagation: string;
|
371 | }>;
|
372 | }
|
373 |
|
374 | interface Port {
|
375 | IP: string;
|
376 | PrivatePort: number;
|
377 | PublicPort: number;
|
378 | Type: string;
|
379 | }
|
380 |
|
381 | interface NetworkInfo {
|
382 | IPAMConfig?: any;
|
383 | Links?: any;
|
384 | Aliases?: any;
|
385 | NetworkID: string;
|
386 | EndpointID: string;
|
387 | Gateway: string;
|
388 | IPAddress: string;
|
389 | IPPrefixLen: number;
|
390 | IPv6Gateway: string;
|
391 | GlobalIPv6Address: string;
|
392 | GlobalIPv6PrefixLen: number;
|
393 | MacAddress: string;
|
394 | }
|
395 |
|
396 |
|
397 | interface NetworkInspectInfo {
|
398 | Name: string;
|
399 | Id: string;
|
400 | Created: string;
|
401 | Scope: string;
|
402 | Driver: string;
|
403 | EnableIPv6: boolean;
|
404 | IPAM?: IPAM;
|
405 | Internal: boolean;
|
406 | Attachable: boolean;
|
407 | Ingress: boolean;
|
408 | ConfigFrom?: { Network: string; };
|
409 | ConfigOnly: boolean;
|
410 | Containers?: { [id: string]: NetworkContainer };
|
411 | Options?: { [key: string]: string };
|
412 | Labels?: { [key: string]: string };
|
413 | }
|
414 |
|
415 | interface NetworkCreateOptions {
|
416 | Name: string;
|
417 | CheckDuplicate?: boolean;
|
418 | Driver?: string;
|
419 | Internal?: boolean;
|
420 | Attachable?: boolean;
|
421 | Ingress?: boolean;
|
422 | IPAM?: IPAM;
|
423 | EnableIPv6?: boolean;
|
424 | Options?: { [option: string]: string };
|
425 | Labels?: { [label: string]: string };
|
426 | }
|
427 |
|
428 | interface NetworkContainer {
|
429 | Name: string;
|
430 | EndpointID: string;
|
431 | MacAddress: string;
|
432 | IPv4Address: string;
|
433 | IPv6Address: string;
|
434 | }
|
435 |
|
436 |
|
437 | interface IPAM {
|
438 | Driver: string;
|
439 | Config?: Array<{ [key: string]: string }>;
|
440 | Options?: { [key: string]: string };
|
441 | }
|
442 |
|
443 |
|
444 | interface VolumeInspectInfo {
|
445 | Name: string;
|
446 | Driver: string;
|
447 | Mountpoint: string;
|
448 | Status?: { [key: string]: string };
|
449 | Labels: { [key: string]: string };
|
450 | Scope: 'local' | 'global';
|
451 |
|
452 | Options: { [key: string]: string } | null;
|
453 |
|
454 | UsageData?: {
|
455 | Size: number;
|
456 | RefCount: number;
|
457 | } | null;
|
458 | }
|
459 |
|
460 | interface ContainerInspectInfo {
|
461 | Id: string;
|
462 | Created: string;
|
463 | Path: string;
|
464 | Args: string[];
|
465 | State: {
|
466 | Status: string;
|
467 | Running: boolean;
|
468 | Paused: boolean;
|
469 | Restarting: boolean;
|
470 | OOMKilled: boolean;
|
471 | Dead: boolean;
|
472 | Pid: number;
|
473 | ExitCode: number;
|
474 | Error: string;
|
475 | StartedAt: string;
|
476 | FinishedAt: string;
|
477 | Health?: {
|
478 | Status: string;
|
479 | FailingStreak: number;
|
480 | Log: Array<{
|
481 | Start: string;
|
482 | End: string;
|
483 | ExitCode: number;
|
484 | Output: string;
|
485 | }>;
|
486 | };
|
487 | };
|
488 | Image: string;
|
489 | ResolvConfPath: string;
|
490 | HostnamePath: string;
|
491 | HostsPath: string;
|
492 | LogPath: string;
|
493 | Name: string;
|
494 | RestartCount: number;
|
495 | Driver: string;
|
496 | Platform: string;
|
497 | MountLabel: string;
|
498 | ProcessLabel: string;
|
499 | AppArmorProfile: string;
|
500 | ExecIDs?: string[];
|
501 | HostConfig: HostConfig;
|
502 | GraphDriver: {
|
503 | Name: string;
|
504 | Data: {
|
505 | DeviceId: string;
|
506 | DeviceName: string;
|
507 | DeviceSize: string;
|
508 | };
|
509 | };
|
510 | Mounts: Array<{
|
511 | Name?: string;
|
512 | Source: string;
|
513 | Destination: string;
|
514 | Mode: string;
|
515 | RW: boolean;
|
516 | Propagation: string;
|
517 | }>;
|
518 | Config: {
|
519 | Hostname: string;
|
520 | Domainname: string;
|
521 | User: string;
|
522 | AttachStdin: boolean;
|
523 | AttachStdout: boolean;
|
524 | AttachStderr: boolean;
|
525 | ExposedPorts: { [portAndProtocol: string]: {} };
|
526 | Tty: boolean;
|
527 | OpenStdin: boolean;
|
528 | StdinOnce: boolean;
|
529 | Env: string[];
|
530 | Cmd: string[];
|
531 | Image: string;
|
532 | Volumes: { [volume: string]: {} };
|
533 | WorkingDir: string;
|
534 | Entrypoint?: string | string[];
|
535 | OnBuild?: any;
|
536 | Labels: { [label: string]: string };
|
537 | };
|
538 | NetworkSettings: {
|
539 | Bridge: string;
|
540 | SandboxID: string;
|
541 | HairpinMode: boolean;
|
542 | LinkLocalIPv6Address: string;
|
543 | LinkLocalIPv6PrefixLen: number;
|
544 | Ports: {
|
545 | [portAndProtocol: string]: Array<{
|
546 | HostIp: string;
|
547 | HostPort: string;
|
548 | }>;
|
549 | };
|
550 | SandboxKey: string;
|
551 | SecondaryIPAddresses?: any;
|
552 | SecondaryIPv6Addresses?: any;
|
553 | EndpointID: string;
|
554 | Gateway: string;
|
555 | GlobalIPv6Address: string;
|
556 | GlobalIPv6PrefixLen: number;
|
557 | IPAddress: string;
|
558 | IPPrefixLen: number;
|
559 | IPv6Gateway: string;
|
560 | MacAddress: string;
|
561 | Networks: {
|
562 | [type: string]: {
|
563 | IPAMConfig?: any;
|
564 | Links?: any;
|
565 | Aliases?: any;
|
566 | NetworkID: string;
|
567 | EndpointID: string;
|
568 | Gateway: string;
|
569 | IPAddress: string;
|
570 | IPPrefixLen: number;
|
571 | IPv6Gateway: string;
|
572 | GlobalIPv6Address: string;
|
573 | GlobalIPv6PrefixLen: number;
|
574 | MacAddress: string;
|
575 | };
|
576 | };
|
577 | Node?: {
|
578 | ID: string;
|
579 | IP: string;
|
580 | Addr: string;
|
581 | Name: string;
|
582 | Cpus: number;
|
583 | Memory: number;
|
584 | Labels: any;
|
585 | };
|
586 | };
|
587 | }
|
588 |
|
589 | interface NetworkStats {
|
590 | [name: string]: {
|
591 | rx_bytes: number;
|
592 | rx_dropped: number;
|
593 | rx_errors: number;
|
594 | rx_packets: number;
|
595 | tx_bytes: number;
|
596 | tx_dropped: number;
|
597 | tx_errors: number;
|
598 | tx_packets: number;
|
599 | };
|
600 | }
|
601 |
|
602 | interface CPUStats {
|
603 | cpu_usage: {
|
604 | percpu_usage: number[];
|
605 | usage_in_usermode: number;
|
606 | total_usage: number;
|
607 | usage_in_kernelmode: number;
|
608 | };
|
609 | system_cpu_usage: number;
|
610 | online_cpus: number;
|
611 | throttling_data: {
|
612 | periods: number;
|
613 | throttled_periods: number;
|
614 | throttled_time: number;
|
615 | };
|
616 | }
|
617 |
|
618 | interface MemoryStats {
|
619 | stats: {
|
620 | total_pgmajfault: number;
|
621 | cache: number;
|
622 | mapped_file: number;
|
623 | total_inactive_file: number;
|
624 | pgpgout: number;
|
625 | rss: number;
|
626 | total_mapped_file: number;
|
627 | writeback: number;
|
628 | unevictable: number;
|
629 | pgpgin: number;
|
630 | total_unevictable: number;
|
631 | pgmajfault: number;
|
632 | total_rss: number;
|
633 | total_rss_huge: number;
|
634 | total_writeback: number;
|
635 | total_inactive_anon: number;
|
636 | rss_huge: number;
|
637 | hierarchical_memory_limit: number;
|
638 | total_pgfault: number;
|
639 | total_active_file: number;
|
640 | active_anon: number;
|
641 | total_active_anon: number;
|
642 | total_pgpgout: number;
|
643 | total_cache: number;
|
644 | inactive_anon: number;
|
645 | active_file: number;
|
646 | pgfault: number;
|
647 | inactive_file: number;
|
648 | total_pgpgin: number;
|
649 | };
|
650 | max_usage: number;
|
651 | usage: number;
|
652 | failcnt: number;
|
653 | limit: number;
|
654 | }
|
655 |
|
656 | interface ContainerStats {
|
657 | read: string;
|
658 | pid_stats: {
|
659 | current: number;
|
660 | };
|
661 | networks: NetworkStats;
|
662 | memory_stats: MemoryStats;
|
663 | blkio_stats: {};
|
664 | cpu_stats: CPUStats;
|
665 | precpu_stats: CPUStats;
|
666 | }
|
667 |
|
668 | interface HostConfig {
|
669 | AutoRemove?: boolean;
|
670 | Binds?: string[];
|
671 | ContainerIDFile?: string;
|
672 | LogConfig?: {
|
673 | Type: string;
|
674 | Config: any;
|
675 | };
|
676 | NetworkMode?: string;
|
677 | PortBindings?: any;
|
678 | RestartPolicy?: RestartPolicy;
|
679 | VolumeDriver?: string;
|
680 | VolumesFrom?: any;
|
681 | Mounts?: MountConfig;
|
682 | CapAdd?: any;
|
683 | CapDrop?: any;
|
684 | Dns?: any[];
|
685 | DnsOptions?: any[];
|
686 | DnsSearch?: any[];
|
687 | ExtraHosts?: any;
|
688 | GroupAdd?: string[];
|
689 | IpcMode?: string;
|
690 | Cgroup?: string;
|
691 | Links?: any;
|
692 | OomScoreAdj?: number;
|
693 | PidMode?: string;
|
694 | Privileged?: boolean;
|
695 | PublishAllPorts?: boolean;
|
696 | ReadonlyRootfs?: boolean;
|
697 | SecurityOpt?: any;
|
698 | StorageOpt?: { [option: string]: string };
|
699 | Tmpfs?: { [dir: string]: string };
|
700 | UTSMode?: string;
|
701 | UsernsMode?: string;
|
702 | ShmSize?: number;
|
703 | Sysctls?: { [index: string]: string };
|
704 | Runtime?: string;
|
705 | ConsoleSize?: number[];
|
706 | Isolation?: string;
|
707 | MaskedPaths?: string[];
|
708 | ReadonlyPaths?: string[];
|
709 | CpuShares?: number;
|
710 | CgroupParent?: string;
|
711 | BlkioWeight?: number;
|
712 | BlkioWeightDevice?: any;
|
713 | BlkioDeviceReadBps?: any;
|
714 | BlkioDeviceWriteBps?: any;
|
715 | BlkioDeviceReadIOps?: any;
|
716 | BlkioDeviceWriteIOps?: any;
|
717 | CpuPeriod?: number;
|
718 | CpuQuota?: number;
|
719 | CpusetCpus?: string;
|
720 | CpusetMems?: string;
|
721 | Devices?: any;
|
722 | DeviceCgroupRules?: string[];
|
723 | DeviceRequests?: DeviceRequest[];
|
724 | DiskQuota?: number;
|
725 | KernelMemory?: number;
|
726 | Memory?: number;
|
727 | MemoryReservation?: number;
|
728 | MemorySwap?: number;
|
729 | MemorySwappiness?: number;
|
730 | OomKillDisable?: boolean;
|
731 | PidsLimit?: number;
|
732 | Ulimits?: any;
|
733 | }
|
734 |
|
735 | interface ImageInspectInfo {
|
736 | Id: string;
|
737 | RepoTags: string[];
|
738 | RepoDigests: string[];
|
739 | Parent: string;
|
740 | Comment: string;
|
741 | Created: string;
|
742 | Container: string;
|
743 | ContainerConfig: {
|
744 | Hostname: string;
|
745 | Domainname: string;
|
746 | User: string;
|
747 | AttachStdin: boolean;
|
748 | AttachStdout: boolean;
|
749 | AttachStderr: boolean;
|
750 | ExposedPorts: { [portAndProtocol: string]: {} };
|
751 | Tty: boolean;
|
752 | OpenStdin: boolean;
|
753 | StdinOnce: boolean;
|
754 | Env: string[];
|
755 | Cmd: string[];
|
756 | ArgsEscaped: boolean;
|
757 | Image: string;
|
758 | Volumes: { [path: string]: {} };
|
759 | WorkingDir: string;
|
760 | Entrypoint?: string | string[];
|
761 | OnBuild?: any[];
|
762 | Labels: { [label: string]: string };
|
763 | };
|
764 | DockerVersion: string;
|
765 | Author: string;
|
766 | Config: {
|
767 | Hostname: string;
|
768 | Domainname: string;
|
769 | User: string;
|
770 | AttachStdin: boolean;
|
771 | AttachStdout: boolean;
|
772 | AttachStderr: boolean;
|
773 | ExposedPorts: { [portAndProtocol: string]: {} };
|
774 | Tty: boolean;
|
775 | OpenStdin: boolean;
|
776 | StdinOnce: boolean;
|
777 | Env: string[];
|
778 | Cmd: string[];
|
779 | ArgsEscaped: boolean;
|
780 | Image: string;
|
781 | Volumes: { [path: string]: {} };
|
782 | WorkingDir: string;
|
783 | Entrypoint?: string | string[];
|
784 | OnBuild: any[];
|
785 | Labels: { [label: string]: string };
|
786 | };
|
787 | Architecture: string;
|
788 | Os: string;
|
789 | Size: number;
|
790 | VirtualSize: number;
|
791 | GraphDriver: {
|
792 | Name: string;
|
793 | Data: {
|
794 | DeviceId: string;
|
795 | DeviceName: string;
|
796 | DeviceSize: string;
|
797 | };
|
798 | };
|
799 | RootFS: {
|
800 | Type: string;
|
801 | Layers?: string[];
|
802 | BaseLayer?: string;
|
803 | };
|
804 | }
|
805 |
|
806 | interface ImageBuildOptions {
|
807 | authconfig?: AuthConfig;
|
808 | dockerfile?: string;
|
809 | t?: string;
|
810 | extrahosts?: string;
|
811 | remote?: string;
|
812 | q?: boolean;
|
813 | cachefrom?: string;
|
814 | pull?: string;
|
815 | rm?: boolean;
|
816 | forcerm?: boolean;
|
817 | memory?: number;
|
818 | memswap?: number;
|
819 | cpushares?: number;
|
820 | cpusetcpus?: number;
|
821 | cpuperiod?: number;
|
822 | cpuquota?: number;
|
823 | buildargs?: {[key: string]: string};
|
824 | shmsize?: number;
|
825 | squash?: boolean;
|
826 | labels?: {[key: string]: string};
|
827 | networkmode?: string;
|
828 | platform?: string;
|
829 | target?: string;
|
830 | outputs?: string;
|
831 | }
|
832 |
|
833 | interface ImagePushOptions {
|
834 | tag?: string;
|
835 | authconfig?: AuthConfig;
|
836 | }
|
837 |
|
838 | interface AuthConfig {
|
839 | username: string;
|
840 | password: string;
|
841 | serveraddress: string;
|
842 | email?: string;
|
843 | }
|
844 |
|
845 | interface PortBinding {
|
846 | HostIp?: string;
|
847 | HostPort?: string;
|
848 | }
|
849 |
|
850 | interface PortMap {
|
851 | [key: string]: PortBinding[];
|
852 | }
|
853 |
|
854 | interface RestartPolicy {
|
855 | Name: string;
|
856 | MaximumRetryCount?: number;
|
857 | }
|
858 |
|
859 | type LoggingDriverType =
|
860 | | 'json-file'
|
861 | | 'syslog'
|
862 | | 'journald'
|
863 | | 'gelf'
|
864 | | 'fluentd'
|
865 | | 'awslogs'
|
866 | | 'splunk'
|
867 | | 'etwlogs'
|
868 | | 'none';
|
869 |
|
870 | interface LogConfig {
|
871 | Type: LoggingDriverType;
|
872 | Config?: { [key: string]: string };
|
873 | }
|
874 |
|
875 | interface DeviceMapping {
|
876 | PathOnHost: string;
|
877 | PathInContainer: string;
|
878 | CgroupPermissions: string;
|
879 | }
|
880 |
|
881 | interface DeviceRequest {
|
882 | Driver?: string;
|
883 | Count?: number;
|
884 | DeviceIDs?: string[];
|
885 | Capabilities?: string[][];
|
886 | Options?: { [key: string]: string };
|
887 | }
|
888 |
|
889 |
|
890 | interface IPAMConfig {
|
891 | IPv4Address?: string;
|
892 | IPv6Address?: string;
|
893 | LinkLocalIPs?: string[];
|
894 | }
|
895 |
|
896 |
|
897 | interface EndpointSettings {
|
898 | IPAMConfig?: IPAMConfig;
|
899 | Links?: string[];
|
900 | Aliases?: string[];
|
901 | NetworkID?: string;
|
902 | EndpointID?: string;
|
903 | Gateway?: string;
|
904 | IPAddress?: string;
|
905 | IPPrefixLen?: number;
|
906 | IPv6Gateway?: string;
|
907 | GlobalIPv6Address?: string;
|
908 | GlobalIPV6PrefixLen?: number;
|
909 | MacAddress?: string;
|
910 | DriverOpts?: { [key: string]: string };
|
911 | }
|
912 |
|
913 | interface EndpointsConfig {
|
914 | [key: string]: EndpointSettings;
|
915 | }
|
916 |
|
917 | interface ExecCreateOptions {
|
918 | AttachStdin?: boolean;
|
919 | AttachStdout?: boolean;
|
920 | AttachStderr?: boolean;
|
921 | DetachKeys?: string;
|
922 | Tty?: boolean;
|
923 | Env?: string[];
|
924 | Cmd?: string[];
|
925 | Privileged?: boolean;
|
926 | User?: string;
|
927 | WorkingDir?: string;
|
928 | }
|
929 |
|
930 | interface ExecInspectInfo {
|
931 | CanRemove: boolean;
|
932 | DetachKeys: string;
|
933 | ID: string;
|
934 | Running: boolean;
|
935 | ExitCode: number | null;
|
936 | ProcessConfig: {
|
937 | privileged: boolean;
|
938 | user: string;
|
939 | tty: boolean;
|
940 | entrypoint: string;
|
941 | arguments: string[];
|
942 | };
|
943 | OpenStdin: boolean;
|
944 | OpenStderr: boolean;
|
945 | OpenStdout: boolean;
|
946 | ContainerID: string;
|
947 | Pid: number;
|
948 | }
|
949 |
|
950 | interface ExecStartOptions {
|
951 |
|
952 | hijack?: boolean;
|
953 | stdin?: boolean;
|
954 |
|
955 | Detach?: boolean;
|
956 | Tty?: boolean;
|
957 | }
|
958 |
|
959 | type MountType = 'bind' | 'volume' | 'tmpfs';
|
960 |
|
961 | type MountConsistency = 'default' | 'consistent' | 'cached' | 'delegated';
|
962 |
|
963 | type MountPropagation = 'private' | 'rprivate' | 'shared' | 'rshared' | 'slave' | 'rslave';
|
964 |
|
965 | interface MountSettings {
|
966 | Target: string;
|
967 | Source: string;
|
968 | Type: MountType;
|
969 | ReadOnly?: boolean;
|
970 | Consistency?: MountConsistency;
|
971 | BindOptions?: {
|
972 | Propagation: MountPropagation;
|
973 | };
|
974 | VolumeOptions?: {
|
975 | NoCopy: boolean;
|
976 | Labels: { [label: string]: string };
|
977 | DriverConfig: {
|
978 | Name: string;
|
979 | Options: { [option: string]: string };
|
980 | };
|
981 | };
|
982 | TmpfsOptions?: {
|
983 | SizeBytes: number;
|
984 | Mode: number;
|
985 | };
|
986 | }
|
987 |
|
988 | type MountConfig = MountSettings[];
|
989 |
|
990 | interface ContainerCreateOptions {
|
991 | name?: string;
|
992 | Hostname?: string;
|
993 | Domainname?: string;
|
994 | User?: string;
|
995 | AttachStdin?: boolean;
|
996 | AttachStdout?: boolean;
|
997 | AttachStderr?: boolean;
|
998 | Tty?: boolean;
|
999 | OpenStdin?: boolean;
|
1000 | StdinOnce?: boolean;
|
1001 | Env?: string[];
|
1002 | Cmd?: string[];
|
1003 | Entrypoint?: string | string[];
|
1004 | Image?: string;
|
1005 | Labels?: { [label: string]: string };
|
1006 | Volumes?: { [volume: string]: {} };
|
1007 | WorkingDir?: string;
|
1008 | NetworkDisabled?: boolean;
|
1009 | MacAddress?: boolean;
|
1010 | ExposedPorts?: { [port: string]: {} };
|
1011 | StopSignal?: string;
|
1012 | StopTimeout?: number;
|
1013 | HostConfig?: HostConfig;
|
1014 | NetworkingConfig?: {
|
1015 | EndpointsConfig?: EndpointsConfig;
|
1016 | };
|
1017 | }
|
1018 |
|
1019 | interface KeyObject {
|
1020 | pem: string | Buffer;
|
1021 | passphrase?: string;
|
1022 | }
|
1023 |
|
1024 | interface DockerOptions {
|
1025 | socketPath?: string;
|
1026 | host?: string;
|
1027 | port?: number | string;
|
1028 | username?: string;
|
1029 | ca?: string | string[] | Buffer | Buffer[];
|
1030 | cert?: string | string[] | Buffer | Buffer[];
|
1031 | key?: string | string[] | Buffer | Buffer[] | KeyObject[];
|
1032 | protocol?: 'https' | 'http' | 'ssh';
|
1033 | timeout?: number;
|
1034 | version?: string;
|
1035 | sshAuthAgent?: string;
|
1036 | Promise?: typeof Promise;
|
1037 | }
|
1038 |
|
1039 | interface GetEventsOptions {
|
1040 | since?: number;
|
1041 | until?: number;
|
1042 | filters?:
|
1043 | | string
|
1044 | | {
|
1045 | config?: string;
|
1046 | container?: string[];
|
1047 | daemon?: string[];
|
1048 | event?: string[];
|
1049 | image?: string[];
|
1050 | label?: string[];
|
1051 | network?: string[];
|
1052 | node?: string[];
|
1053 | plugin?: string[];
|
1054 | scope?: Array<'local' | 'swarm'>;
|
1055 | secret?: string[];
|
1056 | service?: string[];
|
1057 | type?: Array<
|
1058 | | 'container'
|
1059 | | 'image'
|
1060 | | 'volume'
|
1061 | | 'network'
|
1062 | | 'daemon'
|
1063 | | 'plugin'
|
1064 | | 'service'
|
1065 | | 'node'
|
1066 | | 'secret'
|
1067 | | 'config'
|
1068 | >;
|
1069 | volume?: string[];
|
1070 | };
|
1071 | }
|
1072 |
|
1073 | interface SecretVersion {
|
1074 | Index: number;
|
1075 | }
|
1076 |
|
1077 | interface Annotations {
|
1078 | Name?: string;
|
1079 | Labels?: { [name: string]: string };
|
1080 | }
|
1081 |
|
1082 | interface ResourceLimits {
|
1083 | NanoCPUs?: number;
|
1084 | MemoryBytes?: number;
|
1085 | Pids?: number;
|
1086 | }
|
1087 |
|
1088 | interface NamedGenericResource {
|
1089 | Kind?: string;
|
1090 | Value?: string;
|
1091 | }
|
1092 |
|
1093 | interface DiscreteGenericResource {
|
1094 | Kind?: string;
|
1095 | Value?: number;
|
1096 | }
|
1097 |
|
1098 | type GenericResource = NamedGenericResource | DiscreteGenericResource;
|
1099 |
|
1100 | interface RestartPolicy {
|
1101 | Condition?: string;
|
1102 | Delay?: number;
|
1103 | MaxAttempts?: number;
|
1104 | Window?: number;
|
1105 | }
|
1106 |
|
1107 | interface Resources {
|
1108 | NanoCPUs?: number;
|
1109 | MemoryBytes?: number;
|
1110 | GenericResources?: GenericResource[];
|
1111 | }
|
1112 |
|
1113 | interface ResourceRequirements {
|
1114 | Limits?: ResourceLimits;
|
1115 | Reservations?: Resources;
|
1116 | }
|
1117 |
|
1118 | interface Placement {
|
1119 | Constraints?: string[];
|
1120 | Preferences?: Array<{ Spread: { SpreadDescriptor: string } }>;
|
1121 | MaxReplicas?: number;
|
1122 | Platforms?: Array<{
|
1123 | Architecture: string;
|
1124 | OS: string;
|
1125 | }>;
|
1126 | }
|
1127 |
|
1128 | interface NetworkAttachmentConfig {
|
1129 | Target?: string;
|
1130 | Aliases?: string[];
|
1131 | DriverOpts?: { [key: string]: string };
|
1132 | }
|
1133 |
|
1134 | interface Privileges {
|
1135 | CredentialSpec?: {
|
1136 | Config?: string;
|
1137 | File?: string;
|
1138 | Registry?: string;
|
1139 | };
|
1140 | SELinuxContext?: {
|
1141 | Disable?: boolean;
|
1142 | User?: string;
|
1143 | Role?: string;
|
1144 | Type?: string;
|
1145 | Level?: string;
|
1146 | };
|
1147 | }
|
1148 |
|
1149 | interface HealthConfig {
|
1150 | Test?: string[];
|
1151 | Interval?: number;
|
1152 | Timeout?: number;
|
1153 | StartPeriod?: number;
|
1154 | Retries?: number;
|
1155 | }
|
1156 |
|
1157 | interface DNSConfig {
|
1158 | Nameservers?: string[];
|
1159 | Search?: string[];
|
1160 | Options?: string[];
|
1161 | }
|
1162 |
|
1163 | interface SecretReference {
|
1164 | File?: {
|
1165 | Name?: string;
|
1166 | UID?: string;
|
1167 | GID?: string;
|
1168 | Mode?: number;
|
1169 | };
|
1170 | SecretID?: string;
|
1171 | SecretName?: string;
|
1172 | }
|
1173 |
|
1174 | interface Ulimit {
|
1175 | Name?: string;
|
1176 | Hard?: number;
|
1177 | Soft?: number;
|
1178 | }
|
1179 |
|
1180 | interface ContainerSpec {
|
1181 | Image?: string;
|
1182 | Labels?: { [label: string]: string };
|
1183 | Command?: string[];
|
1184 | Args?: string[];
|
1185 | Hostname?: string;
|
1186 | Env?: string[];
|
1187 | Dir?: string;
|
1188 | User?: string;
|
1189 | Groups?: string[];
|
1190 | Privileges?: Privileges;
|
1191 | Init?: boolean;
|
1192 | TTY?: boolean;
|
1193 | OpenStdin?: boolean;
|
1194 | ReadOnly?: boolean;
|
1195 | Mounts?: MountSettings[];
|
1196 | StopSignal?: string;
|
1197 | StopGracePeriod?: number;
|
1198 | HealthCheck?: HealthConfig;
|
1199 | Hosts?: string[];
|
1200 | DNSConfig?: DNSConfig;
|
1201 | Secrets?: SecretReference[];
|
1202 | Isolation?: string;
|
1203 | Sysctls?: { [key: string]: string };
|
1204 | CapabilityAdd?: string[];
|
1205 | CapabilityDrop?: string[];
|
1206 | Ulimits?: Ulimit[];
|
1207 | }
|
1208 |
|
1209 | interface PluginSpec {
|
1210 | Name?: string;
|
1211 | Remote?: string;
|
1212 | Privileges?: {
|
1213 | Name?: string;
|
1214 | Description?: string;
|
1215 | Value?: string[];
|
1216 | };
|
1217 | Disabled?: boolean;
|
1218 | Env?: string[];
|
1219 | }
|
1220 |
|
1221 | interface TaskSpecBase {
|
1222 | Resources?: ResourceRequirements;
|
1223 | RestartPolicy?: RestartPolicy;
|
1224 | Placement?: Placement;
|
1225 | Networks?: NetworkAttachmentConfig[];
|
1226 | LogDriver?: {
|
1227 | Name?: string;
|
1228 | Options?: { [key: string]: string };
|
1229 | };
|
1230 | ForceUpdate?: number;
|
1231 | Runtime?: string;
|
1232 | }
|
1233 |
|
1234 | interface ContainerTaskSpec extends TaskSpecBase {
|
1235 | ContainerSpec?: ContainerSpec;
|
1236 | }
|
1237 |
|
1238 | interface PluginTaskSpec extends TaskSpecBase {
|
1239 | Runtime: 'plugin';
|
1240 | PluginSpec: PluginSpec;
|
1241 | }
|
1242 |
|
1243 | interface NetworkAttachmentTaskSpec extends TaskSpecBase {
|
1244 | Runtime: 'attachment';
|
1245 | NetworkAttachmentSpec: {
|
1246 | ContainerID: string;
|
1247 | };
|
1248 | }
|
1249 |
|
1250 | type TaskSpec = ContainerTaskSpec | PluginTaskSpec | NetworkAttachmentTaskSpec;
|
1251 |
|
1252 | interface ServiceMode {
|
1253 | Replicated?: { Replicas?: number };
|
1254 | Global?: {};
|
1255 | ReplicatedJob?: {
|
1256 | MaxConcurrent?: number;
|
1257 | TotalCompletions?: number;
|
1258 | };
|
1259 | GlobalJob?: {};
|
1260 | }
|
1261 |
|
1262 | interface UpdateConfig {
|
1263 | Parallelism: number;
|
1264 | Delay?: number;
|
1265 | FailureAction?: string;
|
1266 | Monitor?: number;
|
1267 | MaxFailureRatio?: number;
|
1268 | Order: string;
|
1269 | }
|
1270 |
|
1271 | interface PortConfig {
|
1272 | Name?: string;
|
1273 | Protocol?: 'tcp' | 'udp' | 'sctp';
|
1274 | TargetPort?: number;
|
1275 | PublishedPort?: number;
|
1276 | PublishMode?: 'ingress' | 'host';
|
1277 | }
|
1278 |
|
1279 | interface EndpointSpec {
|
1280 | Mode?: string;
|
1281 | Ports?: PortConfig[];
|
1282 | }
|
1283 |
|
1284 | interface EndpointVirtualIP {
|
1285 | NetworkID?: string;
|
1286 | Addr?: string;
|
1287 | }
|
1288 |
|
1289 | interface Endpoint {
|
1290 | Spec?: EndpointSpec;
|
1291 | Ports?: PortConfig[];
|
1292 | VirtualIPs?: EndpointVirtualIP[];
|
1293 | }
|
1294 |
|
1295 | interface ServiceSpec extends Annotations {
|
1296 | TaskTemplate?: TaskSpec;
|
1297 | Mode?: ServiceMode;
|
1298 | UpdateConfig?: UpdateConfig;
|
1299 | RollbackConfig?: UpdateConfig;
|
1300 | Networks?: NetworkAttachmentConfig[];
|
1301 | EndpointSpec?: EndpointSpec;
|
1302 | }
|
1303 |
|
1304 | interface CreateServiceOptions extends ServiceSpec {
|
1305 | authconfig?: AuthConfig;
|
1306 | }
|
1307 |
|
1308 | interface ServiceCreateResponse {
|
1309 | ID: string;
|
1310 | Warnings?: string[];
|
1311 | }
|
1312 |
|
1313 | interface ServiceListOptions {
|
1314 | Filters: {
|
1315 | id?: string[];
|
1316 | label?: string[];
|
1317 | mode?: Array<'replicated' | 'global'>;
|
1318 | name?: string[];
|
1319 | };
|
1320 | }
|
1321 |
|
1322 | interface Version {
|
1323 | Index?: number;
|
1324 | }
|
1325 |
|
1326 | interface Meta {
|
1327 | Version?: Version;
|
1328 | CreatedAt?: string;
|
1329 | UpdatedAt?: string;
|
1330 | }
|
1331 |
|
1332 | type UpdateState = 'updating' | 'paused' | 'completed' | 'rollback_started' | 'rollback_paused' | 'rollback_completed';
|
1333 |
|
1334 | interface UpdateStatus {
|
1335 | State?: UpdateState;
|
1336 | StartedAt?: string;
|
1337 | CompletedAt?: string;
|
1338 | Message?: string;
|
1339 | }
|
1340 |
|
1341 | interface ServiceStatus {
|
1342 | RunningTasks: number;
|
1343 | DesiredTasks: number;
|
1344 | CompletedTasks: number;
|
1345 | }
|
1346 |
|
1347 | interface JobStatus {
|
1348 | JobIteration: Version;
|
1349 | LastExecution?: string;
|
1350 | }
|
1351 |
|
1352 | interface Service extends Meta {
|
1353 | ID: string;
|
1354 | Spec?: ServiceSpec;
|
1355 | PreviousSpec?: ServiceSpec;
|
1356 | Endpoint?: Endpoint;
|
1357 | UpdateStatus?: UpdateStatus;
|
1358 | ServiceStatus?: ServiceStatus;
|
1359 | JobStatus?: JobStatus;
|
1360 | }
|
1361 |
|
1362 | interface OrchestrationConfig {
|
1363 | TaskHistoryRetentionLimit?: number;
|
1364 | }
|
1365 |
|
1366 | interface RaftConfig {
|
1367 | SnapshotInterval?: number;
|
1368 | KeepOldSnapshots?: number;
|
1369 | LogEntriesForSlowFollowers?: number;
|
1370 | ElectionTick?: number;
|
1371 | HeartbeatTick?: number;
|
1372 | }
|
1373 |
|
1374 | interface DispatcherConfig {
|
1375 | HeartbeatPeriod?: Duration;
|
1376 | }
|
1377 |
|
1378 | type ExternalCAProtocol = 'cfssl' | string;
|
1379 |
|
1380 | interface ExternalCA {
|
1381 | Protocol: ExternalCAProtocol;
|
1382 | URL: string;
|
1383 | Options?: { [key: string]: string };
|
1384 | CACert: string;
|
1385 | }
|
1386 |
|
1387 | interface CAConfig {
|
1388 | NodeCertExpiry?: Duration;
|
1389 | ExternalCAs?: ExternalCA[];
|
1390 | SigningCACert?: string;
|
1391 | SigningCAKey?: string;
|
1392 | ForceRotate?: number;
|
1393 | }
|
1394 |
|
1395 | interface TaskDefaults {
|
1396 | LogDriver?: Driver;
|
1397 | }
|
1398 |
|
1399 | interface EncryptionConfig {
|
1400 | AutoLockManagers: boolean;
|
1401 | }
|
1402 |
|
1403 | interface Spec extends Annotations {
|
1404 | Orchestration?: OrchestrationConfig;
|
1405 | Raft: RaftConfig;
|
1406 | Dispatcher?: DispatcherConfig;
|
1407 | CAConfig?: CAConfig;
|
1408 | TaskDefaults?: TaskDefaults;
|
1409 | EncryptionConfig?: EncryptionConfig;
|
1410 | }
|
1411 |
|
1412 | interface TLSInfo {
|
1413 | TrustRoot?: string;
|
1414 | CertIssuerSubject?: string;
|
1415 | CertIssuerPublicKey?: string;
|
1416 | }
|
1417 |
|
1418 | interface ClusterInfo extends Meta {
|
1419 | ID: string;
|
1420 | Spec: Spec;
|
1421 | TLSInfo: TLSInfo;
|
1422 | RootRotationInProgress: boolean;
|
1423 | DefaultAddrPool: string[];
|
1424 | SubnetSize: number;
|
1425 | DataPathPort: number;
|
1426 | }
|
1427 |
|
1428 | interface JoinTokens {
|
1429 | Worker: string;
|
1430 | Manager: string;
|
1431 | }
|
1432 |
|
1433 | interface Swarm extends ClusterInfo {
|
1434 | JoinTokens: JoinTokens;
|
1435 | }
|
1436 |
|
1437 | interface Driver {
|
1438 | Name: string;
|
1439 | Options?: { [key: string]: string };
|
1440 | }
|
1441 |
|
1442 | interface SecretSpec extends Annotations {
|
1443 | Data?: string;
|
1444 | Driver?: Driver;
|
1445 | Templating?: Driver;
|
1446 | }
|
1447 |
|
1448 | interface Secret extends Meta {
|
1449 | ID: string;
|
1450 | Spec?: SecretSpec;
|
1451 | }
|
1452 |
|
1453 | interface ConfigInfo {
|
1454 | ID: string;
|
1455 | Version: SecretVersion;
|
1456 | CreatedAt: string;
|
1457 | UpdatedAt?: string;
|
1458 | Spec?: ConfigSpec;
|
1459 | }
|
1460 |
|
1461 | interface ConfigSpec {
|
1462 | Name: string;
|
1463 | Labels: { [label: string]: string };
|
1464 | Data: string;
|
1465 | }
|
1466 |
|
1467 | interface ConfigVersion {
|
1468 | Index: number;
|
1469 | }
|
1470 |
|
1471 | interface PluginInfo {
|
1472 | Id?: string;
|
1473 | Name: string;
|
1474 | Enabled: boolean;
|
1475 | Settings: PluginSettings;
|
1476 | PluginReference?: string;
|
1477 | Config: PluginConfig;
|
1478 | }
|
1479 |
|
1480 | type PluginInspectInfo = PluginInfo;
|
1481 |
|
1482 | interface PluginSettings {
|
1483 | Mounts: PluginMount[];
|
1484 | Env: string[];
|
1485 | Args: string[];
|
1486 | Devices: PluginDevice[];
|
1487 | }
|
1488 |
|
1489 | interface PluginConfig {
|
1490 | Description: string;
|
1491 | Documentation: string;
|
1492 | Interface: any;
|
1493 | Entrypoint: string[];
|
1494 | WorkDir: string;
|
1495 | User?: User;
|
1496 | Network: Network;
|
1497 | Linux: Linux;
|
1498 | PropagatedMount: string;
|
1499 | Mounts: PluginMount[];
|
1500 | Env: PluginEnv[];
|
1501 | Args: Args;
|
1502 | rootfs: any;
|
1503 | }
|
1504 |
|
1505 | interface Interface {
|
1506 | Types: PluginInterfaceType[];
|
1507 | Socket: string;
|
1508 | }
|
1509 |
|
1510 | interface PluginInterfaceType {
|
1511 | Prefix: string;
|
1512 | Capability: string;
|
1513 | Version: string;
|
1514 | }
|
1515 |
|
1516 | interface PluginMount {
|
1517 | Name: string;
|
1518 | Description: string;
|
1519 | Settable: string[];
|
1520 | Source: string;
|
1521 | Destination: string;
|
1522 | Type: string;
|
1523 | Options: string[];
|
1524 | }
|
1525 |
|
1526 | interface Linux {
|
1527 | Capabilities: string[];
|
1528 | AllowAllDevices: boolean;
|
1529 | Devices: PluginDevice[];
|
1530 | }
|
1531 |
|
1532 | interface PluginDevice {
|
1533 | Name: string;
|
1534 | Description: string;
|
1535 | Settable: string[];
|
1536 | Path: string;
|
1537 | }
|
1538 |
|
1539 | interface Network {
|
1540 | Type: string;
|
1541 | }
|
1542 |
|
1543 | interface PluginEnv {
|
1544 | Name: string;
|
1545 | Description: string;
|
1546 | Settable: string[];
|
1547 | Value: string;
|
1548 | }
|
1549 |
|
1550 | interface Args {
|
1551 | Name: string;
|
1552 | Description: string;
|
1553 | Settable: string[];
|
1554 | Value: string;
|
1555 | }
|
1556 |
|
1557 | interface User {
|
1558 | UID: number;
|
1559 | GID: number;
|
1560 | }
|
1561 |
|
1562 | interface ImageRemoveInfo {
|
1563 | Untagged: string;
|
1564 | Deleted: string;
|
1565 | }
|
1566 |
|
1567 | interface PruneImagesInfo {
|
1568 | ImagesDeleted: ImageRemoveInfo[];
|
1569 | SpaceReclaimed: number;
|
1570 | }
|
1571 |
|
1572 | interface PruneVolumesInfo {
|
1573 | VolumesDeleted: string[];
|
1574 | SpaceReclaimed: number;
|
1575 | }
|
1576 |
|
1577 | interface PruneContainersInfo {
|
1578 | ContainersDeleted: string[];
|
1579 | SpaceReclaimed: number;
|
1580 | }
|
1581 |
|
1582 | interface PruneNetworksInfo {
|
1583 | NetworksDeleted: string[];
|
1584 | }
|
1585 |
|
1586 | interface ContainerWaitOptions {
|
1587 |
|
1588 | condition?: 'not-running' | 'next-exit' | 'removed';
|
1589 | }
|
1590 |
|
1591 | interface ContainerLogsOptions {
|
1592 | stdout?: boolean;
|
1593 | stderr?: boolean;
|
1594 | follow?: boolean;
|
1595 | since?: number;
|
1596 | details?: boolean;
|
1597 | tail?: number;
|
1598 | timestamps?: boolean;
|
1599 | }
|
1600 |
|
1601 | interface ImageBuildContext {
|
1602 | context: string;
|
1603 | src: string[];
|
1604 | }
|
1605 |
|
1606 | interface DockerVersion {
|
1607 | ApiVersion: string;
|
1608 | Arch: string;
|
1609 | BuildTime: Date;
|
1610 | Components: Array<{
|
1611 | Details: {
|
1612 | ApiVersion: string;
|
1613 | Arch: string;
|
1614 | BuildTime: Date;
|
1615 | Experimental: string;
|
1616 | GitCommit: string;
|
1617 | GoVersion: string;
|
1618 | KernelVersion: string;
|
1619 | Os: string;
|
1620 | };
|
1621 | Name: string;
|
1622 | Version: string;
|
1623 | }>;
|
1624 | GitCommit: string;
|
1625 | GoVersion: string;
|
1626 | KernelVersion: string;
|
1627 | MinAPIVersion: string;
|
1628 | Os: string;
|
1629 | Platform: {
|
1630 | Name: string;
|
1631 | };
|
1632 | Version: string;
|
1633 | }
|
1634 | }
|
1635 |
|
1636 | type Callback<T> = (error?: any, result?: T) => void;
|
1637 |
|
1638 | declare class Dockerode {
|
1639 | constructor(options?: Dockerode.DockerOptions);
|
1640 |
|
1641 | createContainer(options: Dockerode.ContainerCreateOptions, callback: Callback<Dockerode.Container>): void;
|
1642 | createContainer(options: Dockerode.ContainerCreateOptions): Promise<Dockerode.Container>;
|
1643 |
|
1644 | createImage(options: {}, callback: Callback<NodeJS.ReadableStream>): void;
|
1645 | createImage(auth: any, options: {}, callback: Callback<NodeJS.ReadableStream>): void;
|
1646 | createImage(options: {}): Promise<NodeJS.ReadableStream>;
|
1647 | createImage(auth: any, options: {}): Promise<NodeJS.ReadableStream>;
|
1648 |
|
1649 | loadImage(file: string | NodeJS.ReadableStream, options: {}, callback: Callback<NodeJS.ReadableStream>): void;
|
1650 | loadImage(file: string | NodeJS.ReadableStream, callback: Callback<NodeJS.ReadableStream>): void;
|
1651 | loadImage(file: string | NodeJS.ReadableStream, options?: {}): Promise<NodeJS.ReadableStream>;
|
1652 |
|
1653 | importImage(file: string | NodeJS.ReadableStream, options: {}, callback: Callback<NodeJS.ReadableStream>): void;
|
1654 | importImage(file: string | NodeJS.ReadableStream, callback: Callback<NodeJS.ReadableStream>): void;
|
1655 | importImage(file: string | NodeJS.ReadableStream, options?: {}): Promise<NodeJS.ReadableStream>;
|
1656 |
|
1657 | checkAuth(options: any, callback: Callback<any>): void;
|
1658 | checkAuth(options: any): Promise<any>;
|
1659 |
|
1660 | buildImage(
|
1661 | file: string | NodeJS.ReadableStream | Dockerode.ImageBuildContext,
|
1662 | options: Dockerode.ImageBuildOptions,
|
1663 | callback: Callback<NodeJS.ReadableStream>,
|
1664 | ): void;
|
1665 | buildImage(
|
1666 | file: string | NodeJS.ReadableStream | Dockerode.ImageBuildContext,
|
1667 | callback: Callback<NodeJS.ReadableStream>,
|
1668 | ): void;
|
1669 | buildImage(
|
1670 | file: string | NodeJS.ReadableStream | Dockerode.ImageBuildContext,
|
1671 | options?: Dockerode.ImageBuildOptions,
|
1672 | ): Promise<NodeJS.ReadableStream>;
|
1673 |
|
1674 | getContainer(id: string): Dockerode.Container;
|
1675 |
|
1676 | getImage(name: string): Dockerode.Image;
|
1677 |
|
1678 | getVolume(name: string): Dockerode.Volume;
|
1679 |
|
1680 | getPlugin(name: string, remote: any): Dockerode.Plugin;
|
1681 |
|
1682 | getService(id: string): Dockerode.Service;
|
1683 |
|
1684 | getTask(id: string): Dockerode.Task;
|
1685 |
|
1686 | getNode(id: string): Dockerode.Node;
|
1687 |
|
1688 | getNetwork(id: string): Dockerode.Network;
|
1689 |
|
1690 | getSecret(id: string): Dockerode.Secret;
|
1691 |
|
1692 | getExec(id: string): Dockerode.Exec;
|
1693 |
|
1694 | getConfig(id: string): Dockerode.Config;
|
1695 |
|
1696 | listContainers(options: {}, callback: Callback<Dockerode.ContainerInfo[]>): void;
|
1697 | listContainers(callback: Callback<Dockerode.ContainerInfo[]>): void;
|
1698 | listContainers(options?: {}): Promise<Dockerode.ContainerInfo[]>;
|
1699 |
|
1700 | listImages(options: {}, callback: Callback<Dockerode.ImageInfo[]>): void;
|
1701 | listImages(callback: Callback<Dockerode.ImageInfo[]>): void;
|
1702 | listImages(options?: {}): Promise<Dockerode.ImageInfo[]>;
|
1703 |
|
1704 | listServices(options: Dockerode.ServiceListOptions, callback: Callback<Dockerode.Service[]>): void;
|
1705 | listServices(callback: Callback<Dockerode.Service[]>): void;
|
1706 | listServices(options?: Dockerode.ServiceListOptions): Promise<Dockerode.Service[]>;
|
1707 |
|
1708 | listNodes(options: {}, callback: Callback<any[]>): void;
|
1709 | listNodes(callback: Callback<any[]>): void;
|
1710 | listNodes(options?: {}): Promise<any[]>;
|
1711 |
|
1712 | listTasks(options: {}, callback: Callback<any[]>): void;
|
1713 | listTasks(callback: Callback<any[]>): void;
|
1714 | listTasks(options?: {}): Promise<any[]>;
|
1715 |
|
1716 | listSecrets(options: {}, callback: Callback<Dockerode.Secret[]>): void;
|
1717 | listSecrets(callback: Callback<Dockerode.Secret[]>): void;
|
1718 | listSecrets(options?: {}): Promise<Dockerode.Secret[]>;
|
1719 |
|
1720 | listPlugins(options: {}, callback: Callback<Dockerode.PluginInfo[]>): void;
|
1721 | listPlugins(callback: Callback<Dockerode.PluginInfo[]>): void;
|
1722 | listPlugins(options?: {}): Promise<Dockerode.PluginInfo[]>;
|
1723 |
|
1724 | listVolumes(
|
1725 | options: {},
|
1726 | callback: Callback<{
|
1727 | Volumes: Dockerode.VolumeInspectInfo[];
|
1728 | Warnings: string[];
|
1729 | }>,
|
1730 | ): void;
|
1731 | listVolumes(
|
1732 | callback: Callback<{
|
1733 | Volumes: Dockerode.VolumeInspectInfo[];
|
1734 | Warnings: string[];
|
1735 | }>,
|
1736 | ): void;
|
1737 | listVolumes(options?: {}): Promise<{
|
1738 | Volumes: Dockerode.VolumeInspectInfo[];
|
1739 | Warnings: string[];
|
1740 | }>;
|
1741 |
|
1742 | listNetworks(options: {}, callback: Callback<Dockerode.NetworkInspectInfo[]>): void;
|
1743 | listNetworks(callback: Callback<Dockerode.NetworkInspectInfo[]>): void;
|
1744 | listNetworks(options?: {}): Promise<Dockerode.NetworkInspectInfo[]>;
|
1745 |
|
1746 | listConfigs(options: {}, callback: Callback<Dockerode.ConfigInfo[]>): void;
|
1747 | listConfigs(callback: Callback<Dockerode.ConfigInfo[]>): void;
|
1748 | listConfigs(options?: {}): Promise<Dockerode.ConfigInfo[]>;
|
1749 |
|
1750 | createSecret(options: {}, callback: Callback<any>): void;
|
1751 | createSecret(options: {}): Promise<any>;
|
1752 |
|
1753 | createConfig(options: {}, callback: Callback<any>): void;
|
1754 | createConfig(options: {}): Promise<any>;
|
1755 |
|
1756 | createPlugin(options: {}, callback: Callback<any>): void;
|
1757 | createPlugin(options: {}): Promise<any>;
|
1758 |
|
1759 | createVolume(options: {}, callback: Callback<any>): void;
|
1760 | createVolume(options: {}): Promise<any>;
|
1761 |
|
1762 | createService(options: Dockerode.CreateServiceOptions, callback: Callback<Dockerode.ServiceCreateResponse>): void;
|
1763 | createService(options: Dockerode.CreateServiceOptions): Promise<Dockerode.ServiceCreateResponse>;
|
1764 | createService(auth: Dockerode.AuthConfig, options: Dockerode.ServiceSpec): Promise<Dockerode.ServiceCreateResponse>;
|
1765 |
|
1766 | createNetwork(options: Dockerode.NetworkCreateOptions, callback: Callback<Dockerode.Network>): void;
|
1767 | createNetwork(options: Dockerode.NetworkCreateOptions): Promise<Dockerode.Network>;
|
1768 |
|
1769 | searchImages(options: {}, callback: Callback<any>): void;
|
1770 | searchImages(options: {}): Promise<any>;
|
1771 |
|
1772 | pruneImages(options: {}, callback: Callback<Dockerode.PruneImagesInfo>): void;
|
1773 | pruneImages(callback: Callback<Dockerode.PruneImagesInfo>): void;
|
1774 | pruneImages(options?: {}): Promise<Dockerode.PruneImagesInfo>;
|
1775 |
|
1776 | pruneContainers(options: {}, callback: Callback<Dockerode.PruneContainersInfo>): void;
|
1777 | pruneContainers(callback: Callback<Dockerode.PruneContainersInfo>): void;
|
1778 | pruneContainers(options?: {}): Promise<Dockerode.PruneContainersInfo>;
|
1779 |
|
1780 | pruneVolumes(options: {}, callback: Callback<Dockerode.PruneVolumesInfo>): void;
|
1781 | pruneVolumes(callback: Callback<Dockerode.PruneVolumesInfo>): void;
|
1782 | pruneVolumes(options?: {}): Promise<Dockerode.PruneVolumesInfo>;
|
1783 |
|
1784 | pruneNetworks(options: {}, callback: Callback<Dockerode.PruneNetworksInfo>): void;
|
1785 | pruneNetworks(callback: Callback<Dockerode.PruneNetworksInfo>): void;
|
1786 | pruneNetworks(options?: {}): Promise<Dockerode.PruneNetworksInfo>;
|
1787 |
|
1788 | info(callback: Callback<any>): void;
|
1789 | info(): Promise<any>;
|
1790 |
|
1791 | df(callback: Callback<any>): void;
|
1792 | df(): Promise<any>;
|
1793 |
|
1794 | version(callback: Callback<Dockerode.DockerVersion>): void;
|
1795 | version(): Promise<Dockerode.DockerVersion>;
|
1796 |
|
1797 | ping(callback: Callback<any>): void;
|
1798 | ping(): Promise<any>;
|
1799 |
|
1800 | getEvents(options: Dockerode.GetEventsOptions, callback: Callback<NodeJS.ReadableStream>): void;
|
1801 | getEvents(callback: Callback<NodeJS.ReadableStream>): void;
|
1802 | getEvents(options?: Dockerode.GetEventsOptions): Promise<NodeJS.ReadableStream>;
|
1803 |
|
1804 | pull(repoTag: string, options: {}, callback: Callback<any>, auth?: {}): Dockerode.Image;
|
1805 | pull(repoTag: string, options?: {}): Promise<any>;
|
1806 |
|
1807 | run(
|
1808 | image: string,
|
1809 | cmd: string[],
|
1810 | outputStream: NodeJS.WritableStream | NodeJS.WritableStream[],
|
1811 | createOptions: {},
|
1812 | startOptions: {},
|
1813 | callback: Callback<any>,
|
1814 | ): events.EventEmitter;
|
1815 | run(
|
1816 | image: string,
|
1817 | cmd: string[],
|
1818 | outputStream: NodeJS.WritableStream | NodeJS.WritableStream[],
|
1819 | startOptions: {},
|
1820 | callback: Callback<any>,
|
1821 | ): events.EventEmitter;
|
1822 | run(
|
1823 | image: string,
|
1824 | cmd: string[],
|
1825 | outputStream: NodeJS.WritableStream | NodeJS.WritableStream[],
|
1826 | callback: Callback<any>,
|
1827 | ): events.EventEmitter;
|
1828 | run(
|
1829 | image: string,
|
1830 | cmd: string[],
|
1831 | outputStream: NodeJS.WritableStream | NodeJS.WritableStream[],
|
1832 | createOptions: {},
|
1833 | callback: Callback<any>,
|
1834 | ): events.EventEmitter;
|
1835 | run(
|
1836 | image: string,
|
1837 | cmd: string[],
|
1838 | outputStream: NodeJS.WritableStream | NodeJS.WritableStream[],
|
1839 | createOptions?: {},
|
1840 | startOptions?: {},
|
1841 | ): Promise<any>;
|
1842 |
|
1843 | swarmInit(options: {}, callback: Callback<any>): void;
|
1844 | swarmInit(options: {}): Promise<any>;
|
1845 |
|
1846 | swarmJoin(options: {}, callback: Callback<any>): void;
|
1847 | swarmJoin(options: {}): Promise<any>;
|
1848 |
|
1849 | swarmLeave(options: {}, callback: Callback<any>): void;
|
1850 | swarmLeave(options: {}): Promise<any>;
|
1851 |
|
1852 | swarmUpdate(options: {}, callback: Callback<any>): void;
|
1853 | swarmUpdate(options: {}): Promise<any>;
|
1854 |
|
1855 | swarmInspect(callback: Callback<any>): void;
|
1856 | swarmInspect(): Promise<any>;
|
1857 |
|
1858 | modem: any;
|
1859 | }
|
1860 |
|
1861 | export = Dockerode;
|