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