1
2
3
4
5
6
7
8
9
10
11
12
13
14 from zope.interface import Interface
15
17 """
18 Database access class that normalizes differences in connecting
19 to databases and handles conversion of their values.
20 """
21
22 - def connect(self, username, password, database, port):
23 """Load our database driver and connect to the database."""
24
25
27 """Perform any cleanup nessesary on returned database strings."""
28
29
31 """Perform convertion of a database value if nessesary."""
32
33
35 """Convert dates to their string format."""
36
37
39 """Convert a date to its database format."""
40
41
43 """Prepare string values for db by escaping special characters."""
44
45
47 """Check to see if the connection information in product works"""
48
49
50
52 """
53 Query event system for lists of events and event details.
54 """
55
56 - def getEventList(self, resultFields=[], where="", orderby="", severity=0,
57 startdate=None, enddate=None, offset=0, rows=0):
58 """
59 Return a list of events that have resultFields based on where
60 and severity and ordered by orderby. Offset and rows can be used
61 to limit the size of the result set. startdate and enddate can
62 limit the time range of the event list.
63 """
64
66 """
67 Return an event with its full details populated.
68 """
69
70
72 """
73 Query real-time event system for status information.
74 """
75
77 """
78 Return a list of tuples with number of events for each severity
79 and the color of the severity that the number represents.
80 ((5,"#FF0000"), (14,"#FFFF00")...)
81 """
82
84 """
85 Return a count of events that match where for orgName and children.
86 """
87
88
90 """
91 Return a count of events that match where for a particular device.
92 """
93
94
96 """
97 Return a count of events that match where for a particular component.
98 """
99
100
102 """
103 Send events to the event system backend.
104 """
105
107 """
108 Send a list of events to the event system backend.
109 """
110
111
113 """
114 Send a single event to the event system backend.
115 """
116