@tikoci/centrs
    Preparing search index...

    Interface ProtocolAdapter

    Runtime transport seam. The orchestrator drives validation and data fetch through these operations so REST and native-api share the same pipeline and envelope shape.

    interface ProtocolAdapter {
        capabilities: ProtocolAdapterCapabilities;
        protocol:
            | "rest-api"
            | "native-api"
            | "mac-telnet"
            | "ssh"
            | "snmp"
            | "mndp"
            | "romon"
            | "winbox-terminal"
            | "btest";
        apiRequest(request: ProtocolApiRequest): Promise<ProtocolApiResult>;
        close(): Promise<void>;
        execute(request: ProtocolExecuteRequest): Promise<ProtocolExecuteResult>;
        getSingleton(path: string): Promise<unknown>;
        inspect(request: "child" | "completion", path: string): Promise<unknown[]>;
        list(path: string, options: RetrieveListOptions): Promise<unknown[]>;
        listen(
            request: ProtocolApiRequest,
            options: ProtocolListenOptions,
        ): AsyncIterable<Record<string, unknown>>;
    }
    Index

    Properties

    Capability flags describing what this adapter supports.

    protocol:
        | "rest-api"
        | "native-api"
        | "mac-telnet"
        | "ssh"
        | "snmp"
        | "mndp"
        | "romon"
        | "winbox-terminal"
        | "btest"

    Transport this adapter speaks.

    Methods

    • Release any underlying connection. Safe to call when never connected.

      Returns Promise<void>

    • Read a single record (singleton menu) as an object.

      Parameters

      • path: string

      Returns Promise<unknown>

    • /console/inspect probe (request=child or request=completion).

      Parameters

      • request: "child" | "completion"
      • path: string

      Returns Promise<unknown[]>

    • Open-ended /listen follow (native-api only). Yields one rest-style change record per !re frame (deletions carry .dead), until cancelled via options.signal or the consumer stopping. REST and console transports reject with transport/capability-unsupported.

      Parameters

      Returns AsyncIterable<Record<string, unknown>>