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