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