- returns = Parameter(int, '1 if successful')
-
- def call(self, auth, name, description, optional_vals = {}):
- if filter(lambda field: field not in self.update_fields, optional_vals):
- raise PLCInvalidArgument, "Invalid fields specified"
-
- # Authenticated function
- assert self.caller is not None
-
- # make sure we are 'admin'
- if 'admin' not in self.caller['roles']:
- raise PLCPermissionDenied, "Not allowed to add node groups"
-
- #creat node group
- node_group = NodeGroup(self.api, optional_vals)
- node_group['name'] = name
- node_group['description'] = description
- node_group.flush()
-
- return node_group['nodegroup_id']
+ def call(self, auth, name, description):
+ return AddNodeGroup.call(self, auth, {'name': name, 'description': description})