1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Auth import Auth
5 from PLC.NodeGroups import NodeGroup, NodeGroups
7 class DeleteNodeGroup(Method):
9 Delete an existing Node Group.
11 ins may delete any node group
13 Returns 1 if successful, faults otherwise.
20 Mixed(NodeGroup.fields['nodegroup_id'],
21 NodeGroup.fields['groupname'])
24 returns = Parameter(int, '1 if successful')
27 def call(self, auth, node_group_id_or_name):
28 # Get account information
29 nodegroups = NodeGroups(self.api, [node_group_id_or_name])
31 raise PLCInvalidArgument, "No such node group"
33 nodegroup = nodegroups[0]
38 self.event_objects = {'NodeGroup': [nodegroup['nodegroup_id']]}
39 self.message = 'Node group %d deleted' % nodegroup['nodegroup_id']