the-moby-effect
Version:
Moby/Docker API client built using effect-ts
484 lines (483 loc) • 19.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ContainerCreateRequest = void 0;
var Schema = _interopRequireWildcard(require("effect/Schema"));
var MobySchemas = _interopRequireWildcard(require("../schemas/index.js"));
var ContainerDeviceMapping = _interopRequireWildcard(require("./ContainerDeviceMapping.generated.js"));
var ContainerDeviceRequest = _interopRequireWildcard(require("./ContainerDeviceRequest.generated.js"));
var ContainerHealthConfig = _interopRequireWildcard(require("./ContainerHealthConfig.generated.js"));
var ContainerLogConfig = _interopRequireWildcard(require("./ContainerLogConfig.generated.js"));
var ContainerRestartPolicy = _interopRequireWildcard(require("./ContainerRestartPolicy.generated.js"));
var ContainerUlimit = _interopRequireWildcard(require("./ContainerUlimit.generated.js"));
var Mount = _interopRequireWildcard(require("./Mount.generated.js"));
var NetworkNetworkingConfig = _interopRequireWildcard(require("./NetworkNetworkingConfig.generated.js"));
var ThrottleDevice = _interopRequireWildcard(require("./ThrottleDevice.generated.js"));
var WeightDevice = _interopRequireWildcard(require("./WeightDevice.generated.js"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
class ContainerCreateRequest extends /*#__PURE__*/Schema.Class("ContainerCreateRequest")({
/** Hostname */
Hostname: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** Domainname */
Domainname: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/**
* User that will run the command(s) inside the container, also support
* user:group
*/
User: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** Attach the standard input, makes possible user interaction */
AttachStdin: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/** Attach the standard output */
AttachStdout: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/** Attach the standard error */
AttachStderr: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/** List of exposed ports */
ExposedPorts: /*#__PURE__*/Schema.optionalWith(MobySchemas.PortSchemas.PortSet, {
nullable: true
}),
/**
* Attach standard streams to a tty, including stdin if it is not
* closed.
*/
Tty: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/** Open stdin */
OpenStdin: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/** If true, close stdin after the 1 attached client disconnects. */
StdinOnce: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/** List of environment variable to set in the container */
Env: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** Command to run when starting the container */
Cmd: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** Healthcheck describes how to check the container is healthy */
Healthcheck: /*#__PURE__*/Schema.optionalWith(ContainerHealthConfig.ContainerHealthConfig, {
nullable: true
}),
/**
* True if command is already escaped (meaning treat as a command line)
* (Windows specific).
*/
ArgsEscaped: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/**
* Name of the image as it was passed by the operator (e.g. could be
* symbolic)
*/
Image: Schema.String,
/** List of volumes (mounts) used for the container */
Volumes: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.Object
}), {
nullable: true
}),
/** Current directory (PWD) in the command will be launched */
WorkingDir: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** Entrypoint to run when starting the container */
Entrypoint: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** Is network disabled */
NetworkDisabled: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/**
* Mac Address of the container. Deprecated: this field is deprecated
* since API v1.44. Use EndpointSettings.MacAddress instead.
*/
MacAddress: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** ONBUILD metadata that were defined on the image Dockerfile */
OnBuild: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** List of labels set to this container */
Labels: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.String
}), {
nullable: true
}),
/** Signal to stop a container */
StopSignal: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** Timeout (in seconds) to stop a container */
StopTimeout: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** Shell for shell-form of RUN, CMD, ENTRYPOINT */
Shell: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
HostConfig: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Struct({
// Applicable to all platforms
/** List of volume bindings for this container */
Binds: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** File (path) where the containerId is written */
ContainerIDFile: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** Configuration of the logs for this container */
LogConfig: /*#__PURE__*/Schema.optionalWith(ContainerLogConfig.ContainerLogConfig, {
nullable: true
}),
/** Network mode to use for the container */
NetworkMode: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Literal("default", "none", "host", "bridge", "nat"), {
nullable: true
}),
/**
* Port mapping between the exposed port (container) and the
* host
*/
PortBindings: /*#__PURE__*/Schema.optionalWith(MobySchemas.PortSchemas.PortMap, {
nullable: true
}),
/** Restart policy to be used for the container */
RestartPolicy: /*#__PURE__*/Schema.optionalWith(ContainerRestartPolicy.ContainerRestartPolicy, {
nullable: true
}),
/** Automatically remove container when it exits */
AutoRemove: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/** Name of the volume driver used to mount volumes */
VolumeDriver: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** List of volumes to take from other container */
VolumesFrom: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** Initial console size (height,width) */
ConsoleSize: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(MobySchemas.UInt64).pipe(/*#__PURE__*/Schema.itemsCount(2)), {
nullable: true
}),
/**
* Arbitrary non-identifying metadata attached to container and
* provided to the runtime
*/
Annotations: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.String
}), {
nullable: true
}),
// Applicable to UNIX platforms
/** List of kernel capabilities to add to the container */
CapAdd: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** List of kernel capabilities to remove from the container */
CapDrop: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** Cgroup namespace mode to use for the container */
CgroupnsMode: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Literal("", "private", "host"), {
nullable: true
}),
/** List of DNS servers for the container to use */
Dns: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** List of DNS search domains */
DnsOptions: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** List of DNS search domains */
DnsSearch: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** List of extra hosts */
ExtraHosts: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/**
* List of additional groups that the container process will run
* as
*/
GroupAdd: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** IPC namespace to use for the container */
IpcMode: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Literal("none", "host", "container", "private", "shareable"), {
nullable: true
}),
/** Cgroup to use for the container */
Cgroup: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** List of links (in the name:alias form) */
Links: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** Container preference for OOM-killing */
OomScoreAdj: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** PID namespace to use for the container */
PidMode: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** Is the container in privileged mode */
Privileged: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/** Should docker publish all exposed port for the container */
PublishAllPorts: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/** Is the container root filesystem in read-only */
ReadonlyRootfs: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/**
* List of string values to customize labels for MLS systems,
* such as SELinux.
*/
SecurityOpt: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** Storage driver options per container. */
StorageOpt: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.String
}), {
nullable: true
}),
/** List of tmpfs (mounts) used for the container */
Tmpfs: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.String
}), {
nullable: true
}),
/** UTS namespace to use for the container */
UTSMode: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** The user namespace to use for the container */
UsernsMode: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** Total shm memory usage */
ShmSize: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** List of Namespaced sysctls used for the container */
Sysctls: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.String
}), {
nullable: true
}),
/** Runtime to use with this container */
Runtime: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
// Applicable to Windows
/** Isolation technology of the container (e.g. default, hyperv) */
Isolation: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Literal("default", "process", "hyperv", ""), {
nullable: true
}),
// Contains container's resources (cgroups, ulimits)
// Applicable to all platforms
/** CPU shares (relative weight vs. other containers) */
CpuShares: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** Memory limit (in bytes) */
Memory: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** CPU quota */
NanoCpus: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
// Applicable to UNIX platforms
/** Parent cgroup. */
CgroupParent: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** Block IO weight (relative weight vs. other containers) */
BlkioWeight: /*#__PURE__*/Schema.optionalWith(MobySchemas.UInt16, {
nullable: true
}),
BlkioWeightDevice: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(WeightDevice.WeightDevice)), {
nullable: true
}),
BlkioDeviceReadBps: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(ThrottleDevice.ThrottleDevice)), {
nullable: true
}),
BlkioDeviceWriteBps: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(ThrottleDevice.ThrottleDevice)), {
nullable: true
}),
BlkioDeviceReadIOps: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(ThrottleDevice.ThrottleDevice)), {
nullable: true
}),
BlkioDeviceWriteIOps: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(ThrottleDevice.ThrottleDevice)), {
nullable: true
}),
/** CPU CFS (Completely Fair Scheduler) period */
CpuPeriod: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** CPU CFS (Completely Fair Scheduler) quota */
CpuQuota: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** CPU real-time period */
CpuRealtimePeriod: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** CPU real-time runtime */
CpuRealtimeRuntime: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** CpusetCpus 0-2, 0,1 */
CpusetCpus: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** CpusetMems 0-2, 0,1 */
CpusetMems: /*#__PURE__*/Schema.optionalWith(Schema.String, {
nullable: true
}),
/** List of devices to map inside the container */
Devices: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(ContainerDeviceMapping.ContainerDeviceMapping)), {
nullable: true
}),
/** List of rule to be added to the device cgroup */
DeviceCgroupRules: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/** List of device requests for device drivers */
DeviceRequests: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(ContainerDeviceRequest.ContainerDeviceRequest)), {
nullable: true
}),
/**
* KernelMemory specifies the kernel memory limit (in bytes) for
* the container. Deprecated: kernel 5.4 deprecated
* kmem.limit_in_bytes.
*/
KernelMemory: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** Hard limit for kernel TCP buffer memory (in bytes) */
KernelMemoryTCP: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** Memory soft limit (in bytes) */
MemoryReservation: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/**
* Total memory usage (memory + swap); set `-1` to enable
* unlimited swap
*/
MemorySwap: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** Tuning container memory swappiness behaviour */
MemorySwappiness: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** Whether to disable OOM Killer or not */
OomKillDisable: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
}),
/**
* Setting PIDs limit for a container; Set `0` or `-1` for
* unlimited, or `null` to not change.
*/
PidsLimit: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** List of ulimits to be set in the container */
Ulimits: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(ContainerUlimit.ContainerUlimit)), {
nullable: true
}),
// Applicable to Windows
/** Cpu count */
CpuCount: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** CPU percent */
CpuPercent: /*#__PURE__*/Schema.optionalWith(MobySchemas.Int64, {
nullable: true
}),
/** Maximum IOps for the container system drive */
IOMaximumIOps: /*#__PURE__*/Schema.optionalWith(MobySchemas.UInt64, {
nullable: true
}),
/** Maximum IO in bytes per second for the container system drive */
IOMaximumBandwidth: /*#__PURE__*/Schema.optionalWith(MobySchemas.UInt64, {
nullable: true
}),
/** Mounts specs used by the container */
Mounts: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(Mount.Mount)), {
nullable: true
}),
/**
* MaskedPaths is the list of paths to be masked inside the
* container (this overrides the default set of paths)
*/
MaskedPaths: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/**
* ReadonlyPaths is the list of paths to be set as read-only
* inside the container (this overrides the default set of
* paths)
*/
ReadonlyPaths: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(Schema.String), {
nullable: true
}),
/**
* Run a custom init inside the container, if null, use the
* daemon's configured settings
*/
Init: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
})
}), {
nullable: true
}),
NetworkingConfig: /*#__PURE__*/Schema.optionalWith(NetworkNetworkingConfig.NetworkNetworkingConfig, {
nullable: true
})
}, {
identifier: "ContainerCreateRequest",
title: "container.CreateRequest",
documentation: "https://github.com/moby/moby/blob/a21b1a2d12e2c01542cb191eb526d7bfad0641e3/api/types/container/create_request.go#L5-L13"
}) {}
exports.ContainerCreateRequest = ContainerCreateRequest;
//# sourceMappingURL=ContainerCreateRequest.generated.js.map