Hector Akamine
2013-02-27 00:20:11 UTC
Hector Akamine [http://community.zenoss.org/people/haa] created the discussion
"Using the JSON API to query for events within a time range"
To view the discussion, visit: http://community.zenoss.org/message/72175#72175
--------------------------------------------------------------
Hi,
Using the JSON API, I would like to extract a list of events within a defined time interval (e.g., lastTime between 2013-01-01 00:00:00 and 2013-01-31 23:59:59). Is it possible to define a query to do that?
The JSON API python sample code shows a query to match some values, using a dictionary:
   def get_events(self, device=None, component=None, eventClass=None):
       data = dict(start=0, limit=100, dir='DESC', sort='severity')
       data['params'] = dict(severity=[5,4,3,2], eventState=[0,1])
Is there a way to specify a range of values instead (so I can query for time intervals)?
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/72175#72175]
Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
"Using the JSON API to query for events within a time range"
To view the discussion, visit: http://community.zenoss.org/message/72175#72175
--------------------------------------------------------------
Hi,
Using the JSON API, I would like to extract a list of events within a defined time interval (e.g., lastTime between 2013-01-01 00:00:00 and 2013-01-31 23:59:59). Is it possible to define a query to do that?
The JSON API python sample code shows a query to match some values, using a dictionary:
   def get_events(self, device=None, component=None, eventClass=None):
       data = dict(start=0, limit=100, dir='DESC', sort='severity')
       data['params'] = dict(severity=[5,4,3,2], eventState=[0,1])
Is there a way to specify a range of values instead (so I can query for time intervals)?
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/72175#72175]
Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]