This commit was manufactured by cvs2svn to create branch
[plcapi.git] / PLC / Methods / GetMessages.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.Messages import Message, Messages
6 from PLC.Auth import Auth
7
8 class GetMessages(Method):
9     """
10     Returns an array of structs containing details about message
11     templates. If message template_filter is specified and is an array
12     of message template identifiers, or a struct of message template
13     attributes, only message templates matching the filter will be
14     returned. If return_fields is specified, only the specified
15     details will be returned.
16     """
17
18     roles = ['admin', 'node']
19
20     accepts = [
21         Auth(),
22         Mixed([Message.fields['message_id']],
23               Filter(Message.fields)),
24         Parameter([str], "List of fields to return", nullok = True),
25         ]
26
27     returns = [Message.fields]
28
29
30     def call(self, auth, message_filter = None, return_fields = None):
31         return Messages(self.api, message_filter, return_fields)