pve-client
    Preparing search index...

    Class Client

    Index

    Constructors

    Properties

    Structured API surface generated from the spec. Example:

    client.api.cluster.replication.read({})
    client.api.cluster.replication.id("100-1").read({})
    events: {
        resources: () => TimerPulledEventEmitter<
            Record<
                string,
                {
                    "cgroup-mode"?: number;
                    content?: string;
                    cpu?: number;
                    disk?: number;
                    diskread?: number;
                    diskwrite?: number;
                    hastate?: string;
                    id: string;
                    level?: string;
                    lock?: string;
                    maxcpu?: number;
                    maxdisk?: number;
                    maxmem?: number;
                    mem?: number;
                    memhost?: number;
                    name?: string;
                    netin?: number;
                    netout?: number;
                    network?: string;
                    "network-type"?: "zone"
                    | "fabric";
                    node?: string;
                    plugintype?: string;
                    pool?: string;
                    protocol?: string;
                    sdn?: string;
                    status?: string;
                    storage?: string;
                    tags?: string;
                    template?: boolean;
                    type:
                        | "qemu"
                        | "lxc"
                        | "storage"
                        | "node"
                        | "sdn"
                        | "pool"
                        | "openvz"
                        | "network";
                    uptime?: number;
                    vmid?: number;
                    "zone-type"?: string;
                },
            >,
        >;
        stopListening: () => void;
        tasks: () => TimerPulledEventEmitter<
            Record<
                string,
                {
                    endtime?: number;
                    id: string;
                    node: string;
                    starttime?: number;
                    status?: string;
                    type: string;
                    upid: string;
                    user: string;
                },
            > & {
                task: {
                    endtime?: number;
                    id: string;
                    node: string;
                    starttime?: number;
                    status?: string;
                    type: string;
                    upid: string;
                    user: string;
                };
            },
        >;
    } = ...
    helpers: {
        display: (vmid: string | number) => Display;
        terminal: (vmid: string | number) => Terminal;
    } = ...
    task: {
        listen: (
            upid: string,
            handler?: TaskUpdateHandler,
            checkInterval?: number,
        ) => TaskSubscription;
        wait: (
            upid: string,
            handler?: TaskUpdateHandler,
            checkInterval?: number,
        ) => Promise<string[]>;
    } = ...

    Methods

    • Log in using username/password (ticket + CSRF). Only applicable if you constructed the client with username/password.

      Returns Promise<Client>

    • Typed request function using the ProxmoxAPI mapping.

      • GET/DELETE use $query
      • POST/PUT/PATCH use $body (sent as application/x-www-form-urlencoded, matching Proxmox conventions)
      • Returns json.data when present (Proxmox wraps most results in { data: ... })

      Type Parameters

      • P extends
            | (keyof AccessAPI)
            | (keyof ClusterAPI)
            | (keyof NodesAPI)
            | (keyof PoolsAPI)
            | (keyof StorageAPI)
            | "/version"
      • M extends "GET" | "DELETE" | "POST" | "PUT" | "PATCH"

      Parameters

      • path: P
      • method: M
      • args: Params<P, M>
      • OptionalrequestInit: RequestInit

      Returns Promise<Ret<P, M>>

    • Returns string | undefined

    • Returns string | undefined

    • Parameters

      • path: string
      • Optionalquery: Record<string, any>

      Returns string