Package ZenEvents :: Module interfaces
[hide private]
[frames] | no frames]

Source Code for Module ZenEvents.interfaces

  1  ########################################################################### 
  2  # 
  3  # This program is part of Zenoss Core, an open source monitoring platform. 
  4  # Copyright (C) 2007, Zenoss Inc. 
  5  # 
  6  # This program is free software; you can redistribute it and/or modify it 
  7  # under the terms of the GNU General Public License version 2 as published by 
  8  # the Free Software Foundation. 
  9  # 
 10  # For complete information please visit: http://www.zenoss.com/oss/ 
 11  # 
 12  ########################################################################### 
 13   
 14  from zope.interface import Interface 
 15   
16 -class IDbAccess(Interface):
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
26 - def cleanstring(self,value):
27 """Perform any cleanup nessesary on returned database strings."""
28 29
30 - def convert(self, field, value):
31 """Perform convertion of a database value if nessesary."""
32 33
34 - def dateString(self, value):
35 """Convert dates to their string format."""
36 37
38 - def dateDB(self, value):
39 """Convert a date to its database format."""
40 41
42 - def escape(self, value):
43 """Prepare string values for db by escaping special characters."""
44 45
46 - def checkConn(self):
47 """Check to see if the connection information in product works"""
48 49 50
51 -class IEventList(Interface):
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
65 - def getEventDetail(self, where=""):
66 """ 67 Return an event with its full details populated. 68 """
69 70
71 -class IEventStatus(Interface):
72 """ 73 Query real-time event system for status information. 74 """ 75
76 - def getEventRainbow(self, where=""):
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
83 - def getOrganizerStatus(self, orgType, orgName, severity=None, where=""):
84 """ 85 Return a count of events that match where for orgName and children. 86 """
87 88
89 - def getDeviceStatus(self, device, severity=None, where=""):
90 """ 91 Return a count of events that match where for a particular device. 92 """
93 94
95 - def getComponentStatus(self, device, severity=None, where=""):
96 """ 97 Return a count of events that match where for a particular component. 98 """
99 100
101 -class ISendEvents(Interface):
102 """ 103 Send events to the event system backend. 104 """ 105
106 - def sendEvents(self, events):
107 """ 108 Send a list of events to the event system backend. 109 """
110 111
112 - def sendEvent(self, event, keepopen=0):
113 """ 114 Send a single event to the event system backend. 115 """
116