Branch 5.0 for module PLCAPI created from tag PLCAPI-4.2-8
[plcapi.git] / PLC / Methods / AdmAssociateNodeToPowerControlUnitPort.py
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.PCUs import PCU, PCUs
6 from PLC.Auth import Auth
7 from PLC.Methods.AddNodeToPCU import AddNodeToPCU
8
9 class AdmAssociateNodeToPowerControlUnitPort(AddNodeToPCU):
10     """
11     Deprecated. See AddNodeToPCU.
12     """
13
14     status = "deprecated"
15
16     roles = ['admin', 'pi', 'tech']
17
18     accepts = [
19         Auth(),
20         PCU.fields['pcu_id'],
21         Parameter(int, 'PCU port number'),
22         Mixed(Node.fields['node_id'],
23               Node.fields['hostname']),
24         ]
25
26     returns = Parameter(int, '1 if successful')
27
28     def call(self, auth, pcu_id, port, node_id_or_hostname):
29         return AddNodeToPCU(self, auth, node_id_or_hostname, pcu_id, port)