X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FGetAddresses.py;h=7ebc80ba77f6d6bf1756c6463e4df716c7c106ae;hb=3cf628a5149714c966e7dc1a778a5df7afc581dc;hp=567cd9896df03410a64ddc5a087a0396aa31bcc4;hpb=51577ccbfa01fffba04b84e502a35f6a3915b68b;p=plcapi.git diff --git a/PLC/Methods/GetAddresses.py b/PLC/Methods/GetAddresses.py index 567cd98..7ebc80b 100644 --- a/PLC/Methods/GetAddresses.py +++ b/PLC/Methods/GetAddresses.py @@ -1,3 +1,5 @@ +# $Id$ +# $URL$ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed @@ -10,18 +12,21 @@ class GetAddresses(Method): Returns an array of structs containing details about addresses. If address_filter is specified and is an array of address identifiers, or a struct of address attributes, only addresses - matching the filter will be returned. + 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'] accepts = [ Auth(), Mixed([Address.fields['address_id']], - Filter(Address.fields)) + Filter(Address.fields)), + Parameter([str], "List of fields to return", nullok = True) ] returns = [Address.fields] - def call(self, auth, address_filter = None): - return Addresses(self.api, address_filter).values() + + def call(self, auth, address_filter = None, return_fields = None): + return Addresses(self.api, address_filter, return_fields)