svn keywords
[plcapi.git] / PLC / Methods / GetConfFiles.py
1 # $Id$
2 # $URL$
3 from PLC.Faults import *
4 from PLC.Method import Method
5 from PLC.Parameter import Parameter, Mixed
6 from PLC.Filter import Filter
7 from PLC.ConfFiles import ConfFile, ConfFiles
8 from PLC.Auth import Auth
9
10 class GetConfFiles(Method):
11     """
12     Returns an array of structs containing details about configuration
13     files. If conf_file_filter is specified and is an array of
14     configuration file identifiers, or a struct of configuration file
15     attributes, only configuration files matching the filter will be
16     returned. If return_fields is specified, only the specified
17     details will be returned.
18     """
19
20     roles = ['admin', 'node']
21
22     accepts = [
23         Auth(),
24         Mixed([ConfFile.fields['conf_file_id']],
25               Filter(ConfFile.fields)),
26         Parameter([str], "List of fields to return", nullok = True)
27         ]
28
29     returns = [ConfFile.fields]
30
31
32     def call(self, auth, conf_file_filter = None, return_fields = None):
33         return ConfFiles(self.api, conf_file_filter, return_fields)