Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client

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

Hierarchy

  • Client

Implements

Index

Constructors

constructor

  • 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.

    constructor

    Parameters

    • Optional httpImpl: IOnmsHTTP

      The IOnmsHTTP implementation to use.

    Returns Client

Properties

http

http: IOnmsHTTP

the OnmsHTTP implementation that will be used when making requests

Static Private defaultHttp

defaultHttp: AxiosHTTP = AxiosHTTP

The default OnmsHTTP implementation to be used when making requests

Methods

alarms

connect

  • connect(name: string, url: string, username: string, password: string, timeout?: number): Promise<this>
  • 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<this>

events

flows

nodes

situationfeedback

Static checkServer

  • 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>

Static getMetadata

  • 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>

Generated using TypeDoc