dddb1fdc65e16c2b8733a97077fd2988447b5e0b
[plcapi.git] / PLC / Methods / GetNetworkMethods.py
1 # $Id$
2 from PLC.Faults import *
3 from PLC.Method import Method
4 from PLC.Parameter import Parameter, Mixed
5 from PLC.NetworkMethods import NetworkMethod, NetworkMethods
6 from PLC.Auth import Auth
7
8 class GetNetworkMethods(Method):
9     """
10     Returns a list of all valid network methods.
11     """
12
13     roles = ['admin', 'pi', 'user', 'tech', 'node']
14
15     accepts = [
16         Auth()
17         ]
18
19     returns = [NetworkMethod.fields['method']]
20
21
22     def call(self, auth):
23         return [network_method['method'] for network_method in NetworkMethods(self.api)]