1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Filter import Filter
5 from PLC.Auth import Auth
6 from PLC.NodeGroups import NodeGroup, NodeGroups
8 class GetNodeGroups(Method):
10 Returns an array of structs containing details about node groups.
11 If nodegroup_filter is specified and is an array of node group
12 identifiers or names, or a struct of node group attributes, only
13 node groups matching the filter will be returned.
16 roles = ['admin', 'pi', 'user', 'tech']
20 Mixed([Mixed(NodeGroup.fields['nodegroup_id'],
21 NodeGroup.fields['name'])],
22 Filter(NodeGroup.fields))
25 returns = [NodeGroup.fields]
27 def call(self, auth, nodegroup_filter = None):
28 return NodeGroups(self.api, nodegroup_filter).values()