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.Interfaces import Interface, Interfaces
6 from PLC.Auth import Auth
8 class GetInterfaces(Method):
10 Returns an array of structs containing details about network
11 interfaces. If interfaces_filter is specified and is an array of
12 interface identifiers, or a struct of interface fields and
13 values, only interfaces matching the filter will be
16 If return_fields is given, only the specified details will be returned.
19 roles = ['admin', 'pi', 'user', 'tech', 'node', 'anonymous']
23 Mixed([Mixed(Interface.fields['interface_id'],
24 Interface.fields['ip'])],
25 Parameter (int, "interface id"),
26 Parameter (str, "ip address"),
27 Filter(Interface.fields)),
28 Parameter([str], "List of fields to return", nullok = True)
31 returns = [Interface.fields]
33 def call(self, auth, interface_filter = None, return_fields = None):
34 return Interfaces(self.api, interface_filter, return_fields)