Package ZenPacks :: Package zenoss :: Package Impact :: Module routers :: Class RelatedEventsRouter
[frames] | no frames]

type RelatedEventsRouter

source code

                                          object --+            
                                                   |            
     Products.ZenUtils.extdirect.router.DirectRouter --+        
                                                       |        
Products.ZenUtils.extdirect.zope.router.ZopeDirectRouter --+    
                                                           |    
                      Products.Zuul.routers.zep.EventsRouter --+
                                                               |
                                                              RelatedEventsRouter

Queries for events related to a service event.

Instance Methods
DirectResponse
query(self, limit=0, start=0, sort='confidence', page=None, dir='desc', params=None, archive=False, uid=None)
Expects params to have an 'evid' parameter specifying the service event(s) for which related events should be queried.
source code
DirectResponse
related_services(self, event_id, archive=False)
Find services that a given event_id impacted.
source code

Inherited from Products.Zuul.routers.zep.EventsRouter: __init__, acknowledge, add_event, classify, clear_heartbeats, close, column_config, detail, getConfig, nextEventSummaryUpdate, postNote, queryArchive, queryGenerator, reopen, setConfigValues, unacknowledge, updateEventSummaries, write_log

Inherited from Products.ZenUtils.extdirect.zope.router.ZopeDirectRouter: __call__

Properties

Inherited from Products.Zuul.routers.zep.EventsRouter: configSchema

Method Details

query(self, limit=0, start=0, sort='confidence', page=None, dir='desc', params=None, archive=False, uid=None)

source code 

Expects params to have an 'evid' parameter specifying the service event(s) for which related events should be queried.

Parameters:
  • limit - (optional) Max index of events to retrieve (default: 0)
  • start - (optional) Min index of events to retrieve (default: 0)
  • sort - (optional) Key on which to sort the return results (default: 'lastTime')
  • dir - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'DESC')
  • params - (optional) Key-value pair of filters for this search. (default: None)
  • history - (optional) True to search the event history table instead of active events (default: False)
  • uid - (optional) Context for the query (default: None)
Returns: DirectResponse
  • Properties:
    • events ([dictionary]) - A list of dictionaries representing event data
    • totalCount (integer) - The total number of events
    • asof (float) - The time for which this response is valid
Overrides: Products.Zuul.routers.zep.EventsRouter.query

related_services(self, event_id, archive=False)

source code 

Find services that a given event_id impacted.

Parameters:
  • event_id (string) - The event id to use when looking up impacted services
  • archive (boolean) - Whether or not to search for the event in the event archive
Returns: DirectResponse
  • Properties:
    • services: A sorted list of dict objects with keys:
      • name (string) - The name of the service
      • uuid (string) - The uuid of the service