Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AlarmService

Hierarchy

Index

Constructors

constructor

Methods

create

  • Parameters

    Returns Promise<IResult<IAlarm>>

    Response wrapped in IResult

    Example

    
     const mandantoryObject: IAlarm = {
       severity: Severity.CRITICAL,
       source: device,
       text: 'I am an Alarm!',
       time: '2018-05-02T10:08:00Z',
       type: 'device-type-here',
     };
    
     (async () => {
       const {data, res} = await alarmService.create(mandantoryObject);
     })();
    

detail

  • Parameters

    Returns Promise<IResult<IAlarm>>

    Response wrapped in IResult

    Example

    
       const alarmId: number = 1;
    
       (async () => {
         const {data, res} = await alarmService.detail(alarmId);
       })();
    

list

list$

  • Parameters

    Returns Observable<IAlarm[]>

    Data wrapped as ObservableList

    Example

    
      const list$ = alarmService.list$();
      list$.subscribe((data) => console.log(data));
    

    Deprecated This function will be removed soon in favor of decoupling this library from rxjs. Use Realtime for realtime connection and rxjs defer() or from() to composite an observable on your own.

listBySource$

  • Parameters

    Returns Observable<IAlarm[]>

    Data wrapped as Observable.

    Example

    
      const listBySource$ = alarmService.listBySource$(11);
      listBySource$.subscribe((data) => console.log(data));
    

    Deprecated This function will be removed soon in favor of decoupling this library from rxjs. Use Realtime for realtime connection and rxjs defer() or from() to composite an observable on your own.

update

  • Parameters

    Returns Promise<IResult<IAlarm>>

    Response wrapped in IResult

    Example

    
     const partialUpdateObject: Partial<IAlarm> = {
       severity: Severity.MINOR,
       source: device,
       text: 'Changed Alarm!'
     };
    
     (async () => {
       const {data, res} = await alarmService.update(partialUpdateObject);
     })();
    

Generated using TypeDoc