the-moby-effect 1.43.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/src/agent-helpers.d.ts +59 -0
- package/dist/src/agent-helpers.js +84 -0
- package/dist/src/agent-helpers.js.map +1 -0
- package/dist/src/configs.d.ts +105 -0
- package/dist/src/configs.js +29 -0
- package/dist/src/configs.js.map +1 -0
- package/dist/src/containers.d.ts +611 -0
- package/dist/src/containers.js +82 -0
- package/dist/src/containers.js.map +1 -0
- package/dist/src/custom-helpers.d.ts +23 -0
- package/dist/src/custom-helpers.js +41 -0
- package/dist/src/custom-helpers.js.map +1 -0
- package/dist/src/distribution.d.ts +28 -0
- package/dist/src/distribution.js +21 -0
- package/dist/src/distribution.js.map +1 -0
- package/dist/src/execs.d.ts +69 -0
- package/dist/src/execs.js +26 -0
- package/dist/src/execs.js.map +1 -0
- package/dist/src/images.d.ts +657 -0
- package/dist/src/images.js +61 -0
- package/dist/src/images.js.map +1 -0
- package/dist/src/index.d.ts +38 -0
- package/dist/src/index.js +38 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/networks.d.ts +151 -0
- package/dist/src/networks.js +40 -0
- package/dist/src/networks.js.map +1 -0
- package/dist/src/nodes.d.ts +99 -0
- package/dist/src/nodes.js +27 -0
- package/dist/src/nodes.js.map +1 -0
- package/dist/src/plugins.d.ts +253 -0
- package/dist/src/plugins.js +47 -0
- package/dist/src/plugins.js.map +1 -0
- package/dist/src/request-helpers.d.ts +6 -0
- package/dist/src/request-helpers.js +15 -0
- package/dist/src/request-helpers.js.map +1 -0
- package/dist/src/schemas.d.ts +7279 -0
- package/dist/src/schemas.js +3772 -0
- package/dist/src/schemas.js.map +1 -0
- package/dist/src/secrets.d.ts +100 -0
- package/dist/src/secrets.js +29 -0
- package/dist/src/secrets.js.map +1 -0
- package/dist/src/services.d.ts +185 -0
- package/dist/src/services.js +32 -0
- package/dist/src/services.js.map +1 -0
- package/dist/src/session.d.ts +29 -0
- package/dist/src/session.js +20 -0
- package/dist/src/session.js.map +1 -0
- package/dist/src/swarm.d.ts +80 -0
- package/dist/src/swarm.js +39 -0
- package/dist/src/swarm.js.map +1 -0
- package/dist/src/system.d.ts +100 -0
- package/dist/src/system.js +40 -0
- package/dist/src/system.js.map +1 -0
- package/dist/src/tasks.d.ts +102 -0
- package/dist/src/tasks.js +26 -0
- package/dist/src/tasks.js.map +1 -0
- package/dist/src/volumes.d.ts +143 -0
- package/dist/src/volumes.js +29 -0
- package/dist/src/volumes.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
import * as NodeSocket from "@effect/experimental/Socket/Node";
|
|
2
|
+
import * as Schema from "@effect/schema/Schema";
|
|
3
|
+
import { Context, Effect, Layer, Scope, Stream } from "effect";
|
|
4
|
+
import { IMobyConnectionAgent, MobyConnectionOptions } from "./agent-helpers.js";
|
|
5
|
+
import { ContainerCreateResponse, ContainerCreateSpec, ContainerInspectResponse, ContainerPruneResponse, ContainerState_Status, ContainerSummary, ContainerUpdateResponse, ContainerUpdateSpec, ContainerWaitResponse, FilesystemChange, Health_Status, HostConfig_1_Isolation } from "./schemas.js";
|
|
6
|
+
declare const ContainersError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
7
|
+
readonly _tag: "ContainersError";
|
|
8
|
+
} & Readonly<A>;
|
|
9
|
+
export declare class ContainersError extends ContainersError_base<{
|
|
10
|
+
method: string;
|
|
11
|
+
message: string;
|
|
12
|
+
}> {
|
|
13
|
+
}
|
|
14
|
+
export interface ContainerListOptions {
|
|
15
|
+
/** Return all containers. By default, only running containers are shown. */
|
|
16
|
+
readonly all?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Return this number of most recently created containers, including
|
|
19
|
+
* non-running ones.
|
|
20
|
+
*/
|
|
21
|
+
readonly limit?: number;
|
|
22
|
+
/** Return the size of container as fields `SizeRw` and `SizeRootFs`. */
|
|
23
|
+
readonly size?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Filters to process on the container list, encoded as JSON (a
|
|
26
|
+
* `map[string][]string`). For example, `{"status": ["paused"]}` will only
|
|
27
|
+
* return paused containers.
|
|
28
|
+
*
|
|
29
|
+
* Available filters:
|
|
30
|
+
*
|
|
31
|
+
* - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`)
|
|
32
|
+
* - `before`=(`<container id>` or `<container name>`)
|
|
33
|
+
* - `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`)
|
|
34
|
+
* - `exited=<int>` containers with exit code of `<int>`
|
|
35
|
+
* - `health`=(`starting`|`healthy`|`unhealthy`|`none`)
|
|
36
|
+
* - `id=<ID>` a container's ID
|
|
37
|
+
* - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)
|
|
38
|
+
* - `is-task=`(`true`|`false`)
|
|
39
|
+
* - `label=key` or `label="key=value"` of a container label
|
|
40
|
+
* - `name=<name>` a container's name
|
|
41
|
+
* - `network`=(`<network id>` or `<network name>`)
|
|
42
|
+
* - `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`)
|
|
43
|
+
* - `since`=(`<container id>` or `<container name>`)
|
|
44
|
+
* - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)
|
|
45
|
+
* - `volume`=(`<volume name>` or `<mount point destination>`)
|
|
46
|
+
*/
|
|
47
|
+
readonly filters?: {
|
|
48
|
+
ancestor?: string[] | undefined;
|
|
49
|
+
before?: string[] | undefined;
|
|
50
|
+
expose?: (`${number}/${string}` | `${number}-${number}/${string}`)[] | undefined;
|
|
51
|
+
exited?: number[] | undefined;
|
|
52
|
+
health?: Health_Status[] | undefined;
|
|
53
|
+
id?: string[] | undefined;
|
|
54
|
+
isolation?: HostConfig_1_Isolation[] | undefined;
|
|
55
|
+
"is-task"?: ["true" | "false"] | undefined;
|
|
56
|
+
label?: string[] | undefined;
|
|
57
|
+
name?: string[] | undefined;
|
|
58
|
+
network?: string[] | undefined;
|
|
59
|
+
publish?: (`${number}/${string}` | `${number}-${number}/${string}`)[] | undefined;
|
|
60
|
+
since?: string[] | undefined;
|
|
61
|
+
status?: ContainerState_Status[] | undefined;
|
|
62
|
+
volume?: string[] | undefined;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface ContainerCreateOptions {
|
|
66
|
+
/**
|
|
67
|
+
* Assign the specified name to the container. Must match
|
|
68
|
+
* `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.
|
|
69
|
+
*/
|
|
70
|
+
readonly name?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Platform in the format `os[/arch[/variant]]` used for image lookup.
|
|
73
|
+
*
|
|
74
|
+
* When specified, the daemon checks if the requested image is present in
|
|
75
|
+
* the local image cache with the given OS and Architecture, and otherwise
|
|
76
|
+
* returns a `404` status.
|
|
77
|
+
*
|
|
78
|
+
* If the option is not set, the host's native OS and Architecture are used
|
|
79
|
+
* to look up the image in the image cache. However, if no platform is
|
|
80
|
+
* passed and the given image does exist in the local image cache, but its
|
|
81
|
+
* OS or architecture does not match, the container is created with the
|
|
82
|
+
* available image, and a warning is added to the `Warnings` field in the
|
|
83
|
+
* response, for example;
|
|
84
|
+
*
|
|
85
|
+
* WARNING: The requested image's platform (linux/arm64/v8) does not match
|
|
86
|
+
* the detected host platform (linux/amd64) and no specific platform was
|
|
87
|
+
* requested
|
|
88
|
+
*/
|
|
89
|
+
readonly platform?: string;
|
|
90
|
+
/** Container to create */
|
|
91
|
+
readonly spec: Schema.Schema.From<typeof ContainerCreateSpec.struct>;
|
|
92
|
+
}
|
|
93
|
+
export interface ContainerInspectOptions {
|
|
94
|
+
/** ID or name of the container */
|
|
95
|
+
readonly id: string;
|
|
96
|
+
/** Return the size of container as fields `SizeRw` and `SizeRootFs` */
|
|
97
|
+
readonly size?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface ContainerTopOptions {
|
|
100
|
+
/** ID or name of the container */
|
|
101
|
+
readonly id: string;
|
|
102
|
+
/** The arguments to pass to `ps`. For example, `aux` */
|
|
103
|
+
readonly ps_args?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface ContainerLogsOptions {
|
|
106
|
+
/** ID or name of the container */
|
|
107
|
+
readonly id: string;
|
|
108
|
+
/** Keep connection after returning logs. */
|
|
109
|
+
readonly follow?: boolean;
|
|
110
|
+
/** Return logs from `stdout` */
|
|
111
|
+
readonly stdout?: boolean;
|
|
112
|
+
/** Return logs from `stderr` */
|
|
113
|
+
readonly stderr?: boolean;
|
|
114
|
+
/** Only return logs since this time, as a UNIX timestamp */
|
|
115
|
+
readonly since?: number;
|
|
116
|
+
/** Only return logs before this time, as a UNIX timestamp */
|
|
117
|
+
readonly until?: number;
|
|
118
|
+
/** Add timestamps to every log line */
|
|
119
|
+
readonly timestamps?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Only return this number of log lines from the end of the logs. Specify as
|
|
122
|
+
* an integer or `all` to output all log lines.
|
|
123
|
+
*/
|
|
124
|
+
readonly tail?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface ContainerChangesOptions {
|
|
127
|
+
/** ID or name of the container */
|
|
128
|
+
readonly id: string;
|
|
129
|
+
}
|
|
130
|
+
export interface ContainerExportOptions {
|
|
131
|
+
/** ID or name of the container */
|
|
132
|
+
readonly id: string;
|
|
133
|
+
}
|
|
134
|
+
export interface ContainerStatsOptions {
|
|
135
|
+
/** ID or name of the container */
|
|
136
|
+
readonly id: string;
|
|
137
|
+
/**
|
|
138
|
+
* Stream the output. If false, the stats will be output once and then it
|
|
139
|
+
* will disconnect.
|
|
140
|
+
*/
|
|
141
|
+
readonly stream?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Only get a single stat instead of waiting for 2 cycles. Must be used with
|
|
144
|
+
* `stream=false`.
|
|
145
|
+
*/
|
|
146
|
+
readonly "one-shot"?: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface ContainerResizeOptions {
|
|
149
|
+
/** ID or name of the container */
|
|
150
|
+
readonly id: string;
|
|
151
|
+
/** Height of the TTY session in characters */
|
|
152
|
+
readonly h?: number;
|
|
153
|
+
/** Width of the TTY session in characters */
|
|
154
|
+
readonly w?: number;
|
|
155
|
+
}
|
|
156
|
+
export interface ContainerStartOptions {
|
|
157
|
+
/** ID or name of the container */
|
|
158
|
+
readonly id: string;
|
|
159
|
+
/**
|
|
160
|
+
* Override the key sequence for detaching a container. Format is a single
|
|
161
|
+
* character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`,
|
|
162
|
+
* `@`, `^`, `[`, `,` or `_`.
|
|
163
|
+
*/
|
|
164
|
+
readonly detachKeys?: string;
|
|
165
|
+
}
|
|
166
|
+
export interface ContainerStopOptions {
|
|
167
|
+
/** ID or name of the container */
|
|
168
|
+
readonly id: string;
|
|
169
|
+
/** Signal to send to the container as an integer or string (e.g. `SIGINT`). */
|
|
170
|
+
readonly signal?: string;
|
|
171
|
+
/** Number of seconds to wait before killing the container */
|
|
172
|
+
readonly t?: number;
|
|
173
|
+
}
|
|
174
|
+
export interface ContainerRestartOptions {
|
|
175
|
+
/** ID or name of the container */
|
|
176
|
+
readonly id: string;
|
|
177
|
+
/** Signal to send to the container as an integer or string (e.g. `SIGINT`). */
|
|
178
|
+
readonly signal?: string;
|
|
179
|
+
/** Number of seconds to wait before killing the container */
|
|
180
|
+
readonly t?: number;
|
|
181
|
+
}
|
|
182
|
+
export interface ContainerKillOptions {
|
|
183
|
+
/** ID or name of the container */
|
|
184
|
+
readonly id: string;
|
|
185
|
+
/** Signal to send to the container as an integer or string (e.g. `SIGINT`). */
|
|
186
|
+
readonly signal?: string;
|
|
187
|
+
}
|
|
188
|
+
export interface ContainerUpdateOptions {
|
|
189
|
+
/** ID or name of the container */
|
|
190
|
+
readonly id: string;
|
|
191
|
+
readonly spec: Schema.Schema.To<typeof ContainerUpdateSpec.struct>;
|
|
192
|
+
}
|
|
193
|
+
export interface ContainerRenameOptions {
|
|
194
|
+
/** ID or name of the container */
|
|
195
|
+
readonly id: string;
|
|
196
|
+
/** New name for the container */
|
|
197
|
+
readonly name: string;
|
|
198
|
+
}
|
|
199
|
+
export interface ContainerPauseOptions {
|
|
200
|
+
/** ID or name of the container */
|
|
201
|
+
readonly id: string;
|
|
202
|
+
}
|
|
203
|
+
export interface ContainerUnpauseOptions {
|
|
204
|
+
/** ID or name of the container */
|
|
205
|
+
readonly id: string;
|
|
206
|
+
}
|
|
207
|
+
export interface ContainerAttachOptions {
|
|
208
|
+
/** ID or name of the container */
|
|
209
|
+
readonly id: string;
|
|
210
|
+
/**
|
|
211
|
+
* Override the key sequence for detaching a container.Format is a single
|
|
212
|
+
* character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`,
|
|
213
|
+
* `@`, `^`, `[`, `,` or `_`.
|
|
214
|
+
*/
|
|
215
|
+
readonly detachKeys?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Replay previous logs from the container.
|
|
218
|
+
*
|
|
219
|
+
* This is useful for attaching to a container that has started and you want
|
|
220
|
+
* to output everything since the container started.
|
|
221
|
+
*
|
|
222
|
+
* If `stream` is also enabled, once all the previous output has been
|
|
223
|
+
* returned, it will seamlessly transition into streaming current output.
|
|
224
|
+
*/
|
|
225
|
+
readonly logs?: boolean;
|
|
226
|
+
/** Stream attached streams from the time the request was made onwards. */
|
|
227
|
+
readonly stream?: boolean;
|
|
228
|
+
/** Attach to `stdin` */
|
|
229
|
+
readonly stdin?: boolean;
|
|
230
|
+
/** Attach to `stdout` */
|
|
231
|
+
readonly stdout?: boolean;
|
|
232
|
+
/** Attach to `stderr` */
|
|
233
|
+
readonly stderr?: boolean;
|
|
234
|
+
}
|
|
235
|
+
export interface ContainerAttachWebsocketOptions {
|
|
236
|
+
/** ID or name of the container */
|
|
237
|
+
readonly id: string;
|
|
238
|
+
/**
|
|
239
|
+
* Override the key sequence for detaching a container.Format is a single
|
|
240
|
+
* character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`,
|
|
241
|
+
* `@`, `^`, `[`, `,`, or `_`.
|
|
242
|
+
*/
|
|
243
|
+
readonly detachKeys?: string;
|
|
244
|
+
/** Return logs */
|
|
245
|
+
readonly logs?: boolean;
|
|
246
|
+
/** Return stream */
|
|
247
|
+
readonly stream?: boolean;
|
|
248
|
+
/** Attach to `stdin` */
|
|
249
|
+
readonly stdin?: boolean;
|
|
250
|
+
/** Attach to `stdout` */
|
|
251
|
+
readonly stdout?: boolean;
|
|
252
|
+
/** Attach to `stderr` */
|
|
253
|
+
readonly stderr?: boolean;
|
|
254
|
+
}
|
|
255
|
+
export interface ContainerWaitOptions {
|
|
256
|
+
/** ID or name of the container */
|
|
257
|
+
readonly id: string;
|
|
258
|
+
/**
|
|
259
|
+
* Wait until a container state reaches the given condition.
|
|
260
|
+
*
|
|
261
|
+
* Defaults to `not-running` if omitted or empty.
|
|
262
|
+
*/
|
|
263
|
+
readonly condition?: string;
|
|
264
|
+
}
|
|
265
|
+
export interface ContainerDeleteOptions {
|
|
266
|
+
/** ID or name of the container */
|
|
267
|
+
readonly id: string;
|
|
268
|
+
/** Remove anonymous volumes associated with the container. */
|
|
269
|
+
readonly v?: boolean;
|
|
270
|
+
/** If the container is running, kill it before removing it. */
|
|
271
|
+
readonly force?: boolean;
|
|
272
|
+
/** Remove the specified link associated with the container. */
|
|
273
|
+
readonly link?: boolean;
|
|
274
|
+
}
|
|
275
|
+
export interface ContainerArchiveOptions {
|
|
276
|
+
/** ID or name of the container */
|
|
277
|
+
readonly id: string;
|
|
278
|
+
/** Resource in the container’s filesystem to archive. */
|
|
279
|
+
readonly path: string;
|
|
280
|
+
}
|
|
281
|
+
export interface ContainerArchiveInfoOptions {
|
|
282
|
+
/** ID or name of the container */
|
|
283
|
+
readonly id: string;
|
|
284
|
+
/** Resource in the container’s filesystem to archive. */
|
|
285
|
+
readonly path: string;
|
|
286
|
+
}
|
|
287
|
+
export interface PutContainerArchiveOptions {
|
|
288
|
+
/** ID or name of the container */
|
|
289
|
+
readonly id: string;
|
|
290
|
+
/**
|
|
291
|
+
* Path to a directory in the container to extract the archive’s contents
|
|
292
|
+
* into.
|
|
293
|
+
*/
|
|
294
|
+
readonly path: string;
|
|
295
|
+
/**
|
|
296
|
+
* If `1`, `true`, or `True` then it will be an error if unpacking the given
|
|
297
|
+
* content would cause an existing directory to be replaced with a
|
|
298
|
+
* non-directory and vice versa.
|
|
299
|
+
*/
|
|
300
|
+
readonly noOverwriteDirNonDir?: string;
|
|
301
|
+
/** If `1`, `true`, then it will copy UID/GID maps to the dest file or dir */
|
|
302
|
+
readonly copyUIDGID?: string;
|
|
303
|
+
/**
|
|
304
|
+
* The input stream must be a tar archive compressed with one of the
|
|
305
|
+
* following algorithms: `identity` (no compression), `gzip`, `bzip2`, or
|
|
306
|
+
* `xz`.
|
|
307
|
+
*/
|
|
308
|
+
readonly stream: Stream.Stream<never, never, Uint8Array>;
|
|
309
|
+
}
|
|
310
|
+
export interface ContainerPruneOptions {
|
|
311
|
+
/**
|
|
312
|
+
* Filters to process on the prune list, encoded as JSON (a
|
|
313
|
+
* `map[string][]string`).
|
|
314
|
+
*
|
|
315
|
+
* Available filters:
|
|
316
|
+
*
|
|
317
|
+
* - `until=<timestamp>` Prune containers created before this timestamp. The
|
|
318
|
+
* `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go
|
|
319
|
+
* duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon
|
|
320
|
+
* machine’s time.
|
|
321
|
+
* - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or
|
|
322
|
+
* `label!=<key>=<value>`) Prune containers with (or without, in case
|
|
323
|
+
* `label!=...` is used) the specified labels.
|
|
324
|
+
*/
|
|
325
|
+
readonly filters?: string;
|
|
326
|
+
}
|
|
327
|
+
export interface Containers {
|
|
328
|
+
/**
|
|
329
|
+
* List containers
|
|
330
|
+
*
|
|
331
|
+
* @param all - Return all containers. By default, only running containers
|
|
332
|
+
* are shown.
|
|
333
|
+
* @param limit - Return this number of most recently created containers,
|
|
334
|
+
* including non-running ones.
|
|
335
|
+
* @param size - Return the size of container as fields `SizeRw` and
|
|
336
|
+
* `SizeRootFs`.
|
|
337
|
+
* @param filters - Filters to process on the container list, encoded as
|
|
338
|
+
* JSON (a `map[string][]string`). For example, `{"status": ["paused"]}`
|
|
339
|
+
* will only return paused containers.
|
|
340
|
+
*
|
|
341
|
+
* Available filters:
|
|
342
|
+
*
|
|
343
|
+
* - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`)
|
|
344
|
+
* - `before`=(`<container id>` or `<container name>`)
|
|
345
|
+
* - `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`)
|
|
346
|
+
* - `exited=<int>` containers with exit code of `<int>`
|
|
347
|
+
* - `health`=(`starting`|`healthy`|`unhealthy`|`none`)
|
|
348
|
+
* - `id=<ID>` a container's ID
|
|
349
|
+
* - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)
|
|
350
|
+
* - `is-task=`(`true`|`false`)
|
|
351
|
+
* - `label=key` or `label="key=value"` of a container label
|
|
352
|
+
* - `name=<name>` a container's name
|
|
353
|
+
* - `network`=(`<network id>` or `<network name>`)
|
|
354
|
+
* - `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`)
|
|
355
|
+
* - `since`=(`<container id>` or `<container name>`)
|
|
356
|
+
* - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)
|
|
357
|
+
* - `volume`=(`<volume name>` or `<mount point destination>`)
|
|
358
|
+
*/
|
|
359
|
+
readonly list: (options?: ContainerListOptions | undefined) => Effect.Effect<never, ContainersError, Readonly<Array<ContainerSummary>>>;
|
|
360
|
+
/**
|
|
361
|
+
* Create a container
|
|
362
|
+
*
|
|
363
|
+
* @param name - Assign the specified name to the container. Must match
|
|
364
|
+
* `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.
|
|
365
|
+
* @param platform - Platform in the format `os[/arch[/variant]]` used for
|
|
366
|
+
* image lookup.
|
|
367
|
+
*
|
|
368
|
+
* When specified, the daemon checks if the requested image is present in
|
|
369
|
+
* the local image cache with the given OS and Architecture, and otherwise
|
|
370
|
+
* returns a `404` status.
|
|
371
|
+
*
|
|
372
|
+
* If the option is not set, the host's native OS and Architecture are used
|
|
373
|
+
* to look up the image in the image cache. However, if no platform is
|
|
374
|
+
* passed and the given image does exist in the local image cache, but its
|
|
375
|
+
* OS or architecture does not match, the container is created with the
|
|
376
|
+
* available image, and a warning is added to the `Warnings` field in the
|
|
377
|
+
* response, for example;
|
|
378
|
+
*
|
|
379
|
+
* WARNING: The requested image's platform (linux/arm64/v8) does not match
|
|
380
|
+
* the detected host platform (linux/amd64) and no specific platform was
|
|
381
|
+
* requested
|
|
382
|
+
* @param spec - Container to create
|
|
383
|
+
*/
|
|
384
|
+
readonly create: (options: ContainerCreateOptions) => Effect.Effect<never, ContainersError, ContainerCreateResponse>;
|
|
385
|
+
/**
|
|
386
|
+
* Inspect a container
|
|
387
|
+
*
|
|
388
|
+
* @param id - ID or name of the container
|
|
389
|
+
* @param size - Return the size of container as fields `SizeRw` and
|
|
390
|
+
* `SizeRootFs`
|
|
391
|
+
*/
|
|
392
|
+
readonly inspect: (options: ContainerInspectOptions) => Effect.Effect<never, ContainersError, ContainerInspectResponse>;
|
|
393
|
+
/**
|
|
394
|
+
* List processes running inside a container
|
|
395
|
+
*
|
|
396
|
+
* @param id - ID or name of the container
|
|
397
|
+
* @param ps_args - The arguments to pass to `ps`. For example, `aux`
|
|
398
|
+
*/
|
|
399
|
+
readonly top: (options: ContainerTopOptions) => Effect.Effect<never, ContainersError, unknown>;
|
|
400
|
+
/**
|
|
401
|
+
* Get container logs
|
|
402
|
+
*
|
|
403
|
+
* @param id - ID or name of the container
|
|
404
|
+
* @param follow - Keep connection after returning logs.
|
|
405
|
+
* @param stdout - Return logs from `stdout`
|
|
406
|
+
* @param stderr - Return logs from `stderr`
|
|
407
|
+
* @param since - Only return logs since this time, as a UNIX timestamp
|
|
408
|
+
* @param until - Only return logs before this time, as a UNIX timestamp
|
|
409
|
+
* @param timestamps - Add timestamps to every log line
|
|
410
|
+
* @param tail - Only return this number of log lines from the end of the
|
|
411
|
+
* logs. Specify as an integer or `all` to output all log lines.
|
|
412
|
+
*/
|
|
413
|
+
readonly logs: (options: ContainerLogsOptions) => Effect.Effect<never, ContainersError, Stream.Stream<never, ContainersError, string>>;
|
|
414
|
+
/**
|
|
415
|
+
* Get changes on a container’s filesystem
|
|
416
|
+
*
|
|
417
|
+
* @param id - ID or name of the container
|
|
418
|
+
*/
|
|
419
|
+
readonly changes: (options: ContainerChangesOptions) => Effect.Effect<never, ContainersError, Readonly<Array<FilesystemChange>>>;
|
|
420
|
+
/**
|
|
421
|
+
* Export a container
|
|
422
|
+
*
|
|
423
|
+
* @param id - ID or name of the container
|
|
424
|
+
*/
|
|
425
|
+
readonly export: (options: ContainerExportOptions) => Effect.Effect<never, ContainersError, Stream.Stream<never, ContainersError, Uint8Array>>;
|
|
426
|
+
/**
|
|
427
|
+
* Get container stats based on resource usage
|
|
428
|
+
*
|
|
429
|
+
* @param id - ID or name of the container
|
|
430
|
+
* @param stream - Stream the output. If false, the stats will be output
|
|
431
|
+
* once and then it will disconnect.
|
|
432
|
+
* @param one-shot - Only get a single stat instead of waiting for 2 cycles.
|
|
433
|
+
* Must be used with `stream=false`.
|
|
434
|
+
*/
|
|
435
|
+
readonly stats: (options: ContainerStatsOptions) => Effect.Effect<never, ContainersError, Stream.Stream<never, ContainersError, string>>;
|
|
436
|
+
/**
|
|
437
|
+
* Resize a container TTY
|
|
438
|
+
*
|
|
439
|
+
* @param id - ID or name of the container
|
|
440
|
+
* @param h - Height of the TTY session in characters
|
|
441
|
+
* @param w - Width of the TTY session in characters
|
|
442
|
+
*/
|
|
443
|
+
readonly resize: (options: ContainerResizeOptions) => Effect.Effect<never, ContainersError, void>;
|
|
444
|
+
/**
|
|
445
|
+
* Start a container
|
|
446
|
+
*
|
|
447
|
+
* @param id - ID or name of the container
|
|
448
|
+
* @param detachKeys - Override the key sequence for detaching a container.
|
|
449
|
+
* Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>`
|
|
450
|
+
* is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
|
|
451
|
+
*/
|
|
452
|
+
readonly start: (options: ContainerStartOptions) => Effect.Effect<never, ContainersError, void>;
|
|
453
|
+
/**
|
|
454
|
+
* Stop a container
|
|
455
|
+
*
|
|
456
|
+
* @param id - ID or name of the container
|
|
457
|
+
* @param signal - Signal to send to the container as an integer or string
|
|
458
|
+
* (e.g. `SIGINT`).
|
|
459
|
+
* @param t - Number of seconds to wait before killing the container
|
|
460
|
+
*/
|
|
461
|
+
readonly stop: (options: ContainerStopOptions) => Effect.Effect<never, ContainersError, void>;
|
|
462
|
+
/**
|
|
463
|
+
* Restart a container
|
|
464
|
+
*
|
|
465
|
+
* @param id - ID or name of the container
|
|
466
|
+
* @param signal - Signal to send to the container as an integer or string
|
|
467
|
+
* (e.g. `SIGINT`).
|
|
468
|
+
* @param t - Number of seconds to wait before killing the container
|
|
469
|
+
*/
|
|
470
|
+
readonly restart: (options: ContainerRestartOptions) => Effect.Effect<never, ContainersError, void>;
|
|
471
|
+
/**
|
|
472
|
+
* Kill a container
|
|
473
|
+
*
|
|
474
|
+
* @param id - ID or name of the container
|
|
475
|
+
* @param signal - Signal to send to the container as an integer or string
|
|
476
|
+
* (e.g. `SIGINT`).
|
|
477
|
+
*/
|
|
478
|
+
readonly kill: (options: ContainerKillOptions) => Effect.Effect<never, ContainersError, void>;
|
|
479
|
+
/**
|
|
480
|
+
* Update a container
|
|
481
|
+
*
|
|
482
|
+
* @param id - ID or name of the container
|
|
483
|
+
* @param spec -
|
|
484
|
+
*/
|
|
485
|
+
readonly update: (options: ContainerUpdateOptions) => Effect.Effect<never, ContainersError, ContainerUpdateResponse>;
|
|
486
|
+
/**
|
|
487
|
+
* Rename a container
|
|
488
|
+
*
|
|
489
|
+
* @param id - ID or name of the container
|
|
490
|
+
* @param name - New name for the container
|
|
491
|
+
*/
|
|
492
|
+
readonly rename: (options: ContainerRenameOptions) => Effect.Effect<never, ContainersError, void>;
|
|
493
|
+
/**
|
|
494
|
+
* Pause a container
|
|
495
|
+
*
|
|
496
|
+
* @param id - ID or name of the container
|
|
497
|
+
*/
|
|
498
|
+
readonly pause: (options: ContainerPauseOptions) => Effect.Effect<never, ContainersError, void>;
|
|
499
|
+
/**
|
|
500
|
+
* Unpause a container
|
|
501
|
+
*
|
|
502
|
+
* @param id - ID or name of the container
|
|
503
|
+
*/
|
|
504
|
+
readonly unpause: (options: ContainerUnpauseOptions) => Effect.Effect<never, ContainersError, void>;
|
|
505
|
+
/**
|
|
506
|
+
* Attach to a container
|
|
507
|
+
*
|
|
508
|
+
* @param id - ID or name of the container
|
|
509
|
+
* @param detachKeys - Override the key sequence for detaching a
|
|
510
|
+
* container.Format is a single character `[a-Z]` or `ctrl-<value>` where
|
|
511
|
+
* `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
|
|
512
|
+
* @param logs - Replay previous logs from the container.
|
|
513
|
+
*
|
|
514
|
+
* This is useful for attaching to a container that has started and you want
|
|
515
|
+
* to output everything since the container started.
|
|
516
|
+
*
|
|
517
|
+
* If `stream` is also enabled, once all the previous output has been
|
|
518
|
+
* returned, it will seamlessly transition into streaming current output.
|
|
519
|
+
* @param stream - Stream attached streams from the time the request was
|
|
520
|
+
* made onwards.
|
|
521
|
+
* @param stdin - Attach to `stdin`
|
|
522
|
+
* @param stdout - Attach to `stdout`
|
|
523
|
+
* @param stderr - Attach to `stderr`
|
|
524
|
+
*/
|
|
525
|
+
readonly attach: (options: ContainerAttachOptions) => Effect.Effect<never, ContainersError, NodeSocket.Socket>;
|
|
526
|
+
/**
|
|
527
|
+
* Attach to a container via a websocket
|
|
528
|
+
*
|
|
529
|
+
* @param id - ID or name of the container
|
|
530
|
+
* @param detachKeys - Override the key sequence for detaching a
|
|
531
|
+
* container.Format is a single character `[a-Z]` or `ctrl-<value>` where
|
|
532
|
+
* `<value>` is one of: `a-z`, `@`, `^`, `[`, `,`, or `_`.
|
|
533
|
+
* @param logs - Return logs
|
|
534
|
+
* @param stream - Return stream
|
|
535
|
+
* @param stdin - Attach to `stdin`
|
|
536
|
+
* @param stdout - Attach to `stdout`
|
|
537
|
+
* @param stderr - Attach to `stderr`
|
|
538
|
+
*/
|
|
539
|
+
readonly attachWebsocket: (options: ContainerAttachWebsocketOptions) => Effect.Effect<never, ContainersError, void>;
|
|
540
|
+
/**
|
|
541
|
+
* Wait for a container
|
|
542
|
+
*
|
|
543
|
+
* @param id - ID or name of the container
|
|
544
|
+
* @param condition - Wait until a container state reaches the given
|
|
545
|
+
* condition.
|
|
546
|
+
*
|
|
547
|
+
* Defaults to `not-running` if omitted or empty.
|
|
548
|
+
*/
|
|
549
|
+
readonly wait: (options: ContainerWaitOptions) => Effect.Effect<never, ContainersError, ContainerWaitResponse>;
|
|
550
|
+
/**
|
|
551
|
+
* Remove a container
|
|
552
|
+
*
|
|
553
|
+
* @param id - ID or name of the container
|
|
554
|
+
* @param v - Remove anonymous volumes associated with the container.
|
|
555
|
+
* @param force - If the container is running, kill it before removing it.
|
|
556
|
+
* @param link - Remove the specified link associated with the container.
|
|
557
|
+
*/
|
|
558
|
+
readonly delete: (options: ContainerDeleteOptions) => Effect.Effect<never, ContainersError, void>;
|
|
559
|
+
/**
|
|
560
|
+
* Get an archive of a filesystem resource in a container
|
|
561
|
+
*
|
|
562
|
+
* @param id - ID or name of the container
|
|
563
|
+
* @param path - Resource in the container’s filesystem to archive.
|
|
564
|
+
*/
|
|
565
|
+
readonly archive: (options: ContainerArchiveOptions) => Effect.Effect<never, ContainersError, Stream.Stream<never, ContainersError, Uint8Array>>;
|
|
566
|
+
/**
|
|
567
|
+
* Get information about files in a container
|
|
568
|
+
*
|
|
569
|
+
* @param id - ID or name of the container
|
|
570
|
+
* @param path - Resource in the container’s filesystem to archive.
|
|
571
|
+
*/
|
|
572
|
+
readonly archiveInfo: (options: ContainerArchiveInfoOptions) => Effect.Effect<never, ContainersError, void>;
|
|
573
|
+
/**
|
|
574
|
+
* Extract an archive of files or folders to a directory in a container
|
|
575
|
+
*
|
|
576
|
+
* @param id - ID or name of the container
|
|
577
|
+
* @param path - Path to a directory in the container to extract the
|
|
578
|
+
* archive’s contents into.
|
|
579
|
+
* @param noOverwriteDirNonDir - If `1`, `true`, or `True` then it will be
|
|
580
|
+
* an error if unpacking the given content would cause an existing
|
|
581
|
+
* directory to be replaced with a non-directory and vice versa.
|
|
582
|
+
* @param copyUIDGID - If `1`, `true`, then it will copy UID/GID maps to the
|
|
583
|
+
* dest file or dir
|
|
584
|
+
* @param stream - The input stream must be a tar archive compressed with
|
|
585
|
+
* one of the following algorithms: `identity` (no compression), `gzip`,
|
|
586
|
+
* `bzip2`, or `xz`.
|
|
587
|
+
*/
|
|
588
|
+
readonly putArchive: (options: PutContainerArchiveOptions) => Effect.Effect<never, ContainersError, void>;
|
|
589
|
+
/**
|
|
590
|
+
* Delete stopped containers
|
|
591
|
+
*
|
|
592
|
+
* @param filters - Filters to process on the prune list, encoded as JSON (a
|
|
593
|
+
* `map[string][]string`).
|
|
594
|
+
*
|
|
595
|
+
* Available filters:
|
|
596
|
+
*
|
|
597
|
+
* - `until=<timestamp>` Prune containers created before this timestamp. The
|
|
598
|
+
* `<timestamp>` can be Unix timestamps, date formatted timestamps, or
|
|
599
|
+
* Go duration strings (e.g. `10m`, `1h30m`) computed relative to the
|
|
600
|
+
* daemon machine’s time.
|
|
601
|
+
* - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or
|
|
602
|
+
* `label!=<key>=<value>`) Prune containers with (or without, in case
|
|
603
|
+
* `label!=...` is used) the specified labels.
|
|
604
|
+
*/
|
|
605
|
+
readonly prune: (options?: ContainerPruneOptions | undefined) => Effect.Effect<never, ContainersError, ContainerPruneResponse>;
|
|
606
|
+
}
|
|
607
|
+
export declare const Containers: Context.Tag<Containers, Containers>;
|
|
608
|
+
export declare const layer: Layer.Layer<IMobyConnectionAgent, never, Containers>;
|
|
609
|
+
export declare const fromAgent: (agent: Effect.Effect<Scope.Scope, never, IMobyConnectionAgent>) => Layer.Layer<never, never, Containers>;
|
|
610
|
+
export declare const fromConnectionOptions: (connectionOptions: MobyConnectionOptions) => Layer.Layer<never, never, Containers>;
|
|
611
|
+
export {};
|