get rid of svn keywords once and for good
[plcapi.git] / PLC / Methods / GetAddresses.py
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.Addresses import Address, Addresses
6 from PLC.Auth import Auth
7
8 class GetAddresses(Method):
9     """
10     Returns an array of structs containing details about addresses. If
11     address_filter is specified and is an array of address
12     identifiers, or a struct of address attributes, only addresses
13     matching the filter will be returned. If return_fields is
14     specified, only the specified details will be returned.
15     """
16
17     roles = ['admin', 'pi', 'user', 'tech', 'node']
18
19     accepts = [
20         Auth(),
21         Mixed([Address.fields['address_id']],
22               Filter(Address.fields)),
23         Parameter([str], "List of fields to return", nullok = True)
24         ]
25
26     returns = [Address.fields]
27
28
29     def call(self, auth, address_filter = None, return_fields = None):
30         return Addresses(self.api, address_filter, return_fields)