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 object_type = 'NetworkType'
26 def call(self, auth, name):
27 network_type = NetworkType(self.api)
28 network_type['type'] = name
29 network_type.sync(insert = True)