/
OnmsEvent.ts
58 lines (44 loc) · 1.39 KB
/
OnmsEvent.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import {Moment} from 'moment';
import {Address4, Address6} from 'ip-address';
import {OnmsParm} from './OnmsParm';
import {OnmsServiceType} from './OnmsServiceType';
import {OnmsSeverity} from './OnmsSeverity';
/**
* Represents an OpenNMS event.
* @module OnmsEvent
*/
export class OnmsEvent {
/** the event ID */
public id: number;
/** the UEI of this event */
public uei: string;
/** the node's ID associated with this event */
public nodeId: number;
/** the node's label associated with this event */
public nodeLabel: string;
/** the interface associated with this event */
public ipAddress: Address4 | Address6;
/** the severity of this event */
public severity: OnmsSeverity;
/** when the event was created */
public createTime: Moment;
/** when the event was received by OpenNMS */
public time: Moment;
/** which subsystem the event came from */
public source: string;
/** the description of is event */
public description: string;
/** the log message of the event */
public logMessage: string;
/** the service associated with the event */
public service: OnmsServiceType;
/** the parameters emitted with this alarm's event */
public parameters: OnmsParm[];
/** the service name associated with the event */
public get serviceName() {
if (this.service && this.service.name) {
return this.service.name;
}
return undefined;
}
}