fix call to update
[plcapi.git] / PLC / Methods / GetEventObjects.py
1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Filter import Filter
5 from PLC.EventObjects import EventObject, EventObjects
6 from PLC.Auth import Auth
7
8 class GetEventObjects(Method):
9     """
10     Returns an array of structs containing details about events and
11     faults. If event_filter is specified and is an array of event
12     identifiers, or a struct of event attributes, only events matching
13     the filter will be returned. If return_fields is specified, only the
14     specified details will be returned.
15     """
16
17     roles = ['admin']
18
19     accepts = [
20         Auth(),
21         Mixed(Filter(EventObject.fields)),
22         Parameter([str], "List of fields to return", nullok = True)
23         ]
24
25     returns = [EventObject.fields]
26
27     def call(self, auth, event_filter = None, return_fields = None):
28         return EventObjects(self.api, event_filter, return_fields)