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 PasswordAuth
7 class DeleteNetworkMethod(Method):
9 Deletes a network method.
11 Returns 1 if successful, faults otherwise.
18 NetworkMethod.fields['method']
21 returns = Parameter(int, '1 if successful')
23 def call(self, auth, name):
24 network_methods = NetworkMethods(self.api, [name])
25 if not network_methods:
26 raise PLCInvalidArgument, "No such network method"
27 network_method = network_methods.values()[0]
29 network_method.delete()