X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=PLC%2FMethods%2FGetNodeGroups.py;h=d4d9aa184d7f81b67a73171d4a2837a57d4a4750;hb=bd0cbf4f7f2e4cf7ceda500bfa6f98c0a700018b;hp=8601a0509a08c4e2d8868ea3227b380c5597f9a4;hpb=1f8c38dd1357c93e4be8d94456b7274a591d2db4;p=plcapi.git diff --git a/PLC/Methods/GetNodeGroups.py b/PLC/Methods/GetNodeGroups.py index 8601a05..d4d9aa1 100644 --- a/PLC/Methods/GetNodeGroups.py +++ b/PLC/Methods/GetNodeGroups.py @@ -1,25 +1,30 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed +from PLC.Filter import Filter from PLC.Auth import Auth from PLC.NodeGroups import NodeGroup, NodeGroups class GetNodeGroups(Method): """ - Returns an array of structs containing details about all node - groups. If nodegroup_id_or_name_list is specified, only the - specified node groups will be queried. + Returns an array of structs containing details about node groups. + If nodegroup_filter is specified and is an array of node group + identifiers or names, or a struct of node group attributes, only + node groups matching the filter will be returned. If return_fields + is specified, only the specified details will be returned. """ - roles = ['admin', 'pi', 'user', 'tech'] + roles = ['admin', 'pi', 'user', 'tech', 'node', 'anonymous'] accepts = [ Auth(), - [Mixed(NodeGroup.fields['nodegroup_id'], - NodeGroup.fields['name'])] + Mixed([Mixed(NodeGroup.fields['nodegroup_id'], + NodeGroup.fields['groupname'])], + Filter(NodeGroup.fields)), + Parameter([str], "List of fields to return", nullok = True) ] returns = [NodeGroup.fields] - - def call(self, auth, nodegroup_id_or_name_list = None): - return NodeGroups(self.api, nodegroup_id_or_name_list).values() + + def call(self, auth, nodegroup_filter = None, return_fields = None): + return NodeGroups(self.api, nodegroup_filter, return_fields)