Raritan / Server Technology Xerus™ PDU JSON-RPC API
Outlet.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2009 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __PDUMODEL_OUTLET_IDL__
7 #define __PDUMODEL_OUTLET_IDL__
8 
9 #include <Nameplate.idl>
10 #include <NumericSensor.idl>
11 #include <StateSensor.idl>
12 #include <Pole.idl>
13 #include <Inlet.idl>
14 #include <OverCurrentProtector.idl>
15 #include <Controller.idl>
16 #include <Waveform.idl>
17 
18 /**
19  * PDU Model
20  */
21 module pdumodel {
22 
23  /** %Outlet statistics */
24  structure OutletStatistic {
25  int relayCycleCnt; ///< Relay switch count
26  int relayFailCnt; ///< Relay failure count
27  };
28 
29  /** %Outlet interface */
30  interface Outlet extends EDevice {
31 
32  constant int ERR_OUTLET_NOT_SWITCHABLE = 1; ///< Outlet is not switchable
33  constant int ERR_LOAD_SHEDDING_ACTIVE = 2; ///< Load-shedding is enabled (deprecated)
34  constant int ERR_OUTLET_DISABLED = 3; ///< Outlet is disabled
35  constant int ERR_OUTLET_NOT_OFF = 4; ///< Outlet is on or in power-cylce; unstick not possible
36 
37  constant int ERR_INVALID_PARAM = 1; ///< Invalid parameters
38 
39  /** %Outlet metadata */
40  structure MetaData {
41  string label; ///< %Outlet label
42  string receptacleType; ///< Receptacle type
43  Nameplate namePlate; ///< %Nameplate information
44  Rating rating; ///< Numerical usage ratings
45  boolean isSwitchable; ///< \c true if the outlet is switchable
46  boolean isLatching; ///< \c true if the outlet is able to keep its state after power loss
47  int maxRelayCycleCnt; ///< Maximum relay cycle count
48  boolean hasWaveformSupport; ///< Whether waveform reading is supported on this outlet
49  };
50 
51  /** %Outlet power state. Used both for switching and representing the current state */
52  enumeration PowerState {
53  PS_OFF, ///< Switch off / Power is off
54  PS_ON ///< Switch on / Power is on
55  };
56 
57  /** %Outlet LED state */
58  [deprecated]
59  structure LedState {
60  boolean red; ///< \c true if the red LED is enabled
61  boolean green; ///< \c true if the green LED is enabled
62  boolean blinking; ///< \c true if the LED is blinking
63  };
64 
65  /** %Outlet state */
66  structure State {
67  boolean available; ///< powerState is available
68  PowerState powerState; ///< Current power state of outlet
69  ///< (represented by the control state of the relay, which
70  ///< was set by the last command sent to it)
71  boolean switchOnInProgress; ///< \c true if the outlet is pending to be switched on
72  ///< after the sequencing delay has passed.
73  boolean cycleInProgress; ///< \c if a power-cycle is in progress. The outlet will
74  ///< be switched on after the cycle delay has passed.
75  boolean isLoadShed; ///< \c true if the outlet is currently switched off due
76  ///< to being non-critical and load shedding being active
77  boolean isSuspended; ///< Whether the outlet was turned off automatically due to
78  ///< being suspected to have caused an OCP trip event
79  boolean hasInrushWaveform; ///< Whether a valid waveform of last switch-on operation
80  ///< can be read using {@link #getInrushWaveform()}.
81  LedState ledState; ///< LED state (deprecated and always sent as 'off')
82  time lastPowerStateChange; ///< Time of last power state change (UNIX timestamp, UTC)
83  };
84 
85  /** %Outlet power state on device startup */
86  enumeration StartupState {
87  SS_ON, ///< %Outlet will be switched on
88  SS_OFF, ///< %Outlet will be switched off
89  SS_LASTKNOWN, ///< Last known power state will be restored
90  SS_PDUDEF ///< Use default state as defined in PDU settings
91  };
92 
93  /** %Outlet settings */
94  structure Settings {
95  string name; ///< User-defined name
96  StartupState startupState; ///< Power state after power is applied to the outlet
97  boolean usePduCycleDelay; ///< \c true to use power-cycle delay as defined in PDU settings
98  int cycleDelay; ///< %Outlet-specific power-cycle delay
99  boolean nonCritical; ///< \c true if outlet is non-critical (for load shedding)
100  int sequenceDelay; ///< Delay in ms after this outlet when switching multiple outlets on
101  };
102 
103  /** %Outlet sensors */
104  structure Sensors {
105  sensors.NumericSensor voltage; ///< RMS voltage sensor (may be a VoltageMonitoringSensor)
106  sensors.NumericSensor current; ///< RMS current sensor
107  sensors.NumericSensor peakCurrent; ///< Peak current sensor
108  sensors.NumericSensor maximumCurrent; ///< Maximum current sensor
109  sensors.NumericSensor unbalancedCurrent; ///< Current unbalance sensor
110  sensors.NumericSensor activePower; ///< Active power sensor
111  sensors.NumericSensor reactivePower; ///< Reactive power sensor
112  sensors.NumericSensor apparentPower; ///< Apparent power sensor
113  sensors.NumericSensor powerFactor; ///< Power factor sensor
114  sensors.NumericSensor displacementPowerFactor;///< Displacement power factor sensor
115  sensors.NumericSensor activeEnergy; ///< Active energy sensor
116  sensors.NumericSensor apparentEnergy; ///< Apparent energy sensor
117  sensors.NumericSensor phaseAngle; ///< Phase angle sensor
118  sensors.NumericSensor lineFrequency; ///< AC line frequency sensor
119  sensors.NumericSensor crestFactor; ///< Crest factor sensor
120  sensors.NumericSensor voltageThd; ///< Voltage total harmonic distortion sensor
121  sensors.NumericSensor currentThd; ///< Current total harmonic distortion sensor
122  sensors.NumericSensor inrushCurrent; ///< In-rush current occuring after turning outlet on
123  sensors.StateSensor outletState; ///< %Outlet power state sensor
124  };
125 
126  /** Event: Power control was initiated */
127  valueobject PowerControlEvent extends event.UserEvent {
128  PowerState state; ///< State the outlet was switched to (if cycle is false)
129  boolean cycle; ///< Whether the outlet was cycled
130  };
131 
132  /** Event: Outlet state has changed */
133  valueobject StateChangedEvent extends idl.Event {
134  State oldState; ///< State before change
135  State newState; ///< State after change
136  };
137 
138  /** Event: Outlet settings have been changed */
139  valueobject SettingsChangedEvent extends event.UserEvent {
140  Settings oldSettings; ///< Settings before change
141  Settings newSettings; ///< Settings after change
142  };
143 
144  /**
145  * Retrieve the outlet metadata.
146  *
147  * @return %Outlet metadata
148  */
150 
151  /**
152  * Get the outlet sensors.
153  *
154  * @return %Outlet sensors
155  */
157 
158  /**
159  * Retrieve the outlet state.
160  *
161  * @return %Outlet state
162  */
164 
165  /**
166  * Switch the outlet.
167  *
168  * @param pstate New power state
169  *
170  * @return 0 if OK
171  * @return 1 if the outlet is not switchable
172  * @return 3 if the outlet is disabled
173  */
174  int setPowerState(in PowerState pstate);
175 
176  /**
177  * Power-cycle the outlet.
178  *
179  * @return 0 if OK
180  * @return 1 if the outlet is not switchable
181  * @return 3 if the outlet is disabled
182  */
184 
185  /**
186  * Retrieve the outlet settings.
187  *
188  * @return %Outlet settings
189  */
191 
192  /**
193  * Change the outlet settings.
194  *
195  * @param settings New outlet settings
196  *
197  * @return 0 if OK
198  * @return 1 if any parameters are invalid
199  */
200  int setSettings(in Settings settings);
201 
202  /**
203  * Get inlet, overcurrent protector and poles.
204  *
205  * @param i Result: %Inlet reference
206  * @param o Result: Overcurrent protector reference
207  * @param p Result: List of poles
208  */
209  void getIOP(out Inlet i, out OverCurrentProtector o, out vector<Pole> p);
210 
211  /**
212  * Get the controller for this outlet.
213  *
214  * @return Sub controller reference
215  */
217 
218  /**
219  * Get the voltage and current waveforms at the time of last switch on operation.
220  *
221  * @note If waveform reading is not supported or a waveform could not be acquired for other
222  * reasons (e.g. the outlet not actually be switchable, or the outlet board being reset
223  * since the outlet was turned on), an empty waveform is returned.
224  *
225  * @return Waveform samples
226  */
228 
229  /**
230  * Trigger an attempt to un-stick sticking relay contacts
231  *
232  * Warning: Please contact Tech Support before using this.
233  *
234  * Tries repairing relay contacts that are sticked together due to wear
235  * by switching the relay in a certain pattern.
236  * Prior to running this method, the outlet must be in 'off' state
237  * to acknowledge that loads were disconnected.
238  *
239  * @return 0 if unsticking was triggered successfully
240  * @return 1 if outlet is not switchable
241  * @return 3 if the outlet is disabled
242  * @return 4 if relay is in a power cycle or on
243  */
244  int unstick();
245  };
246 
247 }
248 
249 #endif
Sub controller interface.
Definition: Controller.idl:26
Common base interface for any kind of electrical device that is used in the PDU model,...
Definition: EDevice.idl:27
Inlet interface
Definition: Inlet.idl:22
Outlet interface
Definition: Outlet.idl:30
State getState()
Retrieve the outlet state.
boolean cycle
Whether the outlet was cycled.
Definition: Outlet.idl:129
int setSettings(in Settings settings)
Change the outlet settings.
Settings newSettings
Settings after change.
Definition: Outlet.idl:141
PowerState
Outlet power state.
Definition: Outlet.idl:52
@ PS_OFF
Switch off / Power is off.
Definition: Outlet.idl:53
int setPowerState(in PowerState pstate)
Switch the outlet.
Controller getController()
Get the controller for this outlet.
MetaData getMetaData()
Retrieve the outlet metadata.
int unstick()
Trigger an attempt to un-stick sticking relay contacts.
Settings getSettings()
Retrieve the outlet settings.
int cyclePowerState()
Power-cycle the outlet.
StartupState
Outlet power state on device startup
Definition: Outlet.idl:86
@ SS_LASTKNOWN
Last known power state will be restored.
Definition: Outlet.idl:89
@ SS_OFF
Outlet will be switched off
Definition: Outlet.idl:88
@ SS_ON
Outlet will be switched on
Definition: Outlet.idl:87
State newState
State after change.
Definition: Outlet.idl:135
Sensors getSensors()
Get the outlet sensors.
Waveform getInrushWaveform()
Get the voltage and current waveforms at the time of last switch on operation.
void getIOP(out Inlet i, out OverCurrentProtector o, out vector< Pole > p)
Get inlet, overcurrent protector and poles.
Overcurrent protector interface.
Definition: OverCurrentProtector.idl:27
A sensor with numeric readings.
Definition: NumericSensor.idl:17
Sensor with discrete readings.
Definition: StateSensor.idl:43
Basic IDL definitions.
Definition: Event.idl:10
PDU Model.
Definition: Ade.idl:12
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
Component nameplate information.
Definition: Nameplate.idl:23
Outlet statistics
Definition: Outlet.idl:24
int relayFailCnt
Relay failure count.
Definition: Outlet.idl:26
int relayCycleCnt
Relay switch count.
Definition: Outlet.idl:25
Outlet LED state
Definition: Outlet.idl:59
boolean green
true if the green LED is enabled
Definition: Outlet.idl:61
boolean blinking
true if the LED is blinking
Definition: Outlet.idl:62
boolean red
true if the red LED is enabled
Definition: Outlet.idl:60
Outlet metadata
Definition: Outlet.idl:40
string label
Outlet label
Definition: Outlet.idl:41
string receptacleType
Receptacle type.
Definition: Outlet.idl:42
boolean isSwitchable
true if the outlet is switchable
Definition: Outlet.idl:45
Rating rating
Numerical usage ratings.
Definition: Outlet.idl:44
boolean hasWaveformSupport
Whether waveform reading is supported on this outlet.
Definition: Outlet.idl:48
Nameplate namePlate
Nameplate information
Definition: Outlet.idl:43
int maxRelayCycleCnt
Maximum relay cycle count.
Definition: Outlet.idl:47
boolean isLatching
true if the outlet is able to keep its state after power loss
Definition: Outlet.idl:46
Outlet sensors
Definition: Outlet.idl:104
sensors::NumericSensor activeEnergy
Active energy sensor.
Definition: Outlet.idl:115
sensors::NumericSensor powerFactor
Power factor sensor.
Definition: Outlet.idl:113
sensors::NumericSensor voltage
RMS voltage sensor (may be a VoltageMonitoringSensor)
Definition: Outlet.idl:105
sensors::NumericSensor peakCurrent
Peak current sensor.
Definition: Outlet.idl:107
sensors::NumericSensor phaseAngle
Phase angle sensor.
Definition: Outlet.idl:117
sensors::NumericSensor lineFrequency
AC line frequency sensor.
Definition: Outlet.idl:118
sensors::NumericSensor activePower
Active power sensor.
Definition: Outlet.idl:110
sensors::NumericSensor current
RMS current sensor.
Definition: Outlet.idl:106
sensors::NumericSensor crestFactor
Crest factor sensor.
Definition: Outlet.idl:119
sensors::NumericSensor inrushCurrent
In-rush current occuring after turning outlet on.
Definition: Outlet.idl:122
sensors::NumericSensor displacementPowerFactor
Displacement power factor sensor.
Definition: Outlet.idl:114
sensors::NumericSensor voltageThd
Voltage total harmonic distortion sensor.
Definition: Outlet.idl:120
sensors::NumericSensor apparentPower
Apparent power sensor.
Definition: Outlet.idl:112
sensors::NumericSensor apparentEnergy
Apparent energy sensor.
Definition: Outlet.idl:116
sensors::NumericSensor unbalancedCurrent
Current unbalance sensor.
Definition: Outlet.idl:109
sensors::StateSensor outletState
Outlet power state sensor
Definition: Outlet.idl:123
sensors::NumericSensor maximumCurrent
Maximum current sensor.
Definition: Outlet.idl:108
sensors::NumericSensor reactivePower
Reactive power sensor.
Definition: Outlet.idl:111
sensors::NumericSensor currentThd
Current total harmonic distortion sensor.
Definition: Outlet.idl:121
Outlet settings
Definition: Outlet.idl:94
string name
User-defined name.
Definition: Outlet.idl:95
StartupState startupState
Power state after power is applied to the outlet.
Definition: Outlet.idl:96
boolean nonCritical
true if outlet is non-critical (for load shedding)
Definition: Outlet.idl:99
int cycleDelay
Outlet-specific power-cycle delay
Definition: Outlet.idl:98
int sequenceDelay
Delay in ms after this outlet when switching multiple outlets on.
Definition: Outlet.idl:100
boolean usePduCycleDelay
true to use power-cycle delay as defined in PDU settings
Definition: Outlet.idl:97
Outlet state
Definition: Outlet.idl:66
boolean isLoadShed
true if the outlet is currently switched off due to being non-critical and load shedding being active
Definition: Outlet.idl:75
boolean cycleInProgress
if a power-cycle is in progress.
Definition: Outlet.idl:73
boolean hasInrushWaveform
Whether a valid waveform of last switch-on operation can be read using getInrushWaveform().
Definition: Outlet.idl:79
LedState ledState
LED state (deprecated and always sent as 'off')
Definition: Outlet.idl:81
boolean isSuspended
Whether the outlet was turned off automatically due to being suspected to have caused an OCP trip eve...
Definition: Outlet.idl:77
boolean switchOnInProgress
true if the outlet is pending to be switched on after the sequencing delay has passed.
Definition: Outlet.idl:71
PowerState powerState
Current power state of outlet (represented by the control state of the relay, which was set by the la...
Definition: Outlet.idl:68
time lastPowerStateChange
Time of last power state change (UNIX timestamp, UTC)
Definition: Outlet.idl:82
boolean available
powerState is available
Definition: Outlet.idl:67
Numerical usage ratings.
Definition: Nameplate.idl:15
Waveform data, including metadata.
Definition: Waveform.idl:12