1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Nodes import Node, Nodes
5 from PLC.NodeNetworks import NodeNetwork, NodeNetworks
6 from PLC.Auth import Auth
7 from PLC.Methods.GetNodeNetworks import GetNodeNetworks
9 class AdmGetAllNodeNetworks(GetNodeNetworks):
11 Deprecated. Functionality can be implemented with GetNodes and
17 roles = ['admin', 'pi', 'user', 'tech']
21 Mixed(Node.fields['node_id'],
22 Node.fields['hostname'])
25 returns = [NodeNetwork.fields]
27 def call(self, auth, node_id_or_hostname):
28 # Get node information
29 nodes = Nodes(self.api, [node_id_or_hostname])
31 raise PLCInvalidArgument, "No such node"
34 if not node['nodenetwork_ids']:
37 return GetNodeNetworks.call(self, auth, node['nodenetwork_ids'])