OpenNMS.js - v2.6.2-SNAPSHOT
    Preparing search index...

    Class AlarmDAO

    Data access for [[OnmsAlarm]] objects.

    Hierarchy

    Index

    Constructors

    Accessors

    Methods

    • Acknowledge an alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      • Optionaluser: string

        The user to ack the alarm as. (Only administrators have the right to do this.)

      Returns Promise<void>

      ReST v1+

    • Close the ticket associated with the given alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      Returns Promise<void>

      ReST v2

    • Create a trouble ticket for the specified alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      Returns Promise<void>

      ReST v2

    • Delete the journal memo ticket associated with the given alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      Returns Promise<void>

      ReST v2

    • Delete the sticky memo ticket associated with the given alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      Returns Promise<void>

      ReST v2

    • Escalate an alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      Returns Promise<void>

      ReST v1+

    • Find matching alarms.

      Parameters

      • Optionalfilter: Filter

        The filter to use when querying.

      Returns Promise<OnmsAlarm[]>

      An array of [[OnmsAlarm]] objects.

      ReST v1+

    • Finds the values for the given propertyId, if it exists.

      Parameters

      • propertyId: string

        The propertyId to find the values for

      • Optionaloptions: any

        Some additional options. May be implementer dependent, such as limit, or value restrictions

      Returns Promise<any>

      A promise containing the values.

    • Fetch an alarm.

      Parameters

      • id: number

        The alarm's ID.

      Returns Promise<OnmsAlarm>

      An [[OnmsAlarm]].

      ReST v1+

    • Retrieve the API version from the currently configured server.

      Returns number

    • A convenience method to make it easy for implementers to extract the count (or totalCount) values from response data.

      Parameters

      • data: any
      • Optionalstatus: number

      Returns number

    • Returns or creates a cache of properties for this dao.

      Returns Promise<any>

      the cache for this dao. It is created if it does not exist.

    • Fetches the data from the result and verfifes that the dataFieldName exists in the data property. If it does not exist, an exception is thrown.

      Parameters

      • result: any

        The result to fetch the data from

      • dataFieldName: string

        The property name (basically result.data[dataFieldName].

      • path: string

        The path where the result was fetched from. This is for error handling

      • mapCallbackFunction: any

        Callback function to convert each entry from result.data[dataFieldName].

      Returns any[]

    • Create or update the journal memo associated with the alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      • body: string

        The memo body

      • Optionaluser: string

        The user to update the memo as. (Only administrators have the right to do this.)

      Returns Promise<void>

      ReST v2

    • Create or update the sticky memo associated with the alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      • body: string

        The memo body

      • Optionaluser: string

        The user to update the memo as. (Only administrators have the right to do this.)

      Returns Promise<void>

      ReST v2

    • Gets the property identified by the id if it exists.

      Parameters

      • id: string

        The id to search the property by.

      Returns Promise<SearchProperty>

    • The path to the alarm search properties endpoint.

      Returns string

    • Associate a ticket ID with the alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      • ticketId: string

        The ticket ID.

      Returns Promise<void>

      ReST v1+

    • Convert the given value to a date, or undefined if it cannot be converted.

      Parameters

      • from: any

      Returns Moment

      use [[Util.toDate]] instead.

    • Convert the given value to a number, or undefined if it cannot be converted.

      Parameters

      • from: any

      Returns number

      use [[Util.toNumber]] instead.

    • Notify OpenNMS it should fetch updated ticket state for an alarm from the remote ticketing system.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      Returns Promise<void>

      ReST v2

    • Un-acknowledge an alarm.

      Parameters

      • alarm: number | OnmsAlarm

        The [[OnmsAlarm]] or alarm ID.

      • Optionaluser: string

      Returns Promise<void>

      ReST v1+

    • Whether or not to use JSON when making ReST requests.

      Returns boolean