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.
18 roles = ['admin', 'pi', 'user', 'tech']
22 Mixed(NodeGroup.fields['nodegroup_id'],
23 NodeGroup.fields['name'])
26 returns = NodeGroup.fields['node_ids']
28 def call(self, auth, nodegroup_id_or_name):
29 # Get nodes in this nodegroup
30 nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
32 raise PLCInvalidArgument, "No such node group"
34 # Get the info for the node group specified
35 nodegroup = nodegroups[0]
37 # Return the list of node_ids
38 return nodegroup['node_ids']