X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FGetNodeNetworks.py;h=1168e4916a6590568020f2d799a6f49f0be4947a;hb=39affdfbcbae32244a0533d7b0b01b94a19c81b1;hp=e20487fbcf9274c2db086abe8b1c99e10d61100e;hpb=1f8c38dd1357c93e4be8d94456b7274a591d2db4;p=plcapi.git diff --git a/PLC/Methods/GetNodeNetworks.py b/PLC/Methods/GetNodeNetworks.py index e20487f..1168e49 100644 --- a/PLC/Methods/GetNodeNetworks.py +++ b/PLC/Methods/GetNodeNetworks.py @@ -1,25 +1,31 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed +from PLC.Filter import Filter from PLC.NodeNetworks import NodeNetwork, NodeNetworks from PLC.Auth import Auth class GetNodeNetworks(Method): """ - Return an array of structs contain details about node network - interfaces. If nodenetwork_id_or_ip_list is specified, only - the specified node network interfaces will be queried. + Returns an array of structs containing details about node network + interfacess. If nodenetworks_filter is specified and is an array + of node network identifiers, or a struct of node network + attributes, only node network interfaces matching the filter will + be returned. If return_fields is specified, only the + specified details will be returned. """ roles = ['admin', 'pi', 'user', 'tech'] accepts = [ Auth(), - [Mixed(NodeNetwork.fields['nodenetwork_id'], - NodeNetwork.fields['ip'])] + Mixed([NodeNetwork.fields['nodenetwork_id']], + Filter(NodeNetwork.fields)), + Parameter([str], "List of fields to return", nullok = True) ] returns = [NodeNetwork.fields] + - def call(self, auth, nodenetwork_id_or_ip_list = None): - return NodeNetworks(self.api, nodenetwork_id_or_ip_list).values() + def call(self, auth, nodenetwork_filter = None, return_fields = None): + return NodeNetworks(self.api, nodenetwork_filter, return_fields)