3 from PLC.Faults import *
4 from PLC.Method import Method
5 from PLC.Parameter import Parameter, Mixed
6 from PLC.NetworkMethods import NetworkMethod, NetworkMethods
7 from PLC.Auth import Auth
9 class AddNetworkMethod(Method):
11 Adds a new network method.
13 Returns 1 if successful, faults otherwise.
20 NetworkMethod.fields['method']
23 returns = Parameter(int, '1 if successful')
26 def call(self, auth, name):
27 network_method = NetworkMethod(self.api)
28 network_method['method'] = name
29 network_method.sync(insert = True)