1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.NetworkTypes import NetworkType, NetworkTypes
5 from PLC.Auth import Auth
7 class AddNetworkType(Method):
9 Adds a new network type.
11 Returns 1 if successful, faults otherwise.
18 NetworkType.fields['type']
21 returns = Parameter(int, '1 if successful')
24 def call(self, auth, name):
25 network_type = NetworkType(self.api)
26 network_type['type'] = name
27 network_type.sync(insert = True)