Add 'php/phpxmlrpc/' from commit 'cd5dbb4a511e7a616a61187a5de1a611a9748cbd'
[plcapi.git] / PLC / Methods / GetTagTypes.py
1 #
2 # Thierry Parmentelat - INRIA
3 #
4 from PLC.Method import Method
5 from PLC.Parameter import Parameter, Mixed
6 from PLC.Filter import Filter
7 from PLC.Auth import Auth
8 from PLC.TagTypes import TagType, TagTypes
9
10 class GetTagTypes(Method):
11     """
12     Returns an array of structs containing details about
13     node tag types.
14
15     The usual filtering scheme applies on this method.
16     """
17
18     roles = ['admin', 'pi', 'user', 'tech', 'node']
19
20     accepts = [
21         Auth(),
22         Mixed([Mixed(TagType.fields['tag_type_id'],
23                      TagType.fields['tagname'])],
24               Mixed(TagType.fields['tag_type_id'],
25                      TagType.fields['tagname']),
26               Filter(TagType.fields)),
27         Parameter([str], "List of fields to return", nullok = True)
28         ]
29
30     returns = [TagType.fields]
31
32     def call(self, auth, tag_type_filter = None, return_fields = None):
33         return TagTypes(self.api, tag_type_filter, return_fields)