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 AdmGetNodeGroupNodes(Method):
9 Deprecated. See GetNodeGroups.
11 Returns a list of node_ids for the node group specified.
16 roles = ['admin', 'pi', 'user', 'tech']
20 Mixed(NodeGroup.fields['nodegroup_id'],
21 NodeGroup.fields['name'])
24 returns = NodeGroup.fields['node_ids']
26 def call(self, auth, nodegroup_id_or_name):
27 # Get nodes in this nodegroup
28 nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
30 raise PLCInvalidArgument, "No such node group"
32 # Get the info for the node group specified
33 nodegroup = nodegroups[0]
35 # Return the list of node_ids
36 return nodegroup['node_ids']