node-lxc
    Preparing search index...

    Type Alias LXC

    type LXC = {
        Container: Container;
        ConfigItemIsSupported(key: string): boolean;
        GetGlobalConfigItem(key: string): string;
        GetVersion(): string;
        GetWaitStates(): string[];
        HasApiExtension(extension: string): boolean;
        ListAllActiveContainers(lxcpath?: string): string[];
        ListAllContainers(lxcpath?: string): string[];
        ListAllDefinedContainers(lxcpath?: string): string[];
    }
    Index

    Properties

    Container: Container

    Container class constructor. Create a new handle for an LXC container by name.

    {string} Name of the container.

    {string | undefined} Path to the LXC container directory. Defaults to lxc.lxcpath.

    {string | undefined} Path to an alternate configuration file to load.

    Methods

    • Determine whether a specific configuration key is supported by this LXC build. Useful before setting keys that may not exist in older LXC versions.

      Parameters

      • key: string

        {string} Configuration key to test (e.g. "lxc.cap.drop").

      Returns boolean

      true if the key is supported, false otherwise.

    • Retrieve a global LXC configuration item. Common keys include "lxc.lxcpath" (container directory) and "lxc.default_config".

      Parameters

      • key: string

        {string} Global configuration key to retrieve.

      Returns string

      The value of the global configuration item.

    • Return the LXC library version string.

      Returns string

      Version string (e.g. "5.0.3").

    • Return the list of valid container wait-state strings. These are the values accepted by container.wait() and returned by container.state.

      Returns string[]

      Array of state name strings (e.g. ["STOPPED", "STARTING", "RUNNING", ...]).

    • Determine whether a specific LXC API extension is available in this build. Extension names are stable strings such as "container_snapshot_comments", "mount_injection", or "seccomp_notify".

      Parameters

      • extension: string

        {string} Extension name to test.

      Returns boolean

      true if the extension is available, false otherwise.

    • List the names of all currently active (running) containers.

      Parameters

      • Optionallxcpath: string

        {string | undefined} Container directory to search. Defaults to lxc.lxcpath.

      Returns string[]

      Array of container name strings.

    • List the names of all defined and active containers. Equivalent to list_defined_containerslist_active_containers.

      Parameters

      • Optionallxcpath: string

        {string | undefined} Container directory to search. Defaults to lxc.lxcpath.

      Returns string[]

      Array of container name strings.

    • List the names of all defined (configured but not necessarily running) containers. A container is defined if its configuration file exists.

      Parameters

      • Optionallxcpath: string

        {string | undefined} Container directory to search. Defaults to lxc.lxcpath.

      Returns string[]

      Array of container name strings.