1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.NodeNetworks import NodeNetwork, NodeNetworks
5 from PLC.Auth import PasswordAuth
7 class GetNodeNetworks(Method):
9 Return an array of structs contain details about node network
10 interfaces. If nodenetwork_id_or_hostname_list is specified, only
11 the specified node network interfaces will be queried.
14 roles = ['admin', 'pi', 'user', 'tech']
18 [Mixed(NodeNetwork.fields['nodenetwork_id'],
19 NodeNetwork.fields['hostname'])]
22 returns = [NodeNetwork.fields]
24 def call(self, auth, nodenetwork_id_or_hostname_list = None):
25 nodenetworks = NodeNetworks(self.api, nodenetwork_id_or_hostname_list).values()
27 # Cast from NodeNetwork to real dict
28 nodenetworks = [dict(nodenetwork) for nodenetwork in nodenetworks]