Adds a new node group. Any values specified in optional_vals are used,
otherwise defaults are used.
- Returns the new node_id (> 0) if successful, faults otherwise.
+ Returns the new nodegroup_id (> 0) if successful, faults otherwise.
"""
roles = ['admin']
update_fields
]
- returns = Parameter(int, '1 if successful')
+ returns = Parameter(int, 'New nodegroup_id (> 0) 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
+ # Create node group
node_group = NodeGroup(self.api, optional_vals)
node_group['name'] = name
node_group['description'] = description