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 UpdateNodeGroup(Method):
9 Updates a custom node group.
11 Returns 1 if successful, faults otherwise.
18 Mixed(NodeGroup.fields['nodegroup_id'],
19 NodeGroup.fields['name']),
20 NodeGroup.fields['name'],
21 NodeGroup.fields['description']
24 returns = Parameter(int, '1 if successful')
26 def call(self, auth, nodegroup_id_or_name, name, description):
27 # Get nodegroup information
28 nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
30 raise PLCInvalidArgument, "No such nodegroup"
32 nodegroup = nodegroups.values()[0]
37 'description': description
40 nodegroup.update(update_fields)