- Change .py files to use 4-space indents and no hard tab characters.
[plcapi.git] / PLC / Methods / GetEvents.py
index 30f246e..6b88618 100644 (file)
@@ -1,3 +1,5 @@
+# $Id$
+# $URL$
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
@@ -10,7 +12,8 @@ class GetEvents(Method):
     Returns an array of structs containing details about events and
     faults. If event_filter is specified and is an array of event
     identifiers, or a struct of event attributes, only events matching
-    the filter will be returned.
+    the filter will be returned. If return_fields is specified, only the
+    specified details will be returned.
     """
 
     roles = ['admin']
@@ -18,10 +21,11 @@ class GetEvents(Method):
     accepts = [
         Auth(),
         Mixed([Event.fields['event_id']],
-              Filter(Event.fields))
+              Filter(Event.fields)),
+        Parameter([str], "List of fields to return", nullok = True)
         ]
 
     returns = [Event.fields]
 
-    def call(self, auth, event_filter = None):
-        return Events(self.api, event_filter).values()
+    def call(self, auth, event_filter = None, return_fields = None):
+        return Events(self.api, event_filter, return_fields)