Skip to content

Alarms API

This file contains functions to manage alarm-related operations such as fetching alarms, solving alarms, and managing watchers and configurations.

Functions

GET getAllAlarms(status, fromDate, toDate, dashboard, service, type, severity)

Fetches all alarms based on the provided filters.

Input:

  • status (number): Status of the alarm (-1 for all).
  • fromDate (Date): Start date for filtering.
  • toDate (Date): End date for filtering.
  • dashboard (string): Dashboard name.
  • service (string): Service name.
  • type (string): Alarm type.
  • severity (string): Alarm severity.

Output: List of alarms matching the filters.

Request Details:

  • URL: {alarmService}/alarm/all?datefrom={fromDate}&dateto={toDate}&status={status}&dashboard={dashboard}&service={service}&type={type}&severity={severity}
  • Method: GET

PUT solveAlarm(id)

Marks an alarm as solved.

Input:

  • id (string): The ID of the alarm.

Output: Confirmation of alarm resolution.

Request Details:

  • URL: {alarmService}/alarm/{id}/solve
  • Method: PUT

GET getAllWatchers()

Fetches all watchers.

Input: None
Output: List of watchers.

Request Details:

  • URL: {alarmService}/watcher/all
  • Method: GET

POST createWatcher(watcher)

Creates a new watcher.

Input:

  • watcher (object): Watcher data.

Output: Confirmation of watcher creation.

Request Details:

  • URL: {alarmService}/watcher
  • Method: POST
  • Data:
    { ...watcher }
    

DELETE deleteWatcher(id)

Deletes a watcher.

Input:

  • id (string): The ID of the watcher.

Output: Confirmation of watcher deletion.

Request Details:

  • URL: {alarmService}/watcher/{id}
  • Method: DELETE

PUT updateWatcher(id, watcher)

Updates an existing watcher.

Input:

  • id (string): The ID of the watcher.
  • watcher (object): Updated watcher data.

Output: Confirmation of watcher update.

Request Details:

  • URL: {alarmService}/watcher/{id}
  • Method: PUT
  • Data:
    { ...watcher }
    

PUT setWatcherStatus(id, status)

Enable or disable the specified watcher.

Input:

  • id (string): The ID of the watcher.
  • status (boolean): New watcher status

Output: Confirmation of watcher update.

Request Details:

  • URL: {alarmService}/watcher/{id}/status
  • Method: PUT
  • Data:
    { active: status }
    

GET getDashboardFilters()

Fetches available dashboard filters.

Input: None
Output: List of dashboard filters.

Request Details:

  • URL: {alarmService}/filters/dashboards
  • Method: GET

GET getServicesFilters()

Fetches available service filters.

Input: None
Output: List of service filters.

Request Details:

  • URL: {alarmService}/filters/alarmservices
  • Method: GET

GET getTypesFilters()

Fetches available alarm type filters.

Input: None
Output: List of type filters.

Request Details:

  • URL: {alarmService}/filters/type
  • Method: GET

GET getDeviceElements()

Fetches device elements related to alarms.

Input: None
Output: List of device elements.

Request Details:

  • URL: {alarmService}/alarm/getDeviceElements
  • Method: GET

GET getAlarmConfigs()

Fetches all alarm configurations.

Input: None
Output: List of alarm configurations.

Request Details:

  • URL: {alarmService}/alarmconfig/all
  • Method: GET

POST createAlarmConfig(alarmConfig)

Creates a new alarm configuration.

Input:

  • alarmConfig (object): Alarm configuration data.

Output: Confirmation of alarm configuration creation.

Request Details:

  • URL: {alarmService}/alarmconfig
  • Method: POST
  • Data:
    { ...alarmConfig }
    

DELETE deleteAlarmConfig(id)

Deletes an alarm configuration.

Input:

  • id (string): The ID of the alarm configuration.

Output: Confirmation of alarm configuration deletion.

Request Details:

  • URL: {alarmService}/alarmconfig/{id}
  • Method: DELETE

PUT updateAlarmConfig(alarmConfig)

Updates an existing alarm configuration.

Input:

  • alarmConfig (object): Contains id and updated configuration data.

Output: Confirmation of alarm configuration update.

Request Details:

  • URL: {alarmService}/alarmconfig/{alarmConfig.id}
  • Method: PUT
  • Data:
    { ...alarmConfig }