3 from PLC.Faults import *
4 from PLC.Method import Method
5 from PLC.Parameter import Parameter, Mixed
6 from PLC.NodeTypes import NodeType, NodeTypes
7 from PLC.Auth import Auth
9 class AddNodeType(Method):
11 Adds a new node node type.
13 Returns 1 if successful, faults otherwise.
20 NodeType.fields['node_type']
23 returns = Parameter(int, '1 if successful')
26 def call(self, auth, name):
27 node_type = NodeType(self.api)
28 node_type['node_type'] = name
29 node_type.sync(insert = True)