Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AlarmDAO

Data access for OnmsAlarm objects.

Hierarchy

Implements

Index

Constructors

constructor

Accessors

http

Methods

acknowledge

  • acknowledge(alarm: number | OnmsAlarm, user?: string): Promise<void>
  • Acknowledge an alarm.

    version

    ReST v1+

    Parameters

    • alarm: number | OnmsAlarm
    • Optional user: string

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

    Returns Promise<void>

clear

  • clear(alarm: number | OnmsAlarm): Promise<void>

closeTicket

  • closeTicket(alarm: number | OnmsAlarm): Promise<void>

createTicket

  • createTicket(alarm: number | OnmsAlarm): Promise<void>

deleteJournalMemo

  • deleteJournalMemo(alarm: number | OnmsAlarm): Promise<void>
  • Delete the journal memo ticket associated with the given alarm.

    version

    ReST v2

    Parameters

    Returns Promise<void>

deleteStickyMemo

  • deleteStickyMemo(alarm: number | OnmsAlarm): Promise<void>
  • Delete the sticky memo ticket associated with the given alarm.

    version

    ReST v2

    Parameters

    Returns Promise<void>

escalate

  • escalate(alarm: number | OnmsAlarm): Promise<void>

find

findValues

  • findValues(propertyId: string, options?: any): Promise<any>
  • Finds the values for the given propertyId, if it exists.

    Parameters

    • propertyId: string

      The propertyId to find the values for

    • Optional options: any

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

    Returns Promise<any>

    A promise containing the values.

get

Protected getApiVersion

  • getApiVersion(): number

Protected getCount

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

    Parameters

    • data: any

    Returns number

getData

Private getDetailsPage

  • getDetailsPage(alarm: number | OnmsAlarm): string
  • Retrieves the URL to the details page for the given alarm.

    Parameters

    Returns string

    URL on the associated OpenNMS server for the alarm details page.

getFilterProcessor

getPropertiesCache

Protected parseResultList

  • parseResultList(result: any, dataFieldName: string, path: string, mapCallbackFunction: any): any
  • 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

saveJournalMemo

  • saveJournalMemo(alarm: number | OnmsAlarm, body: string, user?: string): Promise<void>
  • Create or update the journal memo associated with the alarm.

    version

    ReST v2

    Parameters

    • alarm: number | OnmsAlarm

      The OnmsAlarm or alarm ID.

    • body: string

      The memo body

    • Optional user: string

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

    Returns Promise<void>

saveStickyMemo

  • saveStickyMemo(alarm: number | OnmsAlarm, body: string, user?: string): Promise<void>
  • Create or update the sticky memo associated with the alarm.

    version

    ReST v2

    Parameters

    • alarm: number | OnmsAlarm

      The OnmsAlarm or alarm ID.

    • body: string

      The memo body

    • Optional user: string

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

    Returns Promise<void>

searchProperties

searchProperty

Protected searchPropertyPath

  • searchPropertyPath(): string

setTTicketId

  • setTTicketId(alarm: number | OnmsAlarm, ticketId: string): Promise<void>
  • Associate a ticket ID with the alarm.

    version

    ReST v1+

    Parameters

    Returns Promise<void>

setTTicketState

Protected toDate

  • toDate(from: any): Moment | undefined
  • Convert the given value to a date, or undefined if it cannot be converted.

    Parameters

    • from: any

    Returns Moment | undefined

Protected toNumber

  • toNumber(from: any): number | undefined
  • Convert the given value to a number, or undefined if it cannot be converted.

    Parameters

    • from: any

    Returns number | undefined

triggerTicketUpdate

  • triggerTicketUpdate(alarm: number | OnmsAlarm): Promise<void>
  • Notify OpenNMS it should fetch updated ticket state for an alarm from the remote ticketing system.

    version

    ReST v2

    Parameters

    Returns Promise<void>

unacknowledge

  • unacknowledge(alarm: number | OnmsAlarm, user?: string): Promise<void>

Protected useJson

  • useJson(): boolean

Generated using TypeDoc