Raritan PX2/PX3 JSON-RPC API

PowerMeterController.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright 2015 Raritan Inc. All rights reserved.
4 */
5
6 #ifndef __PDUMODEL_POWER_METER_CONTROLLER_IDL__
7 #define __PDUMODEL_POWER_METER_CONTROLLER_IDL__
8
9 #include <Panel.idl>
10 #include <UserEvent.idl>
11
12 /**
13 * PDU Model
14 */
15 module pdumodel {
16
17 /**
18 * Power Meter Controller (PMC) interface
19 */
20 interface PowerMeterController_1_1_5 {
21
22 constant int ERR_INVALID_PARAM = 1; ///< Invalid parameters
23 constant int ERR_METER_BOARD_BUSY = 2; ///< A power meter with the given ID already exists
24
25 /** Meter board scan result */
26 structure ScanResult {
27 boolean present; ///< Meter board was found
28 int meterCount; ///< Number of meter channels
29 };
30
31 /**
32 * Scan for presence and configuration of a meter board.
33 *
34 * @param powerMeterId ID of meter board to be scanned
35 * @param result Detected meter board properties
36 *
37 * @return 0 if OK
38 * @return 1 if the meter board ID is out of range
39 */
40 int scanMeterBoard(in int powerMeterId, out ScanResult result);
41
42 /** Event: A power meter or panel was created */
43 valueobject PowerMeterCreatedEvent extends event.UserEvent {
44 PowerMeter_1_1_5 powerMeter; ///< New power meter instance
45 PowerMeter_1_1_5.Config config; ///< New power meter config
46 PowerMeter_1_1_5.Settings settings; ///< New power meter settings
47 };
48
49 /** Event: A power meter was deleted */
50 valueobject PowerMeterDeletedEvent extends event.UserEvent {
51 PowerMeter_1_1_5.Config config; ///< Old power meter config
52 PowerMeter_1_1_5.Settings settings; ///< Old power meter settings
53 };
54
55 /** Event: A panel was created */
56 valueobject PanelCreatedEvent extends PowerMeterCreatedEvent {
57 Panel_1_1_5.PanelSettings panelSettings; ///< New panel settings
58 };
59
60 /** Event:: A panel was deleted */
61 valueobject PanelDeletedEvent extends PowerMeterDeletedEvent {
62 Panel_1_1_5.PanelSettings panelSettings; ///< Old panel settings
63 };
64
65 /**
66 * Retrieve the list of power meters and panels.
67 *
68 * @return Power meter and panel instances, indexed by power meter ID
69 */
70 map<int, PowerMeter_1_1_5> getPowerMeters();
71
72 /**
73 * Create a new standalone power meter (no panel).
74 *
75 * @param powerMeter Result: Newly created instance
76 * @param config New power meter config
77 * @param settings Power meter settings
78 *
79 * @return 0 if OK
80 * @return 1 if any parameters are invalid
81 * @return 2 if a power meter with the given ID already exists
82 */
83 int createPowerMeter(out PowerMeter_1_1_5 powerMeter,
84 in PowerMeter_1_1_5.Config config,
85 in PowerMeter_1_1_5.Settings settings);
86
87 /**
88 * Create a new panel.
89 *
90 * @param panel Result: Newly created instance
91 * @param config New power meter config
92 * @param powerMeterSettings Power meter settings
93 * @param panelSettings Panel settings
94 *
95 * @return 0 if OK
96 * @return 1 if any parameters are invalid
97 * @return 2 if a power meter with the given ID already exists
98 */
99 int createPanel(out Panel_1_1_5 panel,
100 in PowerMeter_1_1_5.Config config,
101 in PowerMeter_1_1_5.Settings powerMeterSettings,
102 in Panel_1_1_5.PanelSettings panelSettings);
103
104 /**
105 * Delete a panel or power meter.
106 *
107 * @param powerMeterId Power meter ID
108 *
109 * @return 0 if OK
110 * @return 1 if the power meter ID is invalid
111 */
112 int deletePowerMeter(in int powerMeterId);
113
114 };
115
116 }
117
118 #endif
pdumodel::PowerMeterController_1_1_5::ScanResult
Meter board scan result.
Definition: PowerMeterController.idl:26
pdumodel::PowerMeter_1_1_5
A three-phase power meter (PMC).
Definition: PowerMeter.idl:23
pdumodel::PowerMeterController_1_1_5
Power Meter Controller (PMC) interface.
Definition: PowerMeterController.idl:20
pdumodel::Panel_1_1_5::PanelSettings
Panel settings.
Definition: Panel.idl:37
pdumodel::PowerMeterController_1_1_5::ScanResult::present
boolean present
Meter board was found.
Definition: PowerMeterController.idl:27
pdumodel::PowerMeterController_1_1_5::settings
PowerMeter_1_1_5::Settings settings
New power meter settings.
Definition: PowerMeterController.idl:46
pdumodel::PowerMeterController_1_1_5::config
PowerMeter_1_1_5::Config config
New power meter config.
Definition: PowerMeterController.idl:45
pdumodel::PowerMeter_1_1_5::Settings
Power meter settings.
Definition: PowerMeter.idl:87
pdumodel
PDU Model.
Definition: Ade.idl:12
pdumodel::PowerMeterController_1_1_5::ScanResult::meterCount
int meterCount
Number of meter channels.
Definition: PowerMeterController.idl:28
pdumodel::Panel_1_1_5
PMC panel.
Definition: Panel.idl:26
pdumodel::PowerMeter_1_1_5::Config
Power meter configuration.
Definition: PowerMeter.idl:36