1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Auth import PasswordAuth
5 from PLC.NodeGroups import NodeGroup, NodeGroups
7 class AdmGetNodeGroupNodes(Method):
9 Returns a list of node_ids for the node group specified.
12 roles = ['admin', 'pi', 'user', 'tech']
16 Mixed(NodeGroup.fields['nodegroup_id'],
17 NodeGroup.fields['name'])
20 returns = NodeGroup.join_fields['node_ids']
22 def call(self, auth, nodegroup_id_or_name):
23 # Get nodes in this nodegroup
24 nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
26 raise PLCInvalidArgument, "No such node group"
28 # Get the info for the node group specified
29 nodegroup = nodegroups.values()[0]
31 # Return the list of node_ids
32 return nodegroup['node_ids']