Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
Loading...
Searching...
No Matches
CascadeManager.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2018 Raritan Inc. All rights reserved.
4 */
5
6#include <UserEvent.idl>
7
8/** Raritan JSON-RPC */
9module cascading {
10
11 /** JSON-RPC Cascade Manager */
12 interface CascadeManager {
13
14 constant int NO_ERROR = 0; ///< Operation successful, no error
15 constant int ERR_INVALID_PARAM = 1; ///< A parameter was invalid
16 constant int ERR_UNSUPPORTED_ON_PRIMARY_UNIT = 2; ///< Operation not allowed for a primary unit
17 constant int ERR_UNSUPPORTED_ON_LINK_UNIT = 3; ///< Operation not allowed for a link unit
18 constant int ERR_LINK_ID_IN_USE = 4; ///< The specified link ID is already used
19 constant int ERR_HOST_IN_USE = 5; ///< The specified host is already in use
20 constant int ERR_LINK_UNIT_UNREACHABLE = 6; ///< Could not connect to the link device
21 constant int ERR_LINK_UNIT_ACCESS_DENIED = 7; ///< Login to link device failed
22 constant int ERR_LINK_UNIT_REFUSED = 8; ///< Remote device refused to become a link unit
23 constant int ERR_UNIT_BUSY = 9; ///< The unit could not respond because it was busy
24 constant int ERR_NOT_SUPPORTED = 10; ///< Operation not supported on this device
25 constant int ERR_PASSWORD_CHANGE_REQUIRED = 11; ///< The unit requires a password change
26 constant int ERR_PASSWORD_POLICY = 12; ///< The given password did not meet the requirements
27 constant int ERR_LINK_UNIT_COMM_FAILED = 13; ///< Communication with the link unit failed
28 constant int ERR_LINK_UNIT_NOT_SUPPORTED = 14; ///< Link unit does not support cascading
29 constant int ERR_FIRMWARE_VERSION_MISMATCH = 15; ///< The firmware versions between primary and link unit do not match
30
31 /** Settings for primary unit */
33 string caCertChain; ///< CA certificate chain that signs the link unit TLS certs
34 boolean allowOffTimeRangeCerts; ///< allow expired and not yet valid TLS certs
35 };
36
37 /** JSON-RPC Cascade Role */
38 enumeration Role {
39 STANDALONE, ///< Standalone unit, not in cascade
40 PRIMARY_UNIT, ///< Primary unit controlling other devices
41 LINK_UNIT ///< Link unit under primary unit control
42 };
43
44 enumeration LinkUnitType {
45 NETWORK, ///< High-level linking via JSON-RPC API
46 SECURE_SERIAL, ///< Linking via encrypted serial bus (ScalePoint)
47 ZIGBEE ///< Linking via Zigbee (ScalePoint)
48 };
49
50 /** Link Unit Communication Status */
51 [unknown_fallback("UNKNOWN")]
52 enumeration LinkUnitStatus {
53 UNKNOWN, ///< The status of the link unit is unknown
54 OK, ///< The link unit operates normally
55 UNREACHABLE, ///< The link unit is unreachable
56 ACCESS_DENIED, ///< The link unit denies access
57 FIRMWARE_UPDATE, ///< This link unit is performing a firmware update
58 FIRMWARE_MISMATCH, ///< This link unit's firmware version does not match that of the primary unit
59 PENDING, ///< The link unit becomes active after the next reboot
60 WAITING, ///< Waiting for link unit pairing request
61 PAIRING_TIMEOUT, ///< Timeout waiting for pairing request
62 PAIRING ///< Pairing with the link unit is in progress
63 };
64
65 /** Link Unit Status */
66 structure LinkUnit {
67 LinkUnitType type; ///< Link unit type
68 string host; ///< Link unit host name, IP address or bus address
69 LinkUnitStatus status; ///< Communication status
70 string fwVersion; ///< Firmware version of the link unit
71 };
72
73 /** Full Cascading Status */
74 structure Status {
75 Role role; ///< This unit's role in the JSON-RPC cascade
76 string primaryUnit; ///< The primary unit IP address (if role is link unit)
77 int primaryLinkId; ///< The link ID of the always-present first unit
78 map<int, LinkUnit> linkUnits; ///< The list of link units (if role is primary unit)
79 };
80
81 /** Status of the Link Port */
82 structure LinkPortStatus {
83 boolean isSupported; ///< true, if Link Port is supported on this device
84 boolean isLinkDetected; ///< true, if a link on the Link Port was detected
85 boolean isLinkingConfirmationNeeded; ///< true, if confirmation for linking via Link Port is needed
86 string connectedNeighborAddr; ///< link-local IPv6 address of the currently connected neighbor, or empty
87 };
88
89 /** Event: This unit's role in the cascade has changed */
90 valueobject RoleChangedEvent extends idl.Event {
91 Role oldRole; ///< Previous role before the change
92 Role newRole; ///< New role after the change
93 string primaryUnit; ///< Primary unit IP address (if new role is link unit)
94 };
95
96 /** Event: A new link unit has been added */
97 valueobject LinkUnitAddedEvent extends event.UserEvent {
98 int linkId; ///< Link ID
99 LinkUnitType type; ///< Link unit type
100 string host; ///< Host name, IP address or bus address
101 };
102
103 /** Event: A link unit has been released */
104 valueobject LinkUnitReleasedEvent extends event.UserEvent {
105 int linkId; ///< Link ID
106 LinkUnitType type; ///< Link unit type
107 string host; ///< Host name, IP address or bus address
108 };
109
110 /** Event: A link unit's communication status has changed */
112 int linkId; ///< Link ID
113 LinkUnitType type; ///< Link unit type
114 string host; ///< Host name, IP address or bus address
115 LinkUnitStatus oldStatus; ///< Previous communication status
116 LinkUnitStatus newStatus; ///< New communication status
117 };
118
119 /** Link Port Status changed */
121 LinkPortStatus oldStatus; ///< Old Link Port status
122 LinkPortStatus newStatus; ///< New Link Port status
123 };
124
125 /**
126 * Retrieve settings for the primary unit.
127 *
128 * @return Primary unit settings
129 */
131
132 /**
133 * Set settings for the primary unit.
134 *
135 * @param primaryUnitSettings Primary unit settings
136 *
137 * @return NO_ERROR The operation was successful
138 * @return ERR_INVALID_PARAM At least one of the parameters had an invalid value
139 */
140 int setPrimaryUnitSettings(in PrimaryUnitSettings primaryUnitSettings);
141
142 /**
143 * Retrieve the full cascading status for this unit.
144 *
145 * @return Full cascading status
146 */
148
149 /**
150 * Retrieve the current Link Port status
151 *
152 * @return Current Link Port status
153 */
155
156 /**
157 * Put a new link unit under this primary unit's control.
158 *
159 * The login credentials must have administrator privileges on the link
160 * unit. They are only used to establish a trust relationship between
161 * primary and link unit and not stored.
162 *
163 * This method can also be used to re-authenticate a link unit that
164 * denies access. In that case the linkId and host parameter must
165 * exactly match the existing values.
166 *
167 * @param linkId The ID for the new link unit
168 * @param host The link unit's host name or IP address
169 * @param login The administrator login for the link unit
170 * @param password The administrator password for the link unit
171 * @param newPassword The new default administrator password for the unit.
172 * This is needed for adding a link unit that still has default
173 * settings and requires a password change. Otherwise it can be
174 * left empty. \c login must be the default admin.
175 *
176 * @return NO_ERROR The operation was successful
177 * @return ERR_INVALID_PARAM One of the parameters had an invalid value
178 * @return ERR_UNSUPPORTED_ON_LINK_UNIT This unit is currently a link unit and can't have link units of its own
179 * @return ERR_LINK_ID_IN_USE The specified link ID is already in use
180 * @return ERR_HOST_IN_USE The specified host is already in use
181 * @return ERR_LINK_UNIT_UNREACHABLE Connection to the link unit failed
182 * @return ERR_LINK_UNIT_ACCESS_DENIED The credentials for the link unit were invalid
183 * @return ERR_LINK_UNIT_REFUSED The remote unit refused to become our link unit because it's a primary unit itself
184 * @return ERR_UNIT_BUSY This unit is currently busy with handling another request
185 * @return ERR_NOT_SUPPORTED This device does not support PDU linking
186 * @return ERR_PASSWORD_CHANGE_REQUIRED The specified link unit requires a password change
187 * @return ERR_PASSWORD_POLICY The new password did not meet the requirements
188 * @return ERR_LINK_UNIT_COMM_FAILED Communication with the link unit failed
189 * @return ERR_LINK_UNIT_NOT_SUPPORTED Link unit does not support cascading
190 * @return ERR_FIRMWARE_VERSION_MISMATCH The firmware version of the link unit does not match that of the primary unit
191 */
192 int addLinkUnit(in int linkId, in string host, in string login, in string password, in string newPassword);
193
194 /**
195 * Put a new link unit under this primary unit's control.
196 *
197 * The login credentials must have administrator privileges on the link
198 * unit. They are only used to establish a trust relationship between
199 * primary and link unit and not stored.
200 *
201 * This method can also be used to re-authenticate a link unit that
202 * denies access. In that case the linkId and host parameter must
203 * exactly match the existing values.
204 *
205 * @param linkId The ID for the new link unit
206 * @param host The link unit's host name or IP address
207 * @param login The administrator login for the link unit
208 * @param password The administrator password for the link unit
209 * @param newPassword The new default administrator password for the unit.
210 * This is needed for adding a link unit that still has default
211 * settings and requires a password change. Otherwise it can be
212 * left empty. \c login must be the default admin.
213 * @param disableStrongPasswordReq if \c true, this disables the strong password
214 * requirements on the link unit if \c newPassword is set
215 *
216 * @return see \ref addLinkUnit
217 */
218 int addLinkUnit2(in int linkId, in string host, in string login, in string password, in string newPassword, in boolean disableStrongPasswordReq);
219
220 /**
221 * Release a link unit from this primary unit's control.
222 *
223 * @param linkId The ID of the link unit
224 *
225 * @return NO_ERROR The operation was successful
226 * @return ERR_INVALID_PARAM The specified link ID is invalid
227 */
228 int releaseLinkUnit(in int linkId);
229
230 /**
231 * Request to make this unit a link unit and put it under the remote
232 * primary unit's control.
233 *
234 * This method is usually called by the primary unit when adding a new
235 * link unit. The link will only be established once finalizeLink() is
236 * successfully called.
237 *
238 * @param token Authorization token for future requests
239 *
240 * @return NO_ERROR The operation was successful
241 * @return ERR_UNSUPPORTED_ON_PRIMARY_UNIT This unit is a primary unit and can't become a link unit
242 * @return ERR_NOT_SUPPORTED This device does not support PDU linking
243 */
244 int requestLink(in string token);
245
246 /**
247 * Finalize the link with this link unit.
248 *
249 * @param token same authorization token as used for requestLink()
250 *
251 * This method should only be called by the primary unit in order to
252 * acknowledge the establishment of the link to the link unit and
253 * finalize the link build-up. The linking will only take effect once
254 * the link unit received this acknowledgement.
255 *
256 * If this method fails, you will get the ACCESS_DENIED status for this
257 * link unit and you will have to re-authenticate it.
258 */
259 void finalizeLink(in string token);
260
261 /**
262 * Release this link unit from the remote primary unit's control.
263 *
264 * This method is usually called by the primary unit when releasing a
265 * link unit. This unit will become a standalone unit.
266 */
267 void unlink();
268
269 /**
270 * Check which cascading roles this unit supports.
271 *
272 * @return vector with Roles that are supported by this unit
273 */
274 vector<Role> getSupportedRoles();
275
276 /**
277 * Check which type of link units this unit supports.
278 *
279 * @return vector with supported link unit types
280 */
281 vector<LinkUnitType> getSupportedLinkUnitTypes();
282
283 /**
284 * Can be called on a network cascade primary unit to add expansion
285 * units of the network cascade as link units.
286 *
287 * @param linkId The ID for the new link unit
288 * @param nodeIndex The expansion unit's index in the network cascade (1 - 15)
289 * @param login The administrator login for the link unit
290 * @param password The administrator password for the link unit
291 * @param positionDependent If true, host names that depend on the node index will be used.
292 * If false, unique link-local IPv6 addresses will be used for linking.
293 *
294 * @return see \ref addLinkUnit
295 *
296 */
297 int addCascadeLinkUnit(in int linkId, in int nodeIndex, in string login, in string password, in boolean positionDependent);
298
299 /**
300 * Add a neighbor that was discovered on the link port as link unit. If
301 * a new password needs to be set, it will be generated.
302 *
303 * @return NO_ERROR The operation was successful
304 * @return ERR_INVALID_PARAM No neighbor currently discovered or no link id left
305 * @return ERR_UNSUPPORTED_ON_LINK_UNIT This unit is currently a link unit and can't have link units of its own
306 * @return ERR_HOST_IN_USE The link port neighbor was already added
307 * @return ERR_LINK_UNIT_UNREACHABLE Connection to the link unit failed
308 * @return ERR_LINK_UNIT_ACCESS_DENIED The credentials for the link unit were invalid
309 * @return ERR_LINK_UNIT_REFUSED The remote unit refused to become our link unit because it's a primary unit itself
310 * @return ERR_UNIT_BUSY This unit is currently busy with handling another request
311 * @return ERR_NOT_SUPPORTED This device does not support PDU linking via link port
312 * @return ERR_LINK_UNIT_COMM_FAILED Communication with the link unit failed
313 * @return ERR_LINK_UNIT_NOT_SUPPORTED Link unit does not support cascading
314 * @return ERR_FIRMWARE_VERSION_MISMATCH The firmware version of the link unit does not match that of the primary unit
315 */
317
318 /**
319 * Add a serial link unit (ScalePoint Base).
320 *
321 * As a special case, link ID 1 is used to pair the primary unit on the
322 * "internal" RS485 bus. It will not be added to the list of link units.
323 *
324 * @param linkId The ID for the new link unit
325 * @param installKey The install key from the Base unit's label (32 or 36 hex digits)
326 *
327 * @return NO_ERROR The operation was successful
328 * @return ERR_INVALID_PARAM One of the parameters had an invalid value
329 * @return ERR_UNSUPPORTED_ON_LINK_UNIT This unit is currently a link unit and can't have link units of its own
330 * @return ERR_LINK_ID_IN_USE The specified link ID is already in use
331 * @return ERR_LINK_UNIT_UNREACHABLE Connection to the link unit failed
332 * @return ERR_UNIT_BUSY This unit is currently busy with handling another request
333 * @return ERR_NOT_SUPPORTED This device does not support PDU linking
334 * @return ERR_LINK_UNIT_COMM_FAILED Communication with the link unit failed
335 */
336 int addSecureSerialLinkUnit(in int linkId, in string installKey);
337
338 /**
339 * Add a Zigbee link unit (ScalePoint Base)
340 *
341 * @param linkId The ID for the new link unit
342 * @param address Zigbee device address (16 hex digits)
343 * @param installKey The install key from the Base unit's label (with CRC, 36 hex digits)
344 *
345 * @return NO_ERROR The operation was successful
346 * @return ERR_INVALID_PARAM One of the parameters had an invalid value
347 * @return ERR_UNSUPPORTED_ON_LINK_UNIT This unit is currently a link unit and can't have link units of its own
348 * @return ERR_LINK_ID_IN_USE The specified link ID is already in use
349 * @return ERR_NOT_SUPPORTED This device does not support PDU linking
350 */
351 int addZigbeeLinkUnit(in int linkId, in string address, in string installKey);
352
353 };
354
355}
JSON-RPC Cascade Manager.
constant int ERR_HOST_IN_USE
The specified host is already in use.
constant int ERR_LINK_UNIT_REFUSED
Remote device refused to become a link unit.
constant int ERR_LINK_UNIT_UNREACHABLE
Could not connect to the link device.
vector< Role > getSupportedRoles()
Check which cascading roles this unit supports.
constant int ERR_INVALID_PARAM
A parameter was invalid.
int setPrimaryUnitSettings(in PrimaryUnitSettings primaryUnitSettings)
Set settings for the primary unit.
Status getStatus()
Retrieve the full cascading status for this unit.
constant int ERR_FIRMWARE_VERSION_MISMATCH
The firmware versions between primary and link unit do not match.
int addLinkUnit2(in int linkId, in string host, in string login, in string password, in string newPassword, in boolean disableStrongPasswordReq)
Put a new link unit under this primary unit's control.
int addLinkUnit(in int linkId, in string host, in string login, in string password, in string newPassword)
Put a new link unit under this primary unit's control.
constant int ERR_LINK_UNIT_NOT_SUPPORTED
Link unit does not support cascading.
constant int ERR_LINK_UNIT_COMM_FAILED
Communication with the link unit failed.
PrimaryUnitSettings getPrimaryUnitSettings()
Retrieve settings for the primary unit.
int addLinkPortLinkUnit()
Add a neighbor that was discovered on the link port as link unit.
constant int ERR_LINK_UNIT_ACCESS_DENIED
Login to link device failed.
int requestLink(in string token)
Request to make this unit a link unit and put it under the remote primary unit's control.
constant int ERR_LINK_ID_IN_USE
The specified link ID is already used.
LinkPortStatus getLinkPortStatus()
Retrieve the current Link Port status.
constant int NO_ERROR
Operation successful, no error.
vector< LinkUnitType > getSupportedLinkUnitTypes()
Check which type of link units this unit supports.
constant int ERR_UNSUPPORTED_ON_PRIMARY_UNIT
Operation not allowed for a primary unit.
constant int ERR_UNSUPPORTED_ON_LINK_UNIT
Operation not allowed for a link unit.
constant int ERR_UNIT_BUSY
The unit could not respond because it was busy.
Role
JSON-RPC Cascade Role.
@ LINK_UNIT
Link unit under primary unit control.
@ STANDALONE
Standalone unit, not in cascade.
@ PRIMARY_UNIT
Primary unit controlling other devices.
void finalizeLink(in string token)
Finalize the link with this link unit.
constant int ERR_PASSWORD_POLICY
The given password did not meet the requirements.
constant int ERR_NOT_SUPPORTED
Operation not supported on this device.
int addZigbeeLinkUnit(in int linkId, in string address, in string installKey)
Add a Zigbee link unit (ScalePoint Base)
void unlink()
Release this link unit from the remote primary unit's control.
LinkUnitStatus
Link Unit Communication Status.
@ FIRMWARE_UPDATE
This link unit is performing a firmware update.
@ FIRMWARE_MISMATCH
This link unit's firmware version does not match that of the primary unit.
@ ACCESS_DENIED
The link unit denies access.
@ OK
The link unit operates normally.
@ PAIRING_TIMEOUT
Timeout waiting for pairing request.
@ PAIRING
Pairing with the link unit is in progress.
@ PENDING
The link unit becomes active after the next reboot.
@ WAITING
Waiting for link unit pairing request.
@ UNKNOWN
The status of the link unit is unknown.
@ UNREACHABLE
The link unit is unreachable.
constant int ERR_PASSWORD_CHANGE_REQUIRED
The unit requires a password change.
int addCascadeLinkUnit(in int linkId, in int nodeIndex, in string login, in string password, in boolean positionDependent)
Can be called on a network cascade primary unit to add expansion units of the network cascade as link...
@ ZIGBEE
Linking via Zigbee (ScalePoint)
@ NETWORK
High-level linking via JSON-RPC API.
@ SECURE_SERIAL
Linking via encrypted serial bus (ScalePoint)
int releaseLinkUnit(in int linkId)
Release a link unit from this primary unit's control.
int addSecureSerialLinkUnit(in int linkId, in string installKey)
Add a serial link unit (ScalePoint Base).
Raritan JSON-RPC.
Basic IDL definitions.
Definition Event.idl:10
boolean isLinkingConfirmationNeeded
true, if confirmation for linking via Link Port is needed
boolean isSupported
true, if Link Port is supported on this device
string connectedNeighborAddr
link-local IPv6 address of the currently connected neighbor, or empty
boolean isLinkDetected
true, if a link on the Link Port was detected
Event: A new link unit has been added.
string host
Host name, IP address or bus address.
Event: A link unit has been released.
string host
Host name, IP address or bus address.
Event: A link unit's communication status has changed.
LinkUnitStatus oldStatus
Previous communication status.
string host
Host name, IP address or bus address.
LinkUnitStatus newStatus
New communication status.
LinkUnitType type
Link unit type.
LinkUnitStatus status
Communication status.
string fwVersion
Firmware version of the link unit.
string host
Link unit host name, IP address or bus address.
string caCertChain
CA certificate chain that signs the link unit TLS certs.
boolean allowOffTimeRangeCerts
allow expired and not yet valid TLS certs
Event: This unit's role in the cascade has changed.
string primaryUnit
Primary unit IP address (if new role is link unit)
Role oldRole
Previous role before the change.
Role newRole
New role after the change.
string primaryUnit
The primary unit IP address (if role is link unit)
map< int, LinkUnit > linkUnits
The list of link units (if role is primary unit)
int primaryLinkId
The link ID of the always-present first unit.
Role role
This unit's role in the JSON-RPC cascade.
Common base for all events.
Definition Event.idl:13