API reference ============= .. Generated by codegen from the OpenAPI spec - do not edit. Generated from the OpenAPI specification (SHA-256 ``0c77136174a4...``). Public names use camelCase; serialized keys keep their wire spelling. Required arguments are positional, optional ones ride in a trailing ``options`` object. Client methods -------------- .. js:method:: ContreeClient.listNetworkPolicies(options?) ``GET /network/policies`` — List network policies Returns policies in your namespace and the shared namespace. Deleted policies are excluded. Reusing or restoring a policy does not change its creation time or listing position. Each entry contains the policy UUID, creation timestamp, accessible tags, and a summary with the number of IP rules. Tags are sorted by name. Your tag takes precedence over a shared tag with the same name; the overridden shared binding is omitted. Use ``GET /network/policies/{uuid}`` to retrieve the full rules. Requires ``spawn`` or ``spawn_disposable`` permission. Search: Supply ``search`` to find active policies in your namespace and the shared namespace that allow the destination. The input determines the search type; currently only IPv4 and IPv6 addresses and CIDRs are supported. Domains and other unsupported inputs return 400. An omitted search parameter lists policies normally; an empty value returns 400. Use ``[tcp://|udp://]address-or-cidr[:port]``. IPv6 addresses and CIDRs must be enclosed in brackets when specifying a port, with the prefix length inside the brackets. Examples: ``192.0.2.1``, ``192.0.2.0/24:443``, ``tcp://192.0.2.0/24:443``, and ``udp://[2001:db8::/64]:53``. This is search syntax, not a URL. CIDRs must use their network address; host bits, scoped IPv6 addresses, and ports outside 1-65535 return 400. A match must allow the requested protocol and port throughout the entire CIDR, not merely overlap it. An IP address is treated as a /32 or /128 CIDR. All-port rules match every requested port. If protocol or port is omitted, any single protocol/port combination covering the entire destination matches. Complementary subnets granting that same access are normalized into a covering rule. Permissions from different policies are never combined for search. Empty policies do not match. Filtering happens before pagination, and results retain the same order, summary, timestamp, and tags as the normal listing. :param options.search: ``string | null`` — IP or CIDR search, optionally qualified by TCP/UDP and a destination port. :param options.limit: ``number | null`` — Maximum number of results to return. Invalid values raise 400 error. :param options.offset: ``number | null`` — Number of results to skip. Invalid values raise 400 error. :returns: ``Promise`` .. js:method:: ContreeClient.createNetworkPolicy(cidrs) ``POST /network/policies`` — Create a network policy Creates a policy with immutable rules in the caller's namespace. Requires ``network_policy`` permission. **Rules** - Each rule allows a CIDR for the selected protocol and ports. An empty or omitted port list allows all ports. - ICMP is allowed to every listed CIDR, regardless of protocol or ports. - An empty rules array (``cidrs: []``) blocks all IP egress, including ICMP and traffic to the host. - ARP is blocked for all policies. **Limits** The same limit of 16384 units applies before and after normalization. Sum the number of ports across all rules, counting an empty or omitted port list (all ports) as 1. The limit covers the entire policy, across all IP versions and protocols. Duplicates count toward the limit before normalization. Exceeding the limit returns 400, even if normalization would remove redundant rules or ports. **Normalization** Before storage, duplicate rules and ports are removed, CIDRs are merged per protocol and port, and rules and ports are sorted. This preserves the allowed traffic. The response contains the normalized rules. **Policy identity** Equivalent normalized policies in the same namespace reuse the same UUID, including concurrent requests. The UUID is UUIDv5 derived from the namespace and the normalized policy hash. Resubmitting a deleted policy restores it without restoring its tags. To change the rules, create a new policy. :param cidrs: ``NetworkPolicyCIDRRule[]`` :returns: ``Promise`` .. js:method:: ContreeClient.getNetworkPolicy(uuid) ``GET /network/policies/{uuid}`` — Get a network policy Returns an accessible policy, including deleted policies. Returns 404 if the policy does not exist. Requires ``spawn`` or ``spawn_disposable`` permission. :param uuid: ``string`` — Network policy UUID Example: ``12345678-9abc-baba-deda-0123456789ab``. :returns: ``Promise`` .. js:method:: ContreeClient.deleteNetworkPolicy(uuid) ``DELETE /network/policies/{uuid}`` — Remove a network policy Removes a policy in your namespace. Requires ``network_policy`` permission. Returns 204 if the policy is removed or was already removed. Returns 404 if the policy does not exist in your namespace. Removes its tags and excludes it from listings. The policy remains accessible and usable by UUID, but cannot be assigned to tags. :param uuid: ``string`` — Network policy UUID Example: ``12345678-9abc-baba-deda-0123456789ab``. :returns: ``Promise`` .. js:method:: ContreeClient.listNetworkPolicyTags(options?) ``GET /network/tags`` — List network policy tags Returns your tags and shared tags, ordered by name. Your tag takes precedence when a shared tag has the same name. Requires ``spawn`` or ``spawn_disposable`` permission. :param options.limit: ``number | null`` — Maximum number of results to return. Invalid values raise 400 error. :param options.offset: ``number | null`` — Number of results to skip. Invalid values raise 400 error. :returns: ``Promise`` .. js:method:: ContreeClient.getNetworkPolicyTag(tag) ``GET /network/tags/{tag}`` — Get a network policy tag Redirects to the policy referenced by your tag, or the shared tag if you have no tag with that name. The redirect response includes the effective tag binding as JSON. Requires ``spawn`` or ``spawn_disposable`` permission. Returns 404 if the tag or its target policy does not exist or is removed. :param tag: ``string`` — Network policy tag name :returns: ``Promise`` .. js:method:: ContreeClient.setNetworkPolicyTag(tag, uuid) ``PUT /network/tags/{tag}`` — Bind a tag to a network policy Creates or replaces your tag's binding to an active policy in your namespace or the shared namespace. Repeating the same binding has no effect. Returns 404 if the target policy does not exist, is inaccessible, or is removed. The tag belongs to your namespace. Requires ``network_policy`` permission. :param tag: ``string`` — Network policy tag name :param uuid: ``string`` :returns: ``Promise`` .. js:method:: ContreeClient.deleteNetworkPolicyTag(tag) ``DELETE /network/tags/{tag}`` — Remove a network policy tag Removes your tag, including when operations use its policy. Repeated deletion succeeds. If a shared tag has the same name, it becomes visible again. Requires ``network_policy`` permission. :param tag: ``string`` — Network policy tag name :returns: ``Promise`` .. js:method:: ContreeClient.listImages(options?) ``GET /images`` — List publicly available images Returns a list of all publicly available container images. :param options.limit: ``number | null`` — Maximum number of images to return. Must be between 1 and 1000. Default is 100. Invalid values raise 400 error. :param options.offset: ``number | null`` — Number of images to skip before starting to collect the result set. Default is 0. Invalid values raise 400 error. :param options.tagged: ``boolean`` — Example: ``1``. :param options.tag: ``string | null`` — A valid image tag prefix to filter images by this prefix. Only images with tags starting with. Implies ``tagged`` parameter. Example: ``ubuntu``. :param options.uuid: ``string | null`` — Filter images by UUID Example: ``12345678-9abc-baba-deda-0123456789ab``. :param options.since: ``string | number | Date | null`` — **Show only results created after the given date/time or interval.** Accepts a Unix timestamp or interval string. Interval format: ``600s``/``15m``/``2h``/``3d``/``1w`` means 600 seconds, 15 minutes, 2 hours, 3 day, or 1 week ago respectively). For example: * ``2025-01-01T12:00:00+00:00`` means January 1st, 2025 at 12:00 UTC * ``600s`` means 600 seconds ago * ``15m`` means 15 minutes ago Invalid values raise 400 error. Example: ``1w``. :param options.until: ``string | number | Date | null`` — **Show only results created before the given date/time or interval.** Accepts a Unix timestamp or interval string. Interval format: ``600s``/``15m``/``2h``/``3d``/``1w`` means 600 seconds, 15 minutes, 2 hours, 3 day, or 1 week ago respectively). For example: * ``2025-01-01T12:00:00+00:00`` means January 1st, 2025 at 12:00 UTC * ``600s`` means 600 seconds ago * ``15m`` means 15 minutes ago Invalid values raise 400 error. Example: ``1h``. :returns: ``Promise`` .. js:method:: ContreeClient.deleteImageTag(imageUuid, options?) ``DELETE /images/{imageUUID}/tag`` — Remove tags from an image Removes a tag (or all tags) from an image. When ``tag`` query parameter is provided, only that specific tag is removed. When omitted, all tags are removed from the image. If any public image has the same tag, tag will start tracking that public image again. In all other cases tag will be removed and the image will be accessible only by its UUID. :param imageUuid: ``string`` — The UUID of the image to untag Example: ``12345678-9abc-baba-deda-0123456789ab``. :param options.tag: ``string | null`` — The tag to remove. If omitted, all tags are removed from the image. Example: ``busybox:latest``. :returns: ``Promise`` .. js:method:: ContreeClient.updateImageTag(imageUuid, tag) ``PATCH /images/{imageUUID}/tag`` — Add a tag to an image Adds a tag to an image. Tags are unique per namespace; if the requested tag is already assigned to another image, it will be moved to this image. Assigning a tag that matches a public tag to a public image will freeze that tag to the current image - subsequent public updates to the tag will not affect it. To make the public tag track the latest public image again, remove your tag assignment. When a tag is removed from an image that resides in the public namespace, the API returns HTTP 200 OK. response body contains the tag that now points to the public image (i.e., the image that the tag is automatically re-assigned to). In other words, un-tagging a public image does not delete the tag; it simply moves the tag back to the public image and the caller receives that tag in the successful response. :param imageUuid: ``string`` — The UUID of the image to update Example: ``12345678-9abc-baba-deda-0123456789ab``. :param tag: ``string`` — New tag for the image Example: ``busybox:latest``. :returns: ``Promise`` .. js:method:: ContreeClient.importImage(registry, options?) ``POST /images/import`` — Import a container image from a registry Imports the OCI image filesystem content of from a specified registry. Important limitations and behavior: - Only the image root filesystem (files and directories) is imported. This is like to the output of ``docker export`` and does not preserve layers metadata. - Most image configuration and manifest data are ignored. Metadata such as ``LABEL``, ``ENTRYPOINT``, ``CMD``, ``WORKDIR``, ``EXPOSE`` and other image configuration directives will **NOT be imported or applied**. - ``ENV`` variables defined in the image **are imported** and automatically applied to the instance environment when ``shell`` is set to ``true``. When ``shell`` is ``false``, image environment variables are not inherited and must be passed explicitly via the ``env`` field. - The result is a flat rootfs snapshot with preserved environment variables. - If the specified tag already exists in the public images, the imported image will replace it. To avoid this, you can tag the existing image with a different tag for use it later. You also can use image UUIDs it is not changing for imported and existend image. - In case the remote image is unchanged and already imported, the operation will complete and the same UUID will be returned without re-importing the image. The request creates an import operation which runs asynchronously. :param registry: ``ImageImportRegistry`` :param options.tag: ``string | null | undefined`` — Tag to identify the image when listing publicly available images. If omitted, the image will be private and only accessible by ID. Example: ``busybox:latest``. :param options.timeout: ``number | undefined`` — Maximum time in seconds to wait for the import operation to complete Example: ``300``. :returns: ``Promise`` .. js:method:: ContreeClient.listFiles(options?) ``GET /files`` — List uploaded files for the current namespace Returns a paginated list of uploaded files for the current namespace. :param options.limit: ``number | null`` — Maximum number of files to return :param options.offset: ``number | null`` — Number of files to skip :param options.since: ``string | number | Date | null`` — Filter files created after this time :param options.until: ``string | number | Date | null`` — Filter files created before this time :returns: ``Promise`` .. js:method:: ContreeClient.uploadFile(content) ``POST /files`` — Upload a file to the server. the body must be a file content. Uploads a file to the server. The body must contain the file content. :param content: ``Uint8Array | Blob | ReadableStream`` — Raw file content: bytes or a binary stream. :returns: ``Promise`` .. js:method:: ContreeClient.getFile(sha256) ``GET /files/{sha256}`` — Get file info by SHA256 Returns file info (uuid, sha256, createdAt, updatedAt). :param sha256: ``string`` — SHA256 hash of the file (64 hex characters) :returns: ``Promise`` .. js:method:: ContreeClient.checkFileExists(sha256) ``HEAD /files/{sha256}`` — Check if a file exists for the current namespace Returns 200 if the file is uploaded by the current namespace, otherwise 404. :param sha256: ``string`` — SHA256 hash of the file (64 hex characters) :returns: ``Promise`` .. js:method:: ContreeClient.spawnInstance(command, image, options?) ``POST /instances`` — Spawn a new container instance Creates and runs a new execution instance with the specified configuration. Requires a valid ``Authorization`` header. Common request body rules: * The request body must contain at least ``command`` and ``image`` fields all other fields can be omitted. * If the ``command`` field is a shell expression, you must set ``shell`` field to ``true``. * For specifying the shell binary, you can use ``env`` field to set ``SHELL`` variable. * When ``shell`` is ``true``, environment variables defined in the image (via ``ENV`` directives) are automatically inherited. When ``shell`` is ``false``, image environment variables are not inherited and must be passed explicitly via the ``env`` field. :param command: ``string`` — The command to execute. In case if ``shell`` is set to ``true``, this MUST contain shell expression. For example ``echo hello world`` or ``ls -l /app``. If ``shell`` is set to ``false``, this must be a relative or absolute path to the executable inside the image rootfs. For example: ``/bin/app`` or ``/usr/bin/find``. Do not forget pass necessary ``PATH`` variable to env field, by default ``PATH`` is set to ``/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin``. Example: ``/bin/app``. :param image: ``string`` :param options.disposable: ``boolean | undefined`` — Creates a disposable execution environment no any state will be saved. :param options.hostname: ``string | undefined`` — Hostname to set when execution. Example: ``container-name``. :param options.args: ``string[] | undefined`` — Arguments to pass to the command if shell is set to false. Example: ``["arg1","arg2"]``. :param options.shell: ``boolean | undefined`` — Whether to run the command through a shell. If ``true``, the command must be a shell expression and all values from args will be ignored. If ``false``, the command field must be a path to an executable and args will be used. When ``true``, environment variables from the image are automatically inherited. When ``false``, they are not - use the ``env`` field to pass them explicitly. :param options.env: ``Record | null | undefined`` — Environment variables to set in the container. These are merged with image-defined variables when ``shell`` is ``true``. When ``shell`` is ``false``, only variables specified here are available - image-defined variables are not inherited. Example: ``{"KEY1":"value1","KEY2":"value2"}``. :param options.preserveEnv: ``boolean | undefined`` — Preserve environment variables in resulting image after execution. When ``true``, the image's existing environment variables from ``metadata/env`` are merged with user-provided ``env`` values (user values take priority on conflicts), and the combined result is written back to ``metadata/env`` after command execution. Setting a variable to an empty string or ``null`` removes it from the preserved environment. :param options.preserveCwd: ``boolean | undefined`` — Save the resolved initial working directory as the default in the resulting image. An empty or omitted ``cwd`` resolves to the image's current workdir, or ``/`` if none exists. The metadata file is opened for writing only when its contents differ from the new value. Directory changes made by the command do not change the saved value. Requires ``disposable: false`` to retain the metadata in a resulting image. :param options.cwd: ``string | undefined`` — Path to the working directory, must be absolute or a special value the empty string. It means the default working directory of the image or server default will be used. If field is omitted it will be set to the empty string. The directory will be created automatically if it does not exist. Example: ``/app``. :param options.uid: ``number | undefined`` — User ID to run the process as. Example: ``0``. :param options.gid: ``number | undefined`` — Group ID to run the process as. Example: ``0``. :param options.resourcesLimits: ``InstanceResourcesLimits | undefined`` :param options.networking: ``InstanceNetworking | undefined`` :param options.stdin: ``ClosableStreamRepr | undefined`` :param options.timeout: ``number | undefined`` — Maximum execution time in seconds Example: ``60``. :param options.truncateOutputAt: ``number | undefined`` — Maximum number of bytes to keep per stream (stdout, stderr, and stdin) in the subprocess event log. Does not affect stdin delivery to the child, which always receives the complete stream regardless of this cap. Default is ``1048576`` (1 MiB). The maximum value is ``10485760`` (10 MiB). Example: ``65535``. :param options.files: ``Record | undefined`` — Map of absolute file paths to file metadata Example: ``{"/root/hello.txt":{"uuid":"a9165a5d-5c86-4bd8-8ee4-ae46c...``. :returns: ``Promise`` .. js:method:: ContreeClient.listOperations(options?) ``GET /operations`` — List operations Returns a list of running and completed operations :param options.limit: ``number | null`` — Maximum number of operations to return. Must be between 1 and 1000. Default is 100. Invalid values raise 400 error. :param options.offset: ``number | null`` — Number of operations to skip before starting to collect the result set. Default is 0. Invalid values raise 400 error. :param options.status: ``OperationStatus | string | null`` — Filter operations by their state :param options.kind: ``"image_import" | "instance" | null`` — Filter operations by their kind :param options.since: ``string | number | Date | null`` — **Show only results created after the given date/time or interval.** Accepts a Unix timestamp or interval string. Interval format: ``600s``/``15m``/``2h``/``3d``/``1w`` means 600 seconds, 15 minutes, 2 hours, 3 day, or 1 week ago respectively). For example: * ``2025-01-01T12:00:00+00:00`` means January 1st, 2025 at 12:00 UTC * ``600s`` means 600 seconds ago * ``15m`` means 15 minutes ago Invalid values raise 400 error. Example: ``1w``. :param options.until: ``string | number | Date | null`` — **Show only results created before the given date/time or interval.** Accepts a Unix timestamp or interval string. Interval format: ``600s``/``15m``/``2h``/``3d``/``1w`` means 600 seconds, 15 minutes, 2 hours, 3 day, or 1 week ago respectively). For example: * ``2025-01-01T12:00:00+00:00`` means January 1st, 2025 at 12:00 UTC * ``600s`` means 600 seconds ago * ``15m`` means 15 minutes ago Invalid values raise 400 error. Example: ``1h``. :returns: ``Promise`` .. js:method:: ContreeClient.getOperationStatus(operationId, options?) ``GET /operations/{operationId}`` — Get an operation status Returns the status of an operation. For an EXECUTING INSTANCE operation, pass ``?inflight=1`` to also synthesize the partial ``result.stdout`` / ``result.stderr`` from the live event log. Off by default — each fetch with ``inflight`` triggers an extra subscribe RPC to the guest and drains its current events.gz, which is wasted work for clients that only poll for status transitions. :param operationId: ``string`` — The ID of the operation Example: ``12345678-9abc-baba-deda-0123456789ab``. :param options.inflight: ``boolean`` — HTTP-flag boolean. Present without a value (``?inflight``) and ``?inflight=1`` both enable; ``?inflight=0`` and absence disable. When enabled and the operation is EXECUTING INSTANCE, partial stdout/stderr is synthesized from the live event log and attached under ``result``. :returns: ``Promise`` .. js:method:: ContreeClient.cancelOperation(operationId) ``DELETE /operations/{operationId}`` — Cancel an operation Cancels an operation :param operationId: ``string`` — The ID of the import operation to cancel Example: ``12345678-9abc-baba-deda-0123456789ab``. :returns: ``Promise`` .. js:method:: ContreeClient.iterOperationEvents(operationId, options?) ``GET /operations/{operationId}/events`` — Stream the operation event log via Server-Sent Events Always returns ``text/event-stream`` (SSE) on success. The body is a sequence of three kinds of lines (per RFC W3C SSE), each terminated by ``\n\n``: .. rubric:: Frame shapes **Normal event frame** — one ``OperationEvent`` JSON object in ``data:``, dispatchable via ``event:``: :: id: event: data: {"id": N, "ts": "...", "spid": ..., "type": "...", "data": {...}} ``event:`` always matches ``data.type``. See ``OperationEvent`` and ``OperationEventType`` for the per-type payload shape. Native ``EventSource`` dispatches each frame to the matching ``addEventListener("", ...)`` handler. **Server-side error frame** — surfaces handler exceptions to the connected client without tearing the TCP connection down mid-stream. Sent right before the server closes the response: :: : stream ended with error, retry since last event id event: sse_error data: The leading SSE comment line lets pure-EventSource clients see the intent ("retry from Last-Event-Id"); the ``sse_error`` frame carries the error text for logging. Clients should treat this as a non-clean close and reconnect with the standard SSE ``Last-Event-Id`` semantics (see Resuming). **Keepalive comment** — periodic ``: keepalive\n\n`` lines emitted while the stream is idle. They keep upstream ``proxy_read_timeout`` / TCP idle timers fresh and have no application meaning. Spec-compliant; EventSource and any SSE parser must ignore comment lines (those beginning with ``:``). .. rubric:: ``follow`` semantics The ``follow`` parameter controls only whether the stream stays open after the last currently-known event: * ``follow=0`` (default) — the server emits everything currently available and closes the connection. * ``follow=1`` — same start; if the operation is still running the server keeps the connection open and forwards new events as they appear. For terminal operations ``follow=1`` is a no-op: there's nothing more to subscribe to, so the connection closes after the last event just like ``follow=0``. Optional filters: * ``?spid=N`` — only events whose ``spid`` (Spawned Process ID, the routing identity in ``OperationEvent``) matches. * ``?since=N`` — only events with ``id > N``. ``follow=1`` requires ``SPAWN`` or ``SPAWN_DISPOSABLE`` on top of the baseline ``LIST`` — a long-lived subscription reserves per-operation server state. ``follow=0`` is read-only and stays under ``LIST``. .. rubric:: Resuming after a drop Every normal frame carries ``id:`` — the canonical event id. On reconnect send the last successfully received id in the standard ``Last-Event-Id`` request header (or ``?since=N`` on manual GETs); the server resumes from that point. .. rubric:: Error handling .. list-table:: :header-rows: 1 * - Status - Meaning - Client action * - 200 - Stream open - Read frames; reconnect with Last-Event-Id if the stream closes before reaching a terminal event * - 400 - Malformed query/header (non-integer param) - Fix request * - 401 - Missing/invalid auth - Refresh credentials * - 403 - Auth lacks LIST (or SPAWN for ``follow=1``) - Use a token with the right scope * - 404 - Operation not in this namespace - Wrong UUID * - 410 - Stream is over but the terminal artifact isn't ready yet - Retry after ``Retry-After`` * - 425 - Not yet ready (operation is still being prepared) - Retry after ``Retry-After`` * - 502 - Upstream returned an error opening the stream - Retry; if persistent, escalate * - 504 - Upstream took too long to respond - Retry A ``200`` followed by an ``event: sse_error`` frame and immediate close is the in-band equivalent of "the stream broke after we already committed to a 200" — handle it the same way as 410: wait briefly, reconnect with ``Last-Event-Id``. See ``OperationEvent`` for the per-event shape. :param operationId: ``string`` — The ID of the operation Example: ``12345678-9abc-baba-deda-0123456789ab``. :param options.follow: ``boolean`` — HTTP-flag boolean. Present without a value (``?follow``) and ``?follow=1`` both enable; ``?follow=0`` and absence disable. When enabled, the SSE stream stays open after the currently-known events have been sent — for a running operation new events are forwarded as they appear; for a terminal operation it has no effect. :param options.spid: ``number | null`` — Only emit events whose ``spid`` field matches. Filter is applied server-side regardless of whether the operation is still running or already terminal. :param options.since: ``number | null`` — Only emit events with ``id > since`` (event IDs are monotonically increasing). Overridden by the ``Last-Event-Id`` header when present. :param options.lastEventId: ``number | null`` — Standard SSE resume header sent automatically by ``EventSource`` on reconnect. Treated as ``?since=N``; takes precedence over the query param. :returns: ``AsyncGenerator`` .. js:method:: ContreeClient.operationSubprocessCreate(operationId, command, options?) ``POST /operations/{operationId}/subprocesses`` — Spawn an additional subprocess inside a running instance Starts a new process inside the VM that already hosts the named operation. Distinct from ``POST /instances``, which spins up a VM: this endpoint requires a running operation (EXECUTING or ASSIGNED) and reuses the existing VM. The body is an ``ExecSpec`` — process-execution fields only. VM-level concerns (``image``, ``hostname``, ``files``, ``timeout``, ``disposable``, ``preserveEnv``) are not accepted here; they were set when the parent operation was created. ``resourcesLimits.cpu`` and ``resourcesLimits.memoryMib`` use the same names and units as operation creation. Each omitted or null subprocess limit inherits the corresponding operation limit. Values above the operation limit return 400. Limits apply at launch: memoryMib sets RLIMIT_AS for each process and memory.max for the entire process tree. They cannot be changed through this API. Guest root can modify limits; these limits do not provide security isolation between processes in one VM. The required permission follows the parent instance: ``SPAWN_DISPOSABLE`` when it was spawned with ``disposable=true``, ``SPAWN`` otherwise. On success the worker assigns a fresh ``spid`` (≥2; ``spid=1`` is the main process spawned from ``metadata``) and the response carries it in the body plus a ``Location`` header pointing at ``GET /operations/{operationId}/subprocesses/{spid}`` — the subprocess result reconstructed from its events. :param operationId: ``string`` — The ID of the operation Example: ``12345678-9abc-baba-deda-0123456789ab``. :param command: ``string`` — The command to execute. Same semantics as in ``InstanceSpawnRequest.command`` — when ``shell=true`` it is a shell expression, otherwise a path to an executable. Example: ``/bin/app``. :param options.resourcesLimits: ``ProcessResourcesLimits | undefined`` :param options.args: ``string[] | undefined`` — Arguments to pass to the command if shell is set to false. Example: ``["arg1","arg2"]``. :param options.shell: ``boolean | undefined`` — Run command through a shell expression (args must be empty). :param options.env: ``Record | null | undefined`` — Environment variables to set in the child process. :param options.cwd: ``string | undefined`` — Working directory; empty string means image / server default. :param options.uid: ``number | undefined`` — User ID to run the process as. :param options.gid: ``number | undefined`` — Group ID to run the process as. :param options.stdin: ``ClosableStreamRepr | undefined`` — Bytes fed to the child's stdin — honored for both the main process and exec'd subprocesses. With ``close=false`` the pipe stays open and more data can be written via ``POST /operations/{operationId}/subprocesses/{spid}/stdin``. :param options.truncateOutputAt: ``number | undefined`` — Maximum number of bytes to keep per stream (stdout, stderr, and stdin) in the subprocess event log. Does not affect delivery to the child — stdin is always delivered in full regardless of this cap. Defaults to 1 MiB; capped at 10 MiB. Example: ``65535``. :returns: ``Promise`` .. js:method:: ContreeClient.operationSubprocess(operationId, spid) ``GET /operations/{operationId}/subprocesses/{spid}`` — Result of one subprocess, reconstructed from its events Returns an ``InstanceResult`` for ``spid`` — the same shape as the parent operation's ``metadata.result`` — folded from the subprocess's event log (spawn / stdout / stderr / exit). Works for running and terminal operations alike. While the process is still running, ``state.exitCode`` and ``state.signal`` are ``-1`` (unknown) and ``resources`` holds sentinel defaults; once the exit event lands they carry the real values. ``stdout`` / ``stderr`` are consolidated and capped at the spec's ``truncateOutputAt``. The raw event stream stays available at ``GET /operations/{operationId}/events?spid={spid}``. :param operationId: ``string`` — The ID of the operation Example: ``12345678-9abc-baba-deda-0123456789ab``. :param spid: ``number`` — Spawn id (1 = main process; ≥2 = exec'd children). :returns: ``Promise`` .. js:method:: ContreeClient.operationSubprocessKill(operationId, spid, options?) ``DELETE /operations/{operationId}/subprocesses/{spid}`` — Kill one subprocess Sends a signal to the process group of ``spid`` inside the running instance. Without the ``signal`` parameter the group gets SIGKILL. Termination is observable, not returned: the ``exit`` event lands in the event log and ``GET /operations/{operationId}/subprocesses/{spid}`` reports the terminal ``state`` (``signal`` set, ``exitCode`` -1 when killed). Killing ``spid=1`` (the main process) effectively ends the operation, like letting the command fail. :param operationId: ``string`` — The ID of the operation Example: ``12345678-9abc-baba-deda-0123456789ab``. :param spid: ``number`` — Spawn id (1 = main process; ≥2 = exec'd children). :param options.signal: ``string | null`` — Signal to send instead of SIGKILL — a number (``15``) or a name with or without the SIG prefix (``TERM``, ``SIGTERM``). Example: ``SIGTERM``. :returns: ``Promise`` .. js:method:: ContreeClient.operationSubprocessStdin(operationId, spid, value, options?) ``POST /operations/{operationId}/subprocesses/{spid}/stdin`` — Write to a subprocess's stdin and/or close it Writes a chunk to the stdin of a live process inside the running instance — ``spid=1`` targets the main process, ``≥2`` the exec'd children. Requires the process to have been started with ``stdin.close=false``; otherwise its pipe is already at EOF and the call returns 409. ``close=true`` (the default) signals EOF after writing ``value``; an empty ``value`` with ``close=true`` just closes the pipe. A client that serializes its own requests gets ordered writes; concurrent requests to the same spid are safe but their order is unspecified. A 504 means the guest write timed out mid-call — the chunk may or may not have been delivered (e.g. the process stopped reading and the pipe is full), so blind retries can duplicate data. :param operationId: ``string`` — The ID of the operation Example: ``12345678-9abc-baba-deda-0123456789ab``. :param spid: ``number`` — Spawn id (1 = main process; ≥2 = exec'd children). :param value: ``string`` — Content to write to stdin (may be empty for a close-only request) Example: ``aGVsbG8K``. :param options.encoding: ``"ascii" | "base64" | undefined`` — Encoding of the content :param options.close: ``boolean | undefined`` — ``true`` (default) closes stdin (EOF) after writing ``value`` — the pre-existing one-shot behavior. ``false`` keeps the pipe open so more data can be sent later via ``POST /operations/{operationId}/subprocesses/{spid}/stdin``. :returns: ``Promise`` .. js:method:: ContreeClient.applyInstanceFile(operationUuid, fileUuid, path, options?) ``POST /operations/{operation_uuid}/files`` — Apply an uploaded file to a running instance Reads a file previously uploaded through POST /files and writes it to a running INSTANCE operation, including disposable instances. Requires LIST and the permission used to start the instance. Both the operation and the uploaded file must belong to the request namespace. Expired files are unavailable. The assigned worker streams the stored object to the guest through RPC. Init records request metadata in ``inspect`` events and the terminal publication result in ``file_upload``, including ``fileUuid`` and byte count. File contents do not enter operation events. With unpack omitted or false, path is the full destination filename. Missing parent directories are created. The file is published atomically after transfer and SHA256 verification. The new file has mode 0644 and is owned by the guest runtime user. With replace true, an existing leaf symlink is replaced. Directories and special files are not regular file destinations. With unpack true, path is the destination directory. Supports tar, tar.gz and tar.bz2; compression is detected from the stored bytes. Xz is unsupported and rejected before subsequent chunks are sent. Without unpack, compressed archives are copied unchanged. Content-Type describes this JSON request and never controls extraction. Extraction accepts regular files, directories, symlinks and hardlinks to regular files already extracted in the staging tree. Parent symlinks inside that tree are not followed. Absolute entry names and entries containing '..' are rejected. procfs, sysfs, devices, FIFOs and sockets are unsupported. New directories have mode 0755; regular files retain tar permission bits (0777). Ownership and timestamps are not restored. Other entries fail explicitly. With replace omitted or false, any existing destination returns 409, including a symlink or empty directory. This condition is checked again atomically at publication. replace true permits an existing destination. With merge omitted or false, directory replacement removes the entire old tree without merging contents. Archives are extracted into a temporary sibling directory. The destination remains unchanged until the complete stream and SHA256 have been verified. Without merge, publication uses an atomic rename or exchange, then removes the old tree. Root and mount-point replacement are unavailable. Existing open descriptors can still refer to old inodes; concurrent workload access is not a snapshot. merge true requires both unpack true and replace true. After complete staging and verification, it combines directories and atomically replaces individual files and symlinks. Existing entries absent from the archive remain. Destination directory symlinks are not followed; directory/file conflicts fail explicitly. Same-filesystem hardlinks are retained. Crossing a destination mount requires copying file bytes and does not preserve hardlinks across filesystems. Merge is not atomic for the whole tree: errors, cancellation or timeout after application starts can leave completed changes. These changes are not rolled back. Returns 204 only after completion. Transfers have a 300-second deadline and bounded buffers and handles. Disconnect or VM exit cancels the transfer. A lost response can leave an uncertain outcome; requests are not replayed automatically. This endpoint does not write to a completed result image. A transfer timeout does not stop the instance. Before publication or merge starts, cancellation preserves the old destination and removes the temporary file or extraction tree. A timeout while awaiting the final response can occur after publication; it does not prove that no changes were made. An old-tree cleanup failure is reported as an error after publication; it does not roll back the new tree. The uploaded source object retains its normal lifetime. Automatically created parent directories have mode 0755 and can remain after errors. The primary command's timeout follows normal instance finalization: ordinary instances persist their filesystem, including successfully published uploads; disposable instances do not. Instance shutdown waits for pending upload cleanup. A timeout or crash of the execution environment can bypass this cleanup and does not produce a successfully persisted result image through normal finalization. :param operationUuid: ``string`` — Example: ``12345678-9abc-baba-deda-0123456789ab``. :param fileUuid: ``string`` :param path: ``string`` — Absolute guest filename, or directory when unpack is true. Missing parents are created. :param options.unpack: ``boolean | undefined`` — Extract tar, tar.gz or tar.bz2 instead of copying the stored bytes. :param options.replace: ``boolean | undefined`` — Permit an existing destination. Without merge, directories are replaced in full. :param options.merge: ``boolean | undefined`` — Merge verified archive contents. Requires unpack and replace. Can leave partial changes. :returns: ``Promise`` .. js:method:: ContreeClient.inspectInstanceDownload(operationUuid, path) ``GET /operations/{operation_uuid}/inspect/download`` — Download a file from a running instance Reads through guest RPC without recording file contents in operation events. Requires LIST and the permission used to start this instance (SPAWN or SPAWN_DISPOSABLE). Reads include tmpfs and additional mounts visible to the guest runtime. procfs, sysfs, devices, sockets, and FIFOs are unavailable. Reads do not form a snapshot. The opened inode and initial size are used; later growth is excluded. Truncation or VM exit interrupts the response. A transfer has a 300-second deadline. No result-image fallback is performed. :param operationUuid: ``string`` — The UUID of the running instance to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the file to inspect inside the running instance, e.g. ``/etc/hosts`` :returns: ``Promise`` .. js:method:: ContreeClient.inspectInstanceDownloadStream(operationUuid, path) Streaming variant of :js:meth:`ContreeClient.inspectInstanceDownload`. :returns: ``AsyncGenerator`` .. js:method:: ContreeClient.checkInstanceFile(operationUuid, path) ``HEAD /operations/{operation_uuid}/inspect/download`` — Check if a file exists in running instance Checks if a file exists in the specified running instance without returning the file content :param operationUuid: ``string`` — The UUID of the running instance to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the file to check inside the running instance, e.g. ``/etc/hosts`` :returns: ``Promise`` .. js:method:: ContreeClient.inspectInstanceList(operationUuid, path) ``GET /operations/{operation_uuid}/inspect/list`` — List files in running instance Lists guest files without recording contents in operation events. Requires LIST and the permission used to start this instance. Reads do not form a snapshot. A directory can contain at most 10000 entries. procfs and sysfs cannot be listed. :param operationUuid: ``string`` — The UUID of the running instance to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the directory to inspect inside the running instance Example: ``/etc``. :returns: ``Promise`` .. js:method:: ContreeClient.inspectInstanceArchive(operationUuid, path) ``GET /operations/{operation_uuid}/inspect/archive`` — Download a file or a directory from running instance as tar archive Streams the specified path inside the running instance root filesystem as a POSIX PAX tar archive. A directory becomes the archive root; a regular file becomes a single-entry archive. The response is chunked; total size is not known upfront. Served as an attachment, ``filename`` is the path with ``/`` replaced by ``_`` plus ``.tar`` (e.g. ``/bin/true`` -> ``bin_true.tar``). Requires LIST and the permission used to start this instance. Contents do not enter operation events. Reads do not form a snapshot. Traversal skips procfs and sysfs and preserves descendant symlinks. File changes or VM exit can interrupt the stream. Transfers have a 300-second deadline. :param operationUuid: ``string`` — The UUID of the running instance to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the file or directory to archive inside the running instance, e.g. ``/etc`` :returns: ``AsyncGenerator`` .. js:method:: ContreeClient.checkInstanceArchive(operationUuid, path) ``HEAD /operations/{operation_uuid}/inspect/archive`` — Check if a path can be archived from running instance Checks if a file or a directory exists in the specified running instance without streaming the archive :param operationUuid: ``string`` — The UUID of the running instance to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the file or directory to check inside the running instance, e.g. ``/etc`` :returns: ``Promise`` .. js:method:: ContreeClient.inspectFindImageByTag(tag) ``GET /inspect/`` — Find image by tag Redirects to the image inspection endpoint for the specified tag :param tag: ``string`` — The tag of the image to inspect :returns: ``Promise`` .. js:method:: ContreeClient.inspectImage(imageUuid) ``GET /inspect/{image_uuid}/`` — Inspect an image Returns image metadata :param imageUuid: ``string`` — The UUID of the image to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :returns: ``Promise`` .. js:method:: ContreeClient.inspectImageDownload(imageUuid, path) ``GET /inspect/{image_uuid}/download`` — Download a file from image Returns file content :param imageUuid: ``string`` — The UUID of the image to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the file to inspect inside the image, e.g. ``/etc/hosts`` :returns: ``Promise`` .. js:method:: ContreeClient.inspectImageDownloadStream(imageUuid, path) Streaming variant of :js:meth:`ContreeClient.inspectImageDownload`. :returns: ``AsyncGenerator`` .. js:method:: ContreeClient.checkImageFile(imageUuid, path) ``HEAD /inspect/{image_uuid}/download`` — Check if a file exists in image Checks if a file exists in the specified image without returning the file content :param imageUuid: ``string`` — The UUID of the image to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the file to check inside the image, e.g. ``/etc/hosts`` :returns: ``Promise`` .. js:method:: ContreeClient.inspectImageArchive(imageUuid, path) ``GET /inspect/{image_uuid}/archive`` — Download a file or a directory from image as tar archive Streams the specified path inside the image root filesystem as a POSIX PAX tar archive. A directory becomes the archive root; a regular file becomes a single-entry archive. The response is chunked; total size is not known upfront. Served as an attachment, ``filename`` is the path with ``/`` replaced by ``_`` plus ``.tar`` (e.g. ``/bin/true`` -> ``bin_true.tar``). :param imageUuid: ``string`` — The UUID of the image to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the file or directory to archive inside the image, e.g. ``/etc`` :returns: ``AsyncGenerator`` .. js:method:: ContreeClient.checkImageArchive(imageUuid, path) ``HEAD /inspect/{image_uuid}/archive`` — Check if a path can be archived from image Checks if a file or a directory exists in the specified image without streaming the archive :param imageUuid: ``string`` — The UUID of the image to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the file or directory to check inside the image, e.g. ``/etc`` :returns: ``Promise`` .. js:method:: ContreeClient.inspectImageList(imageUuid, path) ``GET /inspect/{image_uuid}/list`` — List files in image Returns files list :param imageUuid: ``string`` — The UUID of the image to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param path: ``string`` — The path of the directory to inspect inside the image Example: ``/etc``. :returns: ``Promise`` .. js:method:: ContreeClient.inspectInstanceGrep(operationUuid, pattern, options?) ``GET /operations/{operation_uuid}/inspect/grep`` — Search file contents in running instance Regex content search inside the running instance's root filesystem, through guest RPC. A Go converter translates supported Rust regex syntax to Go regexp. Symlinks are never followed during traversal, hidden files are searched, ``.ignore`` and ``.gitignore`` rules within each search root are respected. A NUL byte in the first 64 KiB causes a file to be skipped; a later NUL ends that file's search. Go regexp uses linear-time matching. The classes \w/\W, \d/\D, and \s/\S use Unicode semantics. Unicode properties and case folding are pinned to Unicode 16.0.0, matching the image engine. Scoped flags, nested class set operations, and bounded expansion of large repetitions are supported. Expanded patterns share a 1 MiB limit per request. Unsupported syntax returns 400 with a pattern index and byte offset. Unicode \b/\B, CRLF mode, non-ASCII byte mode, and \Q…\E are rejected. Use (?-u:\b) for an ASCII word boundary. Smart case examines parsed literals. Results are a flat, file-ordered list of lines. ``before``/``after`` request extra ``type: context`` lines around each ``type: match`` line, mirroring ripgrep's --json message type field. ``path`` may be repeated to search multiple roots in one call, the same way ``pattern``/``glob`` already can; results are concatenated in the given order and share the ``maxTotal`` budget across all of them. Results never enter operation events. Reads are live and do not form a snapshot. procfs, sysfs, devices, sockets, and FIFOs are not searched. Requires LIST and the permission used to start this instance. Searches have a 10-second budget per root and permit two concurrent searches per instance. Reaching the time, depth, or result limit sets ``truncated``. Context lines count towards ``maxTotal``. Display text is limited to 4096 bytes per line; matching can continue beyond this window. :param operationUuid: ``string`` — The UUID of the running instance to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param pattern: ``string | readonly string[]`` — Regex pattern to search for. May be repeated (max 16); patterns are OR-ed. Max 1024 characters each. Example: ``^PermitRootLogin``. :param options.path: ``string | readonly string[] | null`` — File or directory to search inside the running instance. May be repeated (max 16) to search multiple roots; results are concatenated in the given order, sharing maxTotal across all paths. Defaults to the rootfs root. Example: ``/etc``. :param options.glob: ``string | readonly string[] | null`` — Glob to filter files (ripgrep -g semantics, "!" negates). May be repeated. Example: ``*.conf``. :param options.maxCount: ``number | null`` — Maximum matches per file (hard cap 10000). :param options.maxTotal: ``number | null`` — Maximum total matches across all files (default 1000, hard cap 10000). :param options.case: ``"sensitive" | "insensitive" | "smart" | null`` — Case sensitivity mode. :param options.before: ``number | null`` — Lines of context to include before each match (ripgrep -B semantics, hard cap 50). For symmetric context (grep -C n), pass both before and after yourself. :param options.after: ``number | null`` — Lines of context to include after each match (ripgrep -A semantics, hard cap 50). :returns: ``Promise`` .. js:method:: ContreeClient.inspectImageGrep(imageUuid, pattern, options?) ``GET /inspect/{image_uuid}/grep`` — Search file contents in image Regex content search inside the image's root filesystem, powered by ripgrep. Symlinks are never followed during traversal, hidden files are searched, ``.gitignore``-style files inside the image are ignored, and binary files (containing a NUL byte) are skipped. Rust regex syntax, linear-time matching. Results are a flat, file-ordered list of lines. ``before``/``after`` request extra ``type: context`` lines around each ``type: match`` line, mirroring ripgrep's --json message type field. ``path`` may be repeated to search multiple roots in one call, the same way ``pattern``/``glob`` already can; results are concatenated in the given order and share the ``maxTotal`` budget across all of them. :param imageUuid: ``string`` — The UUID of the image to inspect Example: ``12345678-9abc-baba-deda-0123456789ab``. :param pattern: ``string | readonly string[]`` — Regex pattern to search for. May be repeated (max 16); patterns are OR-ed. Max 1024 characters each. Example: ``^PermitRootLogin``. :param options.path: ``string | readonly string[] | null`` — File or directory to search inside the image. May be repeated (max 16) to search multiple roots; results are concatenated in the given order, sharing maxTotal across all paths. Defaults to the rootfs root. Example: ``/etc``. :param options.glob: ``string | readonly string[] | null`` — Glob to filter files (ripgrep -g semantics, "!" negates). May be repeated. Example: ``*.conf``. :param options.maxCount: ``number | null`` — Maximum matches per file (hard cap 10000). :param options.maxTotal: ``number | null`` — Maximum total matches across all files (default 1000, hard cap 10000). :param options.case: ``"sensitive" | "insensitive" | "smart" | null`` — Case sensitivity mode. :param options.before: ``number | null`` — Lines of context to include before each match (ripgrep -B semantics, hard cap 50). For symmetric context (grep -C n), pass both before and after yourself. :param options.after: ``number | null`` — Lines of context to include after each match (ripgrep -A semantics, hard cap 50). :returns: ``Promise`` .. js:method:: ContreeClient.whoami() ``GET /whoami`` — Get current token information Returns information about the current authentication token, including the token UUID, expiration time, and a map of all known permissions with their granted status. :returns: ``Promise`` Helpers ------- .. js:method:: ContreeClient.waitOperation(operationId, options?) Uses instance events or polls image imports and returns the terminal response. :param operationId: ``string`` :param options.followEvents: ``boolean | null`` — default ``null`` selects by operation kind; ``true`` forces events and ``false`` forces polling. :param options.timeout: ``number | null`` — bounds the whole wait in seconds, idle streams included; expiry rejects with a ``TimeoutError`` ``DOMException``. :param options.idleTimeout: ``number`` — seconds without incoming data before reconnecting; default 15. Ping frames reset it. Set 0 to disable it. :returns: ``Promise`` .. js:method:: ContreeClient.followOperationEvents(operationId, options?) :js:meth:`ContreeClient.iterOperationEvents` with ``follow: true`` and transparent reconnection: network drops, transport timeouts, in-band ``sse_error`` frames and retryable statuses (410/425/5xx) resume from the last received event id. Non-retryable HTTP statuses stop recovery and raise ``APIConnectionError`` with the status error as its cause. After terminal status, reads retained events with ``follow: false``, keeping the cursor, filters, original deadline, and inactivity timeout. An unfiltered log must include ``completion``. A filtered or explicitly resumed log may end at clean EOF. Incomplete or unavailable logs raise ``APIConnectionError``. Interrupted retained reads use the configured ``RetryPolicy`` statuses, delays, and ``maxAttempts``, or three attempts by default. Cancellation and malformed event data propagate without retry. :param operationId: ``string`` :param options.lastEventId: ``number | null`` :param options.spid: ``number | null`` :param options.since: ``number | null`` :param options.timeout: ``number | null`` — overall deadline in seconds; expiry throws a ``TimeoutError`` ``DOMException``. :param options.idleTimeout: ``number`` — seconds without incoming data before reconnecting; default 15. Ping frames reset it. Set 0 to disable it. :returns: ``AsyncGenerator`` .. js:method:: ContreeClient.resolveImage(ref) Resolves a UUID, ``tag:NAME`` or bare tag to the image UUID. :param ref: ``string`` :returns: ``Promise`` .. js:method:: ContreeClient.ensureFile(content, options?) Uploads *content* unless the server already stores it: the sha256 (``options.sha256`` when known, computed locally otherwise) is probed via :js:meth:`ContreeClient.getFile`, only a miss uploads. A ``ReadableStream`` cannot be hashed and replayed, so it skips deduplication. :param content: ``Uint8Array | string | Blob | ReadableStream`` :param options.sha256: ``string | null`` :returns: ``Promise`` .. js:method:: ContreeClient.iterImages(options?) Lazy offset pagination over :js:meth:`ContreeClient.listImages`: the listing filters plus ``pageSize`` (server-capped) and ``limit`` (total records; ``null`` iterates everything). Breaking out of the loop stops fetching. ``iterOperations()`` and ``iterFiles()`` mirror it for their listings. :returns: ``AsyncGenerator`` Statuses and events ------------------- Operation statuses are wire strings: ``PENDING``, ``ASSIGNED``, ``EXECUTING``, ``SUCCESS``, ``FAILED``, ``CANCELLED``. Terminal: ``SUCCESS``, ``FAILED``, ``CANCELLED`` — membership via ``TERMINAL_STATUSES`` / ``ACTIVE_STATUSES`` sets or ``isTerminalStatus(status)``. Event types: ``init``, ``spawn``, ``stdin``, ``stdout``, ``stderr``, ``exit``, ``truncated``, ``size_cap``, ``network``, ``shutdown``, ``inspect``, ``file_upload``, ``completion``; each maps to its ``EventData*`` payload class below, unknown payloads stay plain objects (``parseEventData``). Models ------ .. js:class:: FileItem(fields?) .. js:attribute:: FileItem.size ``number`` (required) — File size in bytes Example: ``1024``. .. js:attribute:: FileItem.path ``string`` (required) — File name (relative to the directory being listed) Example: ``passwd``. .. js:attribute:: FileItem.owner ``string | number`` (required) — File owner name or UID Example: ``root``. .. js:attribute:: FileItem.group ``string | number`` (required) — File group name or GID Example: ``root``. .. js:attribute:: FileItem.uid ``number`` (required) — User ID of the file owner Example: ``0``. .. js:attribute:: FileItem.gid ``number`` (required) — Group ID of the file Example: ``0``. .. js:attribute:: FileItem.mode ``number`` (required) — File mode/permissions as integer (octal representation) Example: ``33188``. .. js:attribute:: FileItem.mtime ``number`` (required) — Last modification time as Unix timestamp Example: ``1640995200``. .. js:attribute:: FileItem.nlink ``number`` (required) — Number of hard links Example: ``1``. .. js:attribute:: FileItem.isDir ``boolean`` (required) — True if the item is a directory Example: ``false``. .. js:attribute:: FileItem.isRegular ``boolean`` (required) — True if the item is a regular file Example: ``true``. .. js:attribute:: FileItem.isSymlink ``boolean`` (required) — True if the item is a symbolic link Example: ``false``. .. js:attribute:: FileItem.isSocket ``boolean`` (required) — True if the item is a socket Example: ``false``. .. js:attribute:: FileItem.isFifo ``boolean`` (required) — True if the item is a FIFO/named pipe Example: ``false``. .. js:attribute:: FileItem.symlinkTo ``string`` (required) — Target path if the item is a symbolic link, empty string otherwise .. js:class:: DirectoryList(fields?) .. js:attribute:: DirectoryList.path ``string`` (required) — The directory path that was listed Example: ``/etc``. .. js:attribute:: DirectoryList.files ``FileItem[]`` (required) — List of files and directories in the specified path ``asText(short = false)`` formats an ``ls -l``-style table; pass the boolean ``true`` for paths only. ``toString()`` delegates to ``asText()`` with the default format. .. js:class:: GrepSubmatch(fields?) .. js:attribute:: GrepSubmatch.text ``string`` (required) — The matched text Example: ``PermitRootLogin``. .. js:attribute:: GrepSubmatch.start ``number`` (required) — Byte offset of the match start within the line Example: ``1``. .. js:attribute:: GrepSubmatch.end ``number`` (required) — Byte offset of the match end within the line Example: ``16``. .. js:class:: GrepMatch(fields?) .. js:attribute:: GrepMatch.path ``string`` (required) — File path relative to the image rootfs Example: ``/etc/ssh/sshd_config``. .. js:attribute:: GrepMatch.lineNumber ``number`` (required) — 1-based line number of the match Example: ``57``. .. js:attribute:: GrepMatch.absoluteOffset ``number`` (required) — Byte offset of the line from the start of the file Example: ``1712``. .. js:attribute:: GrepMatch.lineText ``string`` (required) — The matching line, including the line terminator (truncated at 4096 bytes) Example: ``#PermitRootLogin prohibit-password``. .. js:attribute:: GrepMatch.lineBytes ``number`` (required) — Real byte length of the matching line; greater than lineText length when the line was capped Example: ``8192``. .. js:attribute:: GrepMatch.submatches ``GrepSubmatch[]`` (required) — Empty for context lines (they carry no submatches) .. js:attribute:: GrepMatch.type ``"match" | "context"`` (required) — Mirrors ripgrep's --json message type: "match" is an actual match, "context" is a before/after context line requested via before/after. Example: ``match``. ``asText()`` formats one grep row, using ``-`` separators for context rows. ``toString()`` delegates to ``asText()`` with the default format. .. js:class:: GrepResult(fields?) .. js:attribute:: GrepResult.path ``string`` (required) — The first path inside the image that was searched. When ``path`` was repeated, see each row's own ``path`` for which root it actually came from. Example: ``/etc``. .. js:attribute:: GrepResult.patterns ``string[]`` (required) — The patterns that were searched for Example: ``["^PermitRootLogin"]``. .. js:attribute:: GrepResult.matches ``GrepMatch[]`` (required) — File-ordered lines; each is a match or (when before/after are set) surrounding context .. js:attribute:: GrepResult.truncated ``boolean`` (required) — True when maxTotal or the search deadline stopped the search early Example: ``false``. ``asText()`` formats grep rows in response order, separating disjoint context groups with ``--``. ``toString()`` delegates to ``asText()`` with the default format. .. js:class:: ImageImportRegistryCredentials(fields?) .. js:attribute:: ImageImportRegistryCredentials.username ``string`` (optional) — Username for the registry authentication Example: ``myuser``. .. js:attribute:: ImageImportRegistryCredentials.password ``string`` (optional) — Password for the registry authentication Example: ``secret``. .. js:class:: ImageImportRegistry(fields?) .. js:attribute:: ImageImportRegistry.url ``string`` (required) — URL of the container registry Example: ``docker://docker.io/busybox:latest``. .. js:attribute:: ImageImportRegistry.credentials ``ImageImportRegistryCredentials`` (optional) .. js:class:: ImageImportRequest(fields?) .. js:attribute:: ImageImportRequest.registry ``ImageImportRegistry`` (required) .. js:attribute:: ImageImportRequest.tag ``string | null`` (optional) — Tag to identify the image when listing publicly available images. If omitted, the image will be private and only accessible by ID. Example: ``busybox:latest``. .. js:attribute:: ImageImportRequest.timeout ``number`` (optional) — Maximum time in seconds to wait for the import operation to complete Example: ``300``. .. js:class:: Image(fields?) .. js:attribute:: Image.uuid ``string`` (optional) .. js:attribute:: Image.tag ``string | null`` (optional) — Tag to identify the image Example: ``busybox:latest``. .. js:attribute:: Image.createdAt ``string`` (optional) — ISO 8601 formatted timestamp of when the image was created Example: ``2024-01-01T12:00:00+00:00``. .. js:attribute:: Image.operationUuid ``string | null`` (optional) — UUID of the operation that created this image. Returns ``null`` when the image belongs to a different namespace (e.g. public images) or when the image was not created by an operation (e.g. shared images). .. js:class:: ImageListResponse(fields?) .. js:attribute:: ImageListResponse.images ``Image[]`` (optional) — List of publicly available images .. js:class:: ImageImportMetadataRegistryCredentials(fields?) .. js:attribute:: ImageImportMetadataRegistryCredentials.username ``string`` (optional) — Username for the registry authentication Example: ``myuser``. .. js:attribute:: ImageImportMetadataRegistryCredentials.password ``string`` (optional) — Always masked in the response is present Example: ````. .. js:class:: ImageImportMetadataRegistry(fields?) .. js:attribute:: ImageImportMetadataRegistry.url ``string`` (optional) — URL of the container registry Example: ``docker://docker.io/busybox:latest``. .. js:attribute:: ImageImportMetadataRegistry.credentials ``ImageImportMetadataRegistryCredentials`` (optional) .. js:class:: ImageImportMetadata(fields?) .. js:attribute:: ImageImportMetadata.registry ``ImageImportMetadataRegistry`` (optional) .. js:attribute:: ImageImportMetadata.tag ``string | null`` (optional) .. js:attribute:: ImageImportMetadata.timeout ``number`` (optional) — Maximum time in seconds to wait for the import operation to complete Example: ``300``. .. js:class:: StreamRepr(fields?) .. js:attribute:: StreamRepr.value ``string`` (required) — Content of the stream Example: ``Y29tbWFuZCBvdXRwdXQK``. .. js:attribute:: StreamRepr.encoding ``"ascii" | "base64"`` (required) — Encoding of the content Example: ``base64``. .. js:attribute:: StreamRepr.truncated ``boolean`` (optional) — Whether the output was truncated Example: ``false``. Codec helpers: ``asBytes()``, ``asText()``, ``StreamRepr.fromBytes(bytes)``, ``StreamRepr.fromText(text)``. ``toString()`` delegates to ``asText()`` with the default format. .. js:class:: ClosableStreamRepr(fields?) Stdin payload. Delivery to the child is always complete — stdin is never truncated on its way to the process. Only the *recorded* ``stdin`` events in the subprocess event log are capped by ``truncateOutputAt``, same as stdout/stderr. This schema also carries a ``close`` flag controlling the pipe's EOF. .. js:attribute:: ClosableStreamRepr.value ``string`` (required) — Content to write to stdin (may be empty for a close-only request) Example: ``aGVsbG8K``. .. js:attribute:: ClosableStreamRepr.encoding ``"ascii" | "base64"`` (optional) — Encoding of the content .. js:attribute:: ClosableStreamRepr.close ``boolean`` (optional) — ``true`` (default) closes stdin (EOF) after writing ``value`` — the pre-existing one-shot behavior. ``false`` keeps the pipe open so more data can be sent later via ``POST /operations/{operationId}/subprocesses/{spid}/stdin``. Codec helpers: ``asBytes()``, ``asText()``, ``ClosableStreamRepr.fromBytes(bytes)``, ``ClosableStreamRepr.fromText(text)``. ``toString()`` delegates to ``asText()`` with the default format. .. js:class:: InstanceResourcesLimits(fields?) Launch-time limits. CPU sets the VM's vCPU count. memoryMib limits each process's address space (RLIMIT_AS, soft and hard) and the whole process tree's memory (cgroup memory.max). A request for 1 MiB is valid and enforces that limit on the workload. The backend independently selects a minimum VM RAM allocation for guest boot, networking and runtime services, for example 128 or 256 MiB. This minimum is an implementation detail and can change. It does not increase the requested workload limit. A small address-space limit can prevent the executable or runtime from loading. It includes stacks, libraries and reserved mappings; allocations can fail with ENOMEM even with overcommit enabled. Guest kernel and runtime consume part of VM RAM. Limits are maxima, not reservations. Guest root retains permission to modify cgroups. .. js:attribute:: InstanceResourcesLimits.cpu ``number`` (optional) — Number of guest vCPUs. .. js:attribute:: InstanceResourcesLimits.memoryMib ``number`` (optional) — Per-process address-space and process-tree memory limit in MiB (1048576 bytes). .. js:attribute:: InstanceResourcesLimits.maxLayerBytes ``number`` (optional) — Maximum writable layer size in bytes. Example: ``1073741824``. .. js:class:: ProcessResourcesLimits(fields?) Launch-time limits for a subprocess and its descendants. Each omitted or null field inherits the requested operation limit, not the VM's minimum boot memory. CPU/RAM cannot exceed the parent operation. Limits are maxima, not reservations. Concurrent processes share VM resources and can exhaust the aggregate budget. memoryMib sets RLIMIT_AS (soft and hard) before exec and memory.max for the tree. RLIMIT_AS includes reserved mappings, stacks and libraries; allocation or executable loading can fail with ENOMEM. Descendants inherit it. A local cgroup OOM kills this process tree. A VM-wide OOM can affect other processes. Guest root retains permission to modify cgroups. .. js:attribute:: ProcessResourcesLimits.cpu ``number | null`` (optional) — Number of guest vCPUs available to the process tree. The runtime selects CPU affinity; CPU sets can overlap between subprocesses. .. js:attribute:: ProcessResourcesLimits.memoryMib ``number | null`` (optional) — Per-process RLIMIT_AS and tree memory.max in MiB. Swap is disabled for this group. .. js:class:: InstanceNetworking(fields?) .. js:attribute:: InstanceNetworking.enabled ``boolean`` (optional) — Enable network access for the instance. When ``false``, the VM starts without a guest network interface. .. js:attribute:: InstanceNetworking.policy ``string[]`` (optional) — Network policies to apply, referenced by UUID or by tag prefixed with ``tag:``. **References** - You can use your own policies and shared policies. - Your tag takes precedence over a shared tag with the same name. - Duplicate references and resolved policy UUIDs are removed while preserving first occurrence order. - Unknown or unavailable references return 404. - Deleted policies remain usable by UUID. **Permissions** Using policies requires only the permission to create the instance; ``network_policy`` is not required. **Limits** - At most 512 references may be supplied, including duplicates. - Before and after merging, the rules are limited to 16384 units in total: sum the number of ports across all rules, counting an all-port rule as 1. All IP versions and protocols share this limit. Repeated rules and ports across policies count again before merging. - Exceeding either limit returns 400. **No policies** Omitting this field or passing ``policy: []`` allows all IPv4 destinations and global unicast IPv6 destinations on all ports. The API adds four explicit rules to ``effectivePolicy``: TCP and UDP for IPv4 ``0.0.0.0/0`` and IPv6 ``2000::/3``, each with ``ports: []`` (all ports). ICMP is also allowed to these destinations. IPv6 destinations outside ``2000::/3``, including unique-local and link-local addresses, require explicit policy rules. **Empty policies** A selected policy with no rules (``{"cidrs": []}``) allows nothing. If all selected policies are empty, ``effectivePolicy`` is ``{"cidrs": []}`` and all network traffic is denied. An empty policy combined with non-empty policies adds no permissions; the other policies' rules still apply. **Effective policy** ``effectivePolicy`` contains the final combined network rules that will be applied to the operation. Rules are combined by merging CIDRs per protocol and port, then grouping ports for matching CIDRs and protocols. Example: ``["12345678-9abc-baba-deda-0123456789ab","tag:github"]``. .. js:class:: NetworkPolicyCIDRRule(fields?) .. js:attribute:: NetworkPolicyCIDRRule.cidr ``string`` (required) — IPv4 or IPv6 destination network in CIDR notation. Example: ``192.0.2.0/24``. .. js:attribute:: NetworkPolicyCIDRRule.proto ``"tcp" | "udp"`` (required) .. js:attribute:: NetworkPolicyCIDRRule.ports ``number[]`` (optional) — Allowed destination ports. Omitted or empty means all ports. .. js:class:: NetworkPolicyCreateRequest(fields?) An allowlist of destination networks, protocols, and ports. A policy with ``{"cidrs": []}`` allows nothing. Selecting only empty policies denies all network traffic. This differs from selecting no policies (``networking.policy: []``), which allows all IPv4 destinations (``0.0.0.0/0``) and global unicast IPv6 destinations (``2000::/3``) on all ports and adds these explicit rules to ``effectivePolicy``. .. js:attribute:: NetworkPolicyCreateRequest.cidrs ``NetworkPolicyCIDRRule[]`` (required) .. js:class:: InstanceNetworkingResponse(fields?) .. js:attribute:: InstanceNetworkingResponse.enabled ``boolean`` (optional) — Enable network access for the instance. When ``false``, the VM starts without a guest network interface. .. js:attribute:: InstanceNetworkingResponse.policy ``string[]`` (optional) — Unique applied policy UUIDs in first occurrence order. Tag references are returned as UUIDs. .. js:attribute:: InstanceNetworkingResponse.effectivePolicy ``NetworkPolicyCreateRequest | null`` (optional) — The final combined network rules that will be applied to the operation. New instances always include an explicit effective policy, including when no policy references are specified. Omitting ``networking.policy`` or passing ``policy: []`` allows all IPv4 and global unicast IPv6 destinations on all ports: this field contains four rules, TCP and UDP for both ``0.0.0.0/0`` (IPv4) and ``2000::/3`` (IPv6), with ``ports: []`` on each rule. ICMP is also allowed to these destinations. IPv6 destinations outside ``2000::/3`` require explicit policy rules. Selecting only empty policies (``{"cidrs": []}``) instead produces ``{"cidrs": []}``, which denies all network traffic. Empty policies add no permissions when combined with non-empty policies. Historical instance metadata may omit this field or contain null. .. js:class:: NetworkPolicyTag(fields?) .. js:attribute:: NetworkPolicyTag.tag ``string`` (required) — Network policy tag name .. js:attribute:: NetworkPolicyTag.uuid ``string`` (required) .. js:class:: NetworkPolicy(fields?) .. js:attribute:: NetworkPolicy.uuid ``string`` (required) .. js:attribute:: NetworkPolicy.cidrs ``NetworkPolicyCIDRRule[]`` (required) .. js:class:: NetworkPolicyListItemSummary(fields?) .. js:attribute:: NetworkPolicyListItemSummary.cidrs ``number`` (required) — Number of CIDR rules in the policy, including repeated CIDRs. .. js:class:: NetworkPolicyListItem(fields?) .. js:attribute:: NetworkPolicyListItem.uuid ``string`` (required) .. js:attribute:: NetworkPolicyListItem.createdAt ``Date`` (required) — Time when the policy was created. .. js:attribute:: NetworkPolicyListItem.tags ``string[]`` (required) — Accessible tag names resolving to this policy, sorted by name. Empty when none exist. .. js:attribute:: NetworkPolicyListItem.summary ``NetworkPolicyListItemSummary`` (required) .. js:class:: NetworkPolicyListResponse(fields?) .. js:attribute:: NetworkPolicyListResponse.policies ``NetworkPolicyListItem[]`` (required) .. js:class:: ExecSpec(fields?) Process-execution surface shared between ``InstanceSpawnRequest`` (the main process) and ``POST /operations/{operationId}/subprocesses`` (additional subprocesses). VM-level concerns (image, hostname, disk limits, files, timeout, disposable, preserveEnv) live on ``InstanceSpawnRequest`` only. .. js:attribute:: ExecSpec.command ``string`` (required) — The command to execute. Same semantics as in ``InstanceSpawnRequest.command`` — when ``shell=true`` it is a shell expression, otherwise a path to an executable. Example: ``/bin/app``. .. js:attribute:: ExecSpec.resourcesLimits ``ProcessResourcesLimits`` (optional) .. js:attribute:: ExecSpec.args ``string[]`` (optional) — Arguments to pass to the command if shell is set to false. Example: ``["arg1","arg2"]``. .. js:attribute:: ExecSpec.shell ``boolean`` (optional) — Run command through a shell expression (args must be empty). .. js:attribute:: ExecSpec.env ``Record | null`` (optional) — Environment variables to set in the child process. .. js:attribute:: ExecSpec.cwd ``string`` (optional) — Working directory; empty string means image / server default. .. js:attribute:: ExecSpec.uid ``number`` (optional) — User ID to run the process as. .. js:attribute:: ExecSpec.gid ``number`` (optional) — Group ID to run the process as. .. js:attribute:: ExecSpec.stdin ``ClosableStreamRepr`` (optional) — Bytes fed to the child's stdin — honored for both the main process and exec'd subprocesses. With ``close=false`` the pipe stays open and more data can be written via ``POST /operations/{operationId}/subprocesses/{spid}/stdin``. .. js:attribute:: ExecSpec.truncateOutputAt ``number`` (optional) — Maximum number of bytes to keep per stream (stdout, stderr, and stdin) in the subprocess event log. Does not affect delivery to the child — stdin is always delivered in full regardless of this cap. Defaults to 1 MiB; capped at 10 MiB. Example: ``65535``. .. js:class:: FileSpec(fields?) .. js:attribute:: FileSpec.uuid ``string`` (optional) .. js:attribute:: FileSpec.uid ``number`` (optional) — User ID Example: ``0``. .. js:attribute:: FileSpec.gid ``number`` (optional) — Group ID Example: ``0``. .. js:attribute:: FileSpec.mode ``string | number`` (optional) — File mode in octal format (e.g., "0644") Example: ``0644``. .. js:class:: InstanceSpawnRequest(fields?) .. js:attribute:: InstanceSpawnRequest.command ``string`` (required) — The command to execute. In case if ``shell`` is set to ``true``, this MUST contain shell expression. For example ``echo hello world`` or ``ls -l /app``. If ``shell`` is set to ``false``, this must be a relative or absolute path to the executable inside the image rootfs. For example: ``/bin/app`` or ``/usr/bin/find``. Do not forget pass necessary ``PATH`` variable to env field, by default ``PATH`` is set to ``/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin``. Example: ``/bin/app``. .. js:attribute:: InstanceSpawnRequest.image ``string`` (required) .. js:attribute:: InstanceSpawnRequest.disposable ``boolean`` (optional) — Creates a disposable execution environment no any state will be saved. .. js:attribute:: InstanceSpawnRequest.hostname ``string`` (optional) — Hostname to set when execution. Example: ``container-name``. .. js:attribute:: InstanceSpawnRequest.args ``string[]`` (optional) — Arguments to pass to the command if shell is set to false. Example: ``["arg1","arg2"]``. .. js:attribute:: InstanceSpawnRequest.shell ``boolean`` (optional) — Whether to run the command through a shell. If ``true``, the command must be a shell expression and all values from args will be ignored. If ``false``, the command field must be a path to an executable and args will be used. When ``true``, environment variables from the image are automatically inherited. When ``false``, they are not - use the ``env`` field to pass them explicitly. .. js:attribute:: InstanceSpawnRequest.env ``Record | null`` (optional) — Environment variables to set in the container. These are merged with image-defined variables when ``shell`` is ``true``. When ``shell`` is ``false``, only variables specified here are available - image-defined variables are not inherited. Example: ``{"KEY1":"value1","KEY2":"value2"}``. .. js:attribute:: InstanceSpawnRequest.preserveEnv ``boolean`` (optional) — Preserve environment variables in resulting image after execution. When ``true``, the image's existing environment variables from ``metadata/env`` are merged with user-provided ``env`` values (user values take priority on conflicts), and the combined result is written back to ``metadata/env`` after command execution. Setting a variable to an empty string or ``null`` removes it from the preserved environment. .. js:attribute:: InstanceSpawnRequest.preserveCwd ``boolean`` (optional) — Save the resolved initial working directory as the default in the resulting image. An empty or omitted ``cwd`` resolves to the image's current workdir, or ``/`` if none exists. The metadata file is opened for writing only when its contents differ from the new value. Directory changes made by the command do not change the saved value. Requires ``disposable: false`` to retain the metadata in a resulting image. .. js:attribute:: InstanceSpawnRequest.cwd ``string`` (optional) — Path to the working directory, must be absolute or a special value the empty string. It means the default working directory of the image or server default will be used. If field is omitted it will be set to the empty string. The directory will be created automatically if it does not exist. Example: ``/app``. .. js:attribute:: InstanceSpawnRequest.uid ``number`` (optional) — User ID to run the process as. Example: ``0``. .. js:attribute:: InstanceSpawnRequest.gid ``number`` (optional) — Group ID to run the process as. Example: ``0``. .. js:attribute:: InstanceSpawnRequest.resourcesLimits ``InstanceResourcesLimits`` (optional) .. js:attribute:: InstanceSpawnRequest.networking ``InstanceNetworking`` (optional) .. js:attribute:: InstanceSpawnRequest.stdin ``ClosableStreamRepr`` (optional) .. js:attribute:: InstanceSpawnRequest.timeout ``number`` (optional) — Maximum execution time in seconds Example: ``60``. .. js:attribute:: InstanceSpawnRequest.truncateOutputAt ``number`` (optional) — Maximum number of bytes to keep per stream (stdout, stderr, and stdin) in the subprocess event log. Does not affect stdin delivery to the child, which always receives the complete stream regardless of this cap. Default is ``1048576`` (1 MiB). The maximum value is ``10485760`` (10 MiB). Example: ``65535``. .. js:attribute:: InstanceSpawnRequest.files ``Record`` (optional) — Map of absolute file paths to file metadata Example: ``{"/root/hello.txt":{"uuid":"a9165a5d-5c86-4bd8-8ee4-ae46c...``. .. js:class:: InstanceResultResources(fields?) .. js:attribute:: InstanceResultResources.blockInput ``number`` (optional) — Block input operations .. js:attribute:: InstanceResultResources.blockOutput ``number`` (optional) — Block output operations .. js:attribute:: InstanceResultResources.cost ``number`` (optional) — Operation cost .. js:attribute:: InstanceResultResources.elapsedTime ``number`` (optional) — Elapsed wall time .. js:attribute:: InstanceResultResources.involuntarySwitches ``number`` (optional) — Number of involuntary context switches .. js:attribute:: InstanceResultResources.maxRss ``number`` (optional) — Maximum resident set size in KB .. js:attribute:: InstanceResultResources.monotonicTime ``number`` (optional) — Monotonic time measurement .. js:attribute:: InstanceResultResources.pageFaults ``number`` (optional) — Number of page faults .. js:attribute:: InstanceResultResources.pageFaultsIo ``number`` (optional) — Number of page faults requiring I/O .. js:attribute:: InstanceResultResources.sharedMemory ``number`` (optional) — Shared memory size .. js:attribute:: InstanceResultResources.signals ``number`` (optional) — Number of signals received .. js:attribute:: InstanceResultResources.swaps ``number`` (optional) — Number of swaps .. js:attribute:: InstanceResultResources.systemCpuTime ``number`` (optional) — System CPU time used .. js:attribute:: InstanceResultResources.unsharedMemory ``number`` (optional) — Unshared memory size .. js:attribute:: InstanceResultResources.userCpuTime ``number`` (optional) — User CPU time used .. js:attribute:: InstanceResultResources.voluntarySwitches ``number`` (optional) — Number of voluntary context switches .. js:class:: InstanceResultState(fields?) .. js:attribute:: InstanceResultState.continued ``boolean`` (optional) — Whether the process was continued from a stop .. js:attribute:: InstanceResultState.coreDump ``boolean`` (optional) — Whether a core dump was generated .. js:attribute:: InstanceResultState.exitCode ``number`` (optional) — Process exit code .. js:attribute:: InstanceResultState.pid ``number`` (optional) — Process ID .. js:attribute:: InstanceResultState.signal ``number`` (optional) — Signal that caused termination, if any .. js:attribute:: InstanceResultState.stopped ``boolean`` (optional) — Whether the process was stopped .. js:attribute:: InstanceResultState.timedOut ``boolean`` (optional) — Whether process had been killed because operation timeout was reached .. js:attribute:: InstanceResultState.oomKilled ``boolean`` (optional) — Whether an OOM kill was observed in the process tree's cgroup. .. js:class:: InstanceResult(fields?) Result of an instance execution .. js:attribute:: InstanceResult.resources ``InstanceResultResources`` (optional) .. js:attribute:: InstanceResult.state ``InstanceResultState`` (optional) .. js:attribute:: InstanceResult.stdout ``StreamRepr`` (optional) .. js:attribute:: InstanceResult.stderr ``StreamRepr`` (optional) .. js:class:: InstanceSpawnResponse(fields?) .. js:attribute:: InstanceSpawnResponse.uuid ``string`` (optional) .. js:attribute:: InstanceSpawnResponse.command ``string`` (optional) .. js:attribute:: InstanceSpawnResponse.image ``string`` (optional) .. js:attribute:: InstanceSpawnResponse.hostname ``string`` (optional) .. js:attribute:: InstanceSpawnResponse.args ``string[]`` (optional) .. js:attribute:: InstanceSpawnResponse.shell ``boolean`` (optional) .. js:attribute:: InstanceSpawnResponse.env ``Record | null`` (optional) .. js:attribute:: InstanceSpawnResponse.preserveEnv ``boolean`` (optional) .. js:attribute:: InstanceSpawnResponse.cwd ``string`` (optional) .. js:attribute:: InstanceSpawnResponse.uid ``number`` (optional) .. js:attribute:: InstanceSpawnResponse.gid ``number`` (optional) .. js:attribute:: InstanceSpawnResponse.resourcesLimits ``InstanceResourcesLimits`` (optional) .. js:attribute:: InstanceSpawnResponse.networking ``InstanceNetworkingResponse`` (optional) .. js:attribute:: InstanceSpawnResponse.stdin ``ClosableStreamRepr`` (optional) .. js:attribute:: InstanceSpawnResponse.timeout ``number`` (optional) .. js:attribute:: InstanceSpawnResponse.truncateOutputAt ``number`` (optional) .. js:attribute:: InstanceSpawnResponse.disposable ``boolean`` (optional) .. js:attribute:: InstanceSpawnResponse.files ``Record`` (optional) .. js:attribute:: InstanceSpawnResponse.result ``InstanceResult | null`` (optional) .. js:class:: OperationSummary(fields?) .. js:attribute:: OperationSummary.uuid ``string`` (optional) .. js:attribute:: OperationSummary.kind ``"image_import" | "instance"`` (optional) — Type of the operation .. js:attribute:: OperationSummary.status ``OperationStatus`` (optional) — Current state of the instance operation Example: ``success``. .. js:attribute:: OperationSummary.error ``string | null`` (optional) — Error message if the operation failed Example: ``Container image not found``. .. js:attribute:: OperationSummary.createdAt ``string`` (optional) — ISO 8601 formatted timestamp when the operation was created Example: ``2024-01-01T12:00:00+00:00``. .. js:attribute:: OperationSummary.duration ``number | null`` (optional) — Operation duration in seconds .. js:attribute:: OperationSummary.imageSize ``number | null`` (optional) — Bytes written for the resulting image/layer(s). ``null`` when not measured (e.g. disposable instance, non-SUCCESS operations). .. js:attribute:: OperationSummary.consumedCpu ``number | null`` (optional) — Total CPU time consumed by the operation, in seconds. ``null`` when not measured. .. js:attribute:: OperationSummary.consumedMemory ``number | null`` (optional) — Peak resident memory used by the operation's execution environment, in KiB. ``null`` when not measured. Shared resident pages are included. .. js:attribute:: OperationSummary.imageUuid ``string | null`` (optional) — UUID of the source image this operation was run on. Set for INSTANCE operations, ``null`` for IMAGE_IMPORT. .. js:attribute:: OperationSummary.resultImageUuid ``string | null`` (optional) — UUID of the image produced by this operation. Only set for completed (SUCCESS) operations, ``null`` otherwise. .. js:class:: OperationInstanceMetadata(fields?) .. js:attribute:: OperationInstanceMetadata.command ``string`` (required) — The command to execute. In case if ``shell`` is set to ``true``, this MUST contain shell expression. For example ``echo hello world`` or ``ls -l /app``. If ``shell`` is set to ``false``, this must be a relative or absolute path to the executable inside the image rootfs. For example: ``/bin/app`` or ``/usr/bin/find``. Do not forget pass necessary ``PATH`` variable to env field, by default ``PATH`` is set to ``/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin``. Example: ``/bin/app``. .. js:attribute:: OperationInstanceMetadata.image ``string`` (required) .. js:attribute:: OperationInstanceMetadata.disposable ``boolean`` (optional) — Creates a disposable execution environment no any state will be saved. .. js:attribute:: OperationInstanceMetadata.hostname ``string`` (optional) — Hostname to set when execution. Example: ``container-name``. .. js:attribute:: OperationInstanceMetadata.args ``string[]`` (optional) — Arguments to pass to the command if shell is set to false. Example: ``["arg1","arg2"]``. .. js:attribute:: OperationInstanceMetadata.shell ``boolean`` (optional) — Whether to run the command through a shell. If ``true``, the command must be a shell expression and all values from args will be ignored. If ``false``, the command field must be a path to an executable and args will be used. When ``true``, environment variables from the image are automatically inherited. When ``false``, they are not - use the ``env`` field to pass them explicitly. .. js:attribute:: OperationInstanceMetadata.env ``Record | null`` (optional) — Environment variables to set in the container. These are merged with image-defined variables when ``shell`` is ``true``. When ``shell`` is ``false``, only variables specified here are available - image-defined variables are not inherited. Example: ``{"KEY1":"value1","KEY2":"value2"}``. .. js:attribute:: OperationInstanceMetadata.preserveEnv ``boolean`` (optional) — Preserve environment variables in resulting image after execution. When ``true``, the image's existing environment variables from ``metadata/env`` are merged with user-provided ``env`` values (user values take priority on conflicts), and the combined result is written back to ``metadata/env`` after command execution. Setting a variable to an empty string or ``null`` removes it from the preserved environment. .. js:attribute:: OperationInstanceMetadata.preserveCwd ``boolean`` (optional) — Save the resolved initial working directory as the default in the resulting image. An empty or omitted ``cwd`` resolves to the image's current workdir, or ``/`` if none exists. The metadata file is opened for writing only when its contents differ from the new value. Directory changes made by the command do not change the saved value. Requires ``disposable: false`` to retain the metadata in a resulting image. .. js:attribute:: OperationInstanceMetadata.cwd ``string`` (optional) — Path to the working directory, must be absolute or a special value the empty string. It means the default working directory of the image or server default will be used. If field is omitted it will be set to the empty string. The directory will be created automatically if it does not exist. Example: ``/app``. .. js:attribute:: OperationInstanceMetadata.uid ``number`` (optional) — User ID to run the process as. Example: ``0``. .. js:attribute:: OperationInstanceMetadata.gid ``number`` (optional) — Group ID to run the process as. Example: ``0``. .. js:attribute:: OperationInstanceMetadata.resourcesLimits ``InstanceResourcesLimits`` (optional) .. js:attribute:: OperationInstanceMetadata.networking ``InstanceNetworkingResponse`` (optional) .. js:attribute:: OperationInstanceMetadata.stdin ``ClosableStreamRepr`` (optional) .. js:attribute:: OperationInstanceMetadata.timeout ``number`` (optional) — Maximum execution time in seconds Example: ``60``. .. js:attribute:: OperationInstanceMetadata.truncateOutputAt ``number`` (optional) — Maximum number of bytes to keep per stream (stdout, stderr, and stdin) in the subprocess event log. Does not affect stdin delivery to the child, which always receives the complete stream regardless of this cap. Default is ``1048576`` (1 MiB). The maximum value is ``10485760`` (10 MiB). Example: ``65535``. .. js:attribute:: OperationInstanceMetadata.files ``Record`` (optional) — Map of absolute file paths to file metadata Example: ``{"/root/hello.txt":{"uuid":"a9165a5d-5c86-4bd8-8ee4-ae46c...``. .. js:attribute:: OperationInstanceMetadata.result ``InstanceResult`` (optional) .. js:class:: OperationResult(fields?) Result of the operation, if any .. js:attribute:: OperationResult.image ``string | null`` (optional) .. js:attribute:: OperationResult.tag ``string | null`` (optional) — Tag assigned to the imported image Example: ``busybox:latest``. .. js:class:: OperationResponse(fields?) .. js:attribute:: OperationResponse.uuid ``string`` (optional) .. js:attribute:: OperationResponse.kind ``"image_import" | "instance"`` (optional) — Type of the operation .. js:attribute:: OperationResponse.status ``OperationStatus`` (optional) .. js:attribute:: OperationResponse.error ``string | null`` (optional) .. js:attribute:: OperationResponse.createdAt ``string`` (optional) — ISO 8601 formatted timestamp when the operation was created Example: ``2024-01-01T12:00:00+00:00``. .. js:attribute:: OperationResponse.duration ``number | null`` (optional) .. js:attribute:: OperationResponse.imageSize ``number | null`` (optional) — Bytes written for the resulting image/layer(s). ``null`` when not measured (e.g. disposable instance, non-SUCCESS operations). .. js:attribute:: OperationResponse.consumedCpu ``number | null`` (optional) — Total CPU time consumed by the operation, in seconds. ``null`` when not measured. .. js:attribute:: OperationResponse.consumedMemory ``number | null`` (optional) — Peak resident memory used by the operation's execution environment, in KiB. ``null`` when not measured. Shared resident pages are included. .. js:attribute:: OperationResponse.imageUuid ``string | null`` (optional) — UUID of the source image this operation was run on. Set for INSTANCE operations, ``null`` for IMAGE_IMPORT. .. js:attribute:: OperationResponse.resultImageUuid ``string | null`` (optional) — UUID of the image produced by this operation. Only set for completed (SUCCESS) operations, ``null`` otherwise. .. js:attribute:: OperationResponse.metadata ``OperationInstanceMetadata | ImageImportMetadata`` (optional) .. js:attribute:: OperationResponse.result ``OperationResult`` (optional) — Result of the operation, if any .. js:class:: Error(fields?) .. js:attribute:: Error.error ``unknown`` (required) — Error message or structured validation errors Example: ``Some error occurred, this is an example of error message``. .. js:attribute:: Error.status ``number`` (optional) — HTTP status code Example: ``500``. .. js:attribute:: Error.traceback ``string[]`` (optional) .. js:class:: FileResponse(fields?) .. js:attribute:: FileResponse.uuid ``string`` (required) .. js:attribute:: FileResponse.sha256 ``string`` (required) — SHA256 hash of the file content Example: ``e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7...``. .. js:attribute:: FileResponse.size ``number`` (required) — File size in bytes; -1 if unknown Example: ``1024``. .. js:class:: File(fields?) .. js:attribute:: File.uuid ``string`` (required) .. js:attribute:: File.sha256 ``string`` (required) — SHA256 hash of the file content .. js:attribute:: File.size ``number`` (required) — File size in bytes; -1 if unknown Example: ``1024``. .. js:attribute:: File.createdAt ``Date`` (required) — When the file was first uploaded by this namespace .. js:attribute:: File.updatedAt ``Date`` (required) — Updated on each upload of the same file .. js:class:: FilesListResponse(fields?) .. js:attribute:: FilesListResponse.files ``File[]`` (optional) .. js:class:: WhoAmIResponse(fields?) .. js:attribute:: WhoAmIResponse.tokenUuid ``string`` (required) — UUID of the authentication token Example: ``a1b2c3d4-e5f6-7890-abcd-ef1234567890``. .. js:attribute:: WhoAmIResponse.tokenExpiration ``number | null`` (required) — Token expiration time as Unix timestamp, or null if not set Example: ``1735689600``. .. js:attribute:: WhoAmIResponse.permissions ``Record`` (required) — Map of all known permission names to their granted status. Keys are permission names (e.g., ``import``, ``spawn``, ``list``), values indicate whether the token has the permission. Example: ``{"import":true,"spawn":true,"spawn_disposable":false,"lis...``. .. js:attribute:: WhoAmIResponse.operationsStat ``Record`` (required) — Operation statistics (reserved for future use) .. js:attribute:: WhoAmIResponse.limits ``Record`` (optional) — Map of resource limit names to their values for the current token. Example: ``{"instance_max_timeout":3600,"instance_max_concurrency":1...``. .. js:class:: OperationEvent(fields?) One event in the operation's event log. **Process events** carry a Spawned Process ID (``spid``) as their routing identity: ``spid=0`` is the daemon (init / network / shutdown / size_cap, plus any synthetic stderr emitted before a child existed), ``spid=1`` is the main process from ``InstanceMetadata``, and ``spid>=2`` are exec'd children (Phase 3+). Spids are Registry-assigned, monotonic, and never recycled within an operation; the kernel PID (when needed for debugging) lives inside the per-type ``data`` payload. **System events** (``completion``) describe the operation as a whole, not a specific child process — they omit ``spid`` entirely. .. js:attribute:: OperationEvent.id ``number`` (required) — Sequential id assigned at append time. Strictly increasing within a single operation's event log; gaps are possible (rare, after a transient producer-side serialization failure). Use this with ``Last-Event-Id`` / ``?since=`` to resume a dropped SSE stream. Example: ``42``. .. js:attribute:: OperationEvent.ts ``Date`` (required) — UTC wall-clock time when the event was emitted. Example: ``2026-06-08T20:00:00.123456789Z``. .. js:attribute:: OperationEvent.type ``OperationEventType`` (required) .. js:attribute:: OperationEvent.data ``EventData | Record`` (required) — Per-type payload. Clients should switch on ``type`` and validate ``data`` against the corresponding schema below. .. js:attribute:: OperationEvent.spid ``number`` (optional) — Spawned Process ID — present on process-scoped events (``init``, ``spawn``, ``stdin``, ``stdout``, ``stderr``, ``exit``, ``truncated``, ``size_cap``, ``network``, ``shutdown``, ``inspect``, ``file_upload``). Absent on operation-scoped system events (``completion``), which don't tie to a specific child. Example: ``1``. .. js:class:: EventInspectParametersOptions(fields?) .. js:attribute:: EventInspectParametersOptions.patterns ``string[] | null`` (required) .. js:attribute:: EventInspectParametersOptions.globs ``string[] | null`` (required) .. js:attribute:: EventInspectParametersOptions.case ``string`` (required) .. js:attribute:: EventInspectParametersOptions.maxCount ``number`` (required) .. js:attribute:: EventInspectParametersOptions.maxTotal ``number`` (required) .. js:attribute:: EventInspectParametersOptions.before ``number`` (required) .. js:attribute:: EventInspectParametersOptions.after ``number`` (required) .. js:class:: EventInspectParameters(fields?) Parameters for the method named in EventDataInspect. Path methods (stat/list/open/archive/grep/upload) record path. Grep also records options. Upload records fileUuid, unpack, replace, and merge. Read/write record handle, offset, and size; write size is the input chunk length, not an acknowledgement. Close/finish record handle. Binary payloads are excluded. .. js:attribute:: EventInspectParameters.path ``string`` (optional) .. js:attribute:: EventInspectParameters.fileUuid ``string`` (optional) .. js:attribute:: EventInspectParameters.unpack ``boolean`` (optional) .. js:attribute:: EventInspectParameters.replace ``boolean`` (optional) .. js:attribute:: EventInspectParameters.merge ``boolean`` (optional) .. js:attribute:: EventInspectParameters.handle ``string`` (optional) .. js:attribute:: EventInspectParameters.offset ``number`` (optional) .. js:attribute:: EventInspectParameters.size ``number`` (optional) .. js:attribute:: EventInspectParameters.options ``EventInspectParametersOptions`` (optional) .. js:class:: EventDataInspect(fields?) Metadata for a guest inspect RPC. Init emits a started/completed pair with the same requestId. Event IDs order the starts independently of completion order. A returned handle links subsequent reads, writes, finish, close, and file_upload events. All events use spid=0. Request parameters are recorded even when the method rejects them. A successful open/upload only allocates a handle; it does not complete the transfer. Read events report RPC bytes, not HTTP client receipt. File contents, directory listings, and grep matches are never recorded. Events are flushed to the journal and bypass the stream size cap. A missing completion can indicate an interrupted or lost event. These records support a future replay implementation; replay is not automatic. .. js:attribute:: EventDataInspect.requestId ``string`` (required) — Opaque identifier shared by the request and result events. .. js:attribute:: EventDataInspect.method ``"stat" | "list" | "open" | "archive" | "grep" | "read" | "close" | "upload" | "write" | "finish"`` (required) .. js:attribute:: EventDataInspect.phase ``"started" | "completed"`` (required) .. js:attribute:: EventDataInspect.params ``EventInspectParameters`` (optional) .. js:attribute:: EventDataInspect.status ``"success" | "error" | "cancelled" | "timeout"`` (optional) .. js:attribute:: EventDataInspect.error ``string | null`` (optional) — Error category only; null on success. No exception text or file contents. .. js:attribute:: EventDataInspect.handle ``string`` (optional) — Present after a successful open, archive, grep, or upload. .. js:attribute:: EventDataInspect.bytes ``number`` (optional) — Bytes returned by a successful read. .. js:attribute:: EventDataInspect.eof ``boolean`` (optional) — Present after a successful read; true at the end of its stream. .. js:class:: EventDataFileUpload(fields?) Init emits this event once after publication or cleanup of an accepted upload. It is emitted even if the host disconnects or Finish loses its response. A rejected upload has only its inspect request/result pair. Success means publication finished. Error or cancellation can leave a partially applied merge, as specified by the upload endpoint. The event contains metadata only, uses spid=0, bypasses the stream size cap, and is flushed before shutdown. Recording does not extend the source file's TTL or guarantee its availability for future replay. .. js:attribute:: EventDataFileUpload.handle ``string`` (required) .. js:attribute:: EventDataFileUpload.fileUuid ``string`` (required) .. js:attribute:: EventDataFileUpload.path ``string`` (required) — Clean absolute destination path. .. js:attribute:: EventDataFileUpload.unpack ``boolean`` (required) .. js:attribute:: EventDataFileUpload.replace ``boolean`` (required) .. js:attribute:: EventDataFileUpload.merge ``boolean`` (required) .. js:attribute:: EventDataFileUpload.bytes ``number`` (required) — Source bytes consumed from the upload pipe, including on failure. For an archive, counts compressed/source bytes, not extracted bytes. This is not a count of bytes successfully published to the destination. .. js:attribute:: EventDataFileUpload.status ``"success" | "error" | "cancelled" | "timeout"`` (required) .. js:attribute:: EventDataFileUpload.error ``string | null`` (required) — Error category only; null on success. .. js:class:: EventDataInit(fields?) Operation-level startup snapshot. ``hostname``, ``kernel``, ``machine``, ``bootId`` are best-effort — omitted if the environment couldn't provide them. .. js:attribute:: EventDataInit.startedAt ``Date`` (required) — Example: ``2026-06-08T20:00:00.000000000Z``. .. js:attribute:: EventDataInit.runtimePath ``string`` (required) — Internal runtime directory for the operation. Example: ``/run/contreeinitd``. .. js:attribute:: EventDataInit.verbose ``boolean`` (required) — Example: ``false``. .. js:attribute:: EventDataInit.initPid ``number`` (required) — PID of the operation's init process. Example: ``1``. .. js:attribute:: EventDataInit.hostname ``string`` (optional) — Example: ``vm-abc123``. .. js:attribute:: EventDataInit.kernel ``string`` (optional) — uname release + version, space-separated. Example: ``6.10.0-generic #1 SMP PREEMPT``. .. js:attribute:: EventDataInit.machine ``string`` (optional) — Example: ``x86_64``. .. js:attribute:: EventDataInit.bootId ``string`` (optional) — Operation-unique boot identifier. Example: ``5e0a3f24-7c2d-4f50-8e1d-9b3c8d7e6a4f``. .. js:class:: EventDataSpawn(fields?) Process spawn parameters. ``env`` values for keys ending in TOKEN/SECRET/PASSWORD/API_KEY/CREDENTIALS/AUTHORIZATION are replaced with the literal string ```` before emission. .. js:attribute:: EventDataSpawn.pid ``number`` (required) — PID assigned to the process. Example: ``4242``. .. js:attribute:: EventDataSpawn.command ``string`` (required) — Example: ``/bin/sh``. .. js:attribute:: EventDataSpawn.args ``string[]`` (required) — Example: ``["-c","echo hi"]``. .. js:attribute:: EventDataSpawn.shell ``boolean`` (required) — If true, the command is wrapped in `` -c `` (so the args / command may differ from the user's input). Example: ``true``. .. js:attribute:: EventDataSpawn.cwd ``string`` (required) — Example: ``/work``. .. js:attribute:: EventDataSpawn.uid ``number`` (required) — Example: ``1000``. .. js:attribute:: EventDataSpawn.gid ``number`` (required) — Example: ``1000``. .. js:attribute:: EventDataSpawn.timeout ``number`` (required) — Per-process SIGKILL deadline in seconds. Example: ``60``. .. js:attribute:: EventDataSpawn.truncateAt ``number`` (required) — Per-stream cap (bytes) above which stdout/stderr/stdin chunks stop being emitted and the stream's ``truncated`` event fires on EOF. Example: ``1048576``. .. js:attribute:: EventDataSpawn.resourcesLimits ``ProcessResourcesLimits`` (optional) .. js:attribute:: EventDataSpawn.cpuAffinity ``number[]`` (optional) — Effective guest vCPU IDs available to this process tree. .. js:attribute:: EventDataSpawn.env ``Record`` (optional) — Environment as passed to the process. Values for secret-suffix keys are replaced with ````. Example: ``{"PATH":"/usr/bin:/bin","DATABASE_PASSWORD":""}``. .. js:class:: EventDataStream(fields?) Payload for ``stdin`` / ``stdout`` / ``stderr`` events. Encoding is ``ascii`` when every byte is printable plus ``\\n`` / ``\\r`` / ``\\t``; ``base64`` otherwise. Chunks are at most a few KB each — the natural read granularity from a pipe. .. js:attribute:: EventDataStream.value ``string`` (required) — Example: ``hello world``. .. js:attribute:: EventDataStream.encoding ``"ascii" | "base64"`` (required) — Example: ``ascii``. .. js:attribute:: EventDataStream.truncated ``boolean`` (optional) — Always ``false`` on per-chunk stream events. When a stream crosses its per-stream cap a separate ``truncated``-type event is emitted on EOF carrying the cumulative emitted/dropped totals. Example: ``false``. Codec helpers: ``asBytes()``, ``asText()``, ``EventDataStream.fromBytes(bytes)``, ``EventDataStream.fromText(text)``. ``toString()`` delegates to ``asText()`` with the default format. .. js:class:: EventResources(fields?) Resource usage snapshot for the process. Time fields are in microseconds; memory in kilobytes (maxRssKb) or platform-specific units (sharedMemory / unsharedMemory). Some kernels populate fewer fields than others; expect zeroes for unsupported counters. .. js:attribute:: EventResources.userTimeUs ``number`` (required) .. js:attribute:: EventResources.sysTimeUs ``number`` (required) .. js:attribute:: EventResources.maxRssKb ``number`` (required) .. js:attribute:: EventResources.sharedMemory ``number`` (required) .. js:attribute:: EventResources.unsharedMemory ``number`` (required) .. js:attribute:: EventResources.swaps ``number`` (required) .. js:attribute:: EventResources.minorFaults ``number`` (required) .. js:attribute:: EventResources.majorFaults ``number`` (required) .. js:attribute:: EventResources.voluntaryCtxSwitches ``number`` (required) .. js:attribute:: EventResources.involuntaryCtxSwitches ``number`` (required) .. js:attribute:: EventResources.blockInputOps ``number`` (required) .. js:attribute:: EventResources.blockOutputOps ``number`` (required) .. js:attribute:: EventResources.ipcMsgsSent ``number`` (required) .. js:attribute:: EventResources.ipcMsgsReceived ``number`` (required) .. js:attribute:: EventResources.signalsReceived ``number`` (required) .. js:class:: EventDataExit(fields?) Process lifecycle close-out. Carries the exit code OR the kill signal (signal = -1 means normal exit), the ``timedOut`` flag (true only when the process's per-process timeout fired — distinguishes from an external signal/kill), wall-clock duration, and a snapshot of resource usage. .. js:attribute:: EventDataExit.pid ``number`` (required) — PID of the process that just exited. Example: ``4242``. .. js:attribute:: EventDataExit.code ``number`` (required) — Exit code (0..255) if the process exited normally; -1 if killed by signal. Example: ``0``. .. js:attribute:: EventDataExit.signal ``number`` (required) — Signal number if killed by signal; -1 if normal exit. Example: ``-1``. .. js:attribute:: EventDataExit.timedOut ``boolean`` (required) — True only if the process's own timeout fired the kill. An externally-driven kill (``signal`` / ``kill`` / cancel) leaves ``timedOut=false``. Example: ``false``. .. js:attribute:: EventDataExit.durationMs ``number`` (required) — Wall-clock time from spawn to exit. Example: ``1234``. .. js:attribute:: EventDataExit.resources ``EventResources`` (required) .. js:attribute:: EventDataExit.oomKilled ``boolean`` (optional) — An OOM kill was observed in this process tree. Missing in older events. .. js:attribute:: EventDataExit.coreDump ``boolean`` (optional) — True when the terminating signal produced a core dump. Absent in events recorded before the field was added — treat missing as false. Example: ``false``. .. js:class:: EventDataTruncated(fields?) Per-stream summary emitted once on stream EOF when the stream's ``truncateAt`` cap was crossed during its lifetime. Carries the final cumulative emitted/dropped totals (not partial numbers at cap-hit time). Absent if the stream never crossed the cap. .. js:attribute:: EventDataTruncated.stream ``"stdin" | "stdout" | "stderr"`` (required) — Example: ``stdout``. .. js:attribute:: EventDataTruncated.bytesEmitted ``number`` (required) — Bytes that were delivered before the cap kicked in. Example: ``1048576``. .. js:attribute:: EventDataTruncated.bytesDropped ``number`` (required) — Bytes consumed from the producer but suppressed by the cap. Example: ``4096``. .. js:class:: EventDataSizeCap(fields?) Emitted at most once per operation when the cumulative event-log size approached its budget. After this marker, further stream events (``stdin`` / ``stdout`` / ``stderr``) are dropped; service events continue so the lifecycle stays observable. .. js:attribute:: EventDataSizeCap.limitBytes ``number`` (required) — Size budget at which dropping kicked in. Example: ``104857600``. .. js:attribute:: EventDataSizeCap.fileSize ``number`` (required) — Approximate cumulative event-log size at cap-hit. Example: ``104800000``. .. js:class:: NetworkInterface(fields?) .. js:attribute:: NetworkInterface.name ``string`` (required) — Example: ``eth0``. .. js:attribute:: NetworkInterface.rxBytes ``number`` (required) .. js:attribute:: NetworkInterface.rxPackets ``number`` (required) .. js:attribute:: NetworkInterface.rxErrs ``number`` (required) .. js:attribute:: NetworkInterface.rxDrop ``number`` (required) .. js:attribute:: NetworkInterface.txBytes ``number`` (required) .. js:attribute:: NetworkInterface.txPackets ``number`` (required) .. js:attribute:: NetworkInterface.txErrs ``number`` (required) .. js:attribute:: NetworkInterface.txDrop ``number`` (required) .. js:class:: EventDataNetworkConfigured(fields?) Subset of network params that were applied — empty keys are omitted, so the object only carries what was requested. .. js:attribute:: EventDataNetworkConfigured.ip4 ``string`` (optional) — Example: ``10.0.0.5/24``. .. js:attribute:: EventDataNetworkConfigured.ip4Gw ``string`` (optional) — Example: ``10.0.0.1``. .. js:attribute:: EventDataNetworkConfigured.ip6 ``string`` (optional) — Example: ``fc10:c0::33/64``. .. js:attribute:: EventDataNetworkConfigured.ip6Gw ``string`` (optional) — Example: ``fc10:c0::1``. .. js:attribute:: EventDataNetworkConfigured.gwMac ``string`` (optional) — Gateway MAC address. Example: ``ee:d0:a7:48:b5:98``. .. js:attribute:: EventDataNetworkConfigured.nameserver ``string`` (optional) — Example: ``8.8.8.8``. .. js:class:: EventDataNetwork(fields?) Per-interface counters plus the configured network state. Emitted once at the end of the network setup phase, so the counters represent the initial baseline. Absent entirely for network-less operations. .. js:attribute:: EventDataNetwork.interfaces ``NetworkInterface[]`` (required) .. js:attribute:: EventDataNetwork.configured ``EventDataNetworkConfigured`` (optional) — Subset of network params that were applied — empty keys are omitted, so the object only carries what was requested. .. js:attribute:: EventDataNetwork.error ``string`` (optional) — Set if the per-interface counter read failed; ``interfaces`` then holds an empty list. Best-effort — failure does not block shutdown. .. js:class:: EventDataShutdown(fields?) Stream-terminating marker emitted right before the operation winds down. Distinct from the ``network`` event so consumers can recognize a clean shutdown without parsing payload- specific data. .. js:attribute:: EventDataShutdown.stoppedAt ``Date`` (required) — Example: ``2026-06-08T20:01:34.567890123Z``. .. js:attribute:: EventDataShutdown.reason ``"job_complete" | "timeout" | "spawn_failed" | "signal"`` (required) — Short categorical reason for the shutdown: * ``job_complete`` — process exited normally; * ``timeout`` — the operation timeout fired; * ``spawn_failed`` — the process couldn't be started; * ``signal`` — terminated by an external signal. Additional categories may be added. .. js:class:: EventDataCompletion(fields?) Terminal system-event payload, emitted once when the operation reaches one of ``SUCCESS``, ``FAILED``, ``CANCELLED``. Carries the operation outcome and rollup counters for the log + image artifacts. Always the last event in the log; the event itself has no ``spid`` (operation-scoped, not process-scoped). .. js:attribute:: EventDataCompletion.status ``OperationStatus`` (required) — Terminal operation status. .. js:attribute:: EventDataCompletion.durationMs ``number`` (required) — Wall-clock duration of the handler in milliseconds. Example: ``4327``. .. js:attribute:: EventDataCompletion.resultImageUuid ``string | null`` (optional) — UUID of the result image the operation produced. Present on every SUCCESS that persists an image — for runs that wrote no new layer, this is the image UUID the operation was spawned from (per the spec). Distinct from the spec uuid only when persist produced a new image. ``null`` for disposable runs (no image was persisted at all) and for FAILED / CANCELLED outcomes. Example: ``019eef27-7ecb-7771-8184-aaf5fa596ce2``. .. js:attribute:: EventDataCompletion.error ``string | null`` (optional) — Short human-readable error message when ``status`` is ``FAILED`` or ``CANCELLED``. ``null`` on success. Example: ``spawn failed: exec /run/entrypoint: no such file``. .. js:attribute:: EventDataCompletion.imageSizeBytes ``number`` (optional) — Size of the result image's runtime layer in bytes. ``0`` for failed/cancelled operations and for disposables (no image persisted). Example: ``134217728``. .. js:attribute:: EventDataCompletion.consumedCpu ``number | null`` (optional) — Total CPU time consumed by the operation, in seconds; null when unmeasured. .. js:attribute:: EventDataCompletion.consumedMemory ``number | null`` (optional) — Peak resident memory used by the operation's execution environment, in KiB; null when unmeasured. .. js:class:: ListNetworkPolicyTagsResponse(fields?) .. js:attribute:: ListNetworkPolicyTagsResponse.tags ``NetworkPolicyTag[]`` (required)