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
8 class DeleteNetworkMethod(Method):
10 Deletes a network method.
12 WARNING: This will cause the deletion of all network interfaces
15 Returns 1 if successful, faults otherwise.
22 NetworkMethod.fields['method']
25 returns = Parameter(int, '1 if successful')
28 def call(self, auth, name):
29 network_methods = NetworkMethods(self.api, [name])
30 if not network_methods:
31 raise PLCInvalidArgument, "No such network method"
32 network_method = network_methods[0]
34 network_method.delete()