X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FGetMessages.py;h=b0eb44e94159221bd00616bb4cabb515fb22879a;hb=a74854dd38cb742b8fdc0d0cda7fff738a95312c;hp=66053240b69aa2a49de439d95b97c276559df041;hpb=e347fc823bbba9d88a3fddf07d5c21024dfd1e55;p=plcapi.git diff --git a/PLC/Methods/GetMessages.py b/PLC/Methods/GetMessages.py index 6605324..b0eb44e 100644 --- a/PLC/Methods/GetMessages.py +++ b/PLC/Methods/GetMessages.py @@ -1,28 +1,31 @@ from PLC.Faults import * from PLC.Method import Method -from PLC.Parameter import Parameter +from PLC.Parameter import Parameter, Mixed +from PLC.Filter import Filter from PLC.Messages import Message, Messages from PLC.Auth import Auth class GetMessages(Method): """ - Return an array of structs containing details about message - templates. If message_ids is specified, only the specified - messages will be queried. + Returns an array of structs containing details about message + templates. If message template_filter is specified and is an array + of message template identifiers, or a struct of message template + attributes, only message templates matching the filter will be + returned. If return_fields is specified, only the specified + details will be returned. """ - roles = ['admin'] + roles = ['admin', 'node'] accepts = [ Auth(), - [Message.fields['message_id']], + Mixed([Message.fields['message_id']], + Filter(Message.fields)), + Parameter([str], "List of fields to return", nullok = True), ] returns = [Message.fields] - event_type = 'Get' - object_type = 'Message' - object_ids = [] - def call(self, auth, message_ids = None): - return Messages(self.api, message_ids) + def call(self, auth, message_filter = None, return_fields = None): + return Messages(self.api, message_filter, return_fields)