1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.NodeGroups import NodeGroup, NodeGroups
5 from PLC.Auth import PasswordAuth
7 class AdmAddNodeGroup(Method):
9 Adds a new node group. Any values specified in optional_vals are used,
10 otherwise defaults are used.
12 Returns the new nodegroup_id (> 0) if successful, faults otherwise.
19 NodeGroup.fields['name'],
20 NodeGroup.fields['description']
23 returns = Parameter(int, 'New nodegroup_id (> 0) if successful')
25 def call(self, auth, name, description):
27 nodegroup = NodeGroup(self.api, {'name': name, 'description': description})
30 return nodegroup['nodegroup_id']