2 from PLC.Faults import *
3 from PLC.Method import Method
4 from PLC.Parameter import Parameter, Mixed
5 from PLC.Auth import Auth
6 from PLC.NodeGroups import NodeGroup, NodeGroups
8 class DeleteNodeGroup(Method):
10 Delete an existing Node Group.
12 ins may delete any node group
14 Returns 1 if successful, faults otherwise.
21 Mixed(NodeGroup.fields['nodegroup_id'],
22 NodeGroup.fields['groupname'])
25 returns = Parameter(int, '1 if successful')
28 def call(self, auth, node_group_id_or_name):
29 # Get account information
30 nodegroups = NodeGroups(self.api, [node_group_id_or_name])
32 raise PLCInvalidArgument, "No such node group"
34 nodegroup = nodegroups[0]
39 self.event_objects = {'NodeGroup': [nodegroup['nodegroup_id']]}
40 self.message = 'Node group %d deleted' % nodegroup['nodegroup_id']