Class Client

The OpenNMS client. This is the primary interface to OpenNMS servers.

Implements

Constructors

  • Construct a new OpenNMS client.

    If no httpImpl parameter is provided, the class in [[Client.defaultHttp]] will be used by default. Unless overridden, this defaults to [[AxiosHTTP]].

    Parameters

    • Optional httpImpl: IOnmsHTTP

      The IOnmsHTTP implementation to use.

    Returns Client

Properties

http: IOnmsHTTP

the OnmsHTTP implementation that will be used when making requests

defaultHttp: typeof AxiosHTTP = AxiosHTTP

The default OnmsHTTP implementation to be used when making requests

Methods

  • Connect to an OpenNMS server.

    NOTE: This method will connect to the server using the provided information, get the server metadata, and then assign that server to the existing [[IOnmsHTTP]] implementation associated with this client (or the default impl, if one has not yet been provided).

    Parameters

    • name: string
    • url: string
    • username: string
    • password: string
    • Optional timeout: number

    Returns Promise<Client>

  • Given an OnmsServer object, check that it can be connected to.

    Parameters

    • server: OnmsServer

      the server to check

    • Optional httpImpl: IOnmsHTTP

      the [[IOnmsHTTP]] implementation to use

    • Optional timeout: number

      how long to wait before giving up when making ReST calls

    Returns Promise<boolean>

  • Given an OnmsServer object, query what capabilities it has, and return the capabilities associated with that server.

    Parameters

    • server: OnmsServer

      the server to check

    • Optional httpImpl: IOnmsHTTP

      the [[IOnmsHTTP]] implementation to use

    • Optional timeout: number

      how long to wait before giving up when making ReST calls

    Returns Promise<ServerMetadata>