Interfaces can handle tags through Add/Get/Update
[plcapi.git] / PLC / Methods / DeleteNodeGroup.py
index 59615f3..8bcee98 100644 (file)
@@ -1,3 +1,4 @@
+# $Id$
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
@@ -18,11 +19,12 @@ class DeleteNodeGroup(Method):
     accepts = [
         Auth(),
         Mixed(NodeGroup.fields['nodegroup_id'],
-             NodeGroup.fields['name'])
+             NodeGroup.fields['groupname'])
         ]
 
     returns = Parameter(int, '1 if successful')
 
+
     def call(self, auth, node_group_id_or_name):
         # Get account information
         nodegroups = NodeGroups(self.api, [node_group_id_or_name])
@@ -33,4 +35,8 @@ class DeleteNodeGroup(Method):
 
         nodegroup.delete()
 
+       # Logging variables
+       self.event_objects = {'NodeGroup': [nodegroup['nodegroup_id']]}
+       self.message  = 'Node group %d deleted' % nodegroup['nodegroup_id']
         return 1