From b5fc579722b7e188feb871604caf4bd8bd2b9ac0 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 27 Feb 2007 19:04:04 +0000 Subject: [PATCH] - Initial checkin of new API implementation --- PLC/Methods/GetEventObjects.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 PLC/Methods/GetEventObjects.py diff --git a/PLC/Methods/GetEventObjects.py b/PLC/Methods/GetEventObjects.py new file mode 100644 index 00000000..02bcd68a --- /dev/null +++ b/PLC/Methods/GetEventObjects.py @@ -0,0 +1,29 @@ +from PLC.Faults import * +from PLC.Method import Method +from PLC.Parameter import Parameter, Mixed +from PLC.Filter import Filter +from PLC.EventObjects import EventObject, EventObjects +from PLC.Auth import Auth + +class GetEventObjects(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. If return_fields is specified, only the + specified details will be returned. + """ + + roles = ['admin'] + + accepts = [ + Auth(), + Mixed(Filter(EventObject.fields)), + Parameter([str], "List of fields to return", nullok = True) + ] + + returns = [EventObject.fields] + + def call(self, auth, event_filter = None, return_fields = None): + return EventObjects(self.api, event_filter, return_fields) + -- 2.47.0