Raritan PX2/PX3 JSON-RPC API: pdu-json-rpc-api/idl/AlertedSensorManager.idl Source File

Raritan PX2/PX3 JSON-RPC API

AlertedSensorManager.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright 2018 Raritan Inc. All rights reserved.
4 */
5
6 #ifndef __ALERTED_SENSOR_MANAGER_IDL__
7 #define __ALERTED_SENSOR_MANAGER_IDL__
8
9 #include <Sensor.idl>
10
11 /** Sensors model */
12 module sensors {
13
14 /** A global instance keeping track of sensors in alerted state */
15 interface AlertedSensorManager_1_0_1 {
16
17 /** Sensor alert state */
18 enumeration AlertState {
19 UNAVAILABLE, ///< Sensor is unavailable
20 NORMAL, ///< Sensor is not alerted
21 CRITICAL, ///< Sensor is in critical state
22 WARNED ///< Sensor is in warned state
23 };
24
25 /** Statistics about monitored sensors */
26 structure SensorCounts {
27 int total; ///< Total number of monitored sensors
28 int unavailable; ///< Number of unavailable sensors
29 int critical; ///< Number of critical sensors
30 int warned; ///< Number of warned sensors
31 };
32
33 /**
34 * Data about a monitored sensor.
35 *
36 * All entries include a reference to the sensor's parent object (e.g.
37 * an inlet or a peripheral device slot), allowing a client to identify
38 * an unknown alerted sensor with just a few RPC calls.
39 */
40 structure SensorData {
41 Sensor_4_0_3 sensor; ///< Reference to the sensor object
42 Object parent; ///< Reference to the sensor's parent object
43 AlertState alertState; ///< Current alert state of the sensor
44 };
45
46 /**
47 * Event: A change in the list of monitored sensors occurred.
48 *
49 * This event is fired when sensors are added to or removed from the
50 * list of monitored sensors. It is not fired when a monitored sensor's
51 * alert state changes.
52 */
53 valueobject MonitoredSensorsChangedEvent extends idl.Event {
54 SensorCounts counts; ///< Sensor statistics after the change
55 };
56
57 /**
58 * Event: One or more sensors' alert states have changed.
59 *
60 * This event is fired whenever the result of getAlertedSensors()
61 * changes, i.e. in the following cases:
62 * - An existing sensor's alert state changes
63 * - A newly added sensor is alerted
64 * - A sensor that was alerted is removed
65 */
66 valueobject AlertedSensorsChangedEvent extends idl.Event {
67 SensorCounts counts; ///< Sensor statistics after the change
68 vector<SensorData> changedSensors; ///< Changed or added sensors
69 vector<Sensor_4_0_3> removedSensors; ///< Removed sensors
70 };
71
72 /**
73 * Retrieve the current sensor counts.
74 *
75 * @return Current sensor counts
76 */
77 SensorCounts getSensorCounts();
78
79 /**
80 * Retrieve a list of all monitored sensors.
81 *
82 * @return List of monitored sensors including alert state
83 */
84 vector<SensorData> getAllSensors();
85
86 /**
87 * Retrieve a list of currently alerted sensors.
88 *
89 * @return List of alerted sensors
90 */
91 vector<SensorData> getAlertedSensors();
92
93 };
94
95 }
96
97 #endif
sensors::AlertedSensorManager_1_0_1::SensorData::sensor
Sensor_4_0_3 sensor
Reference to the sensor object.
Definition: AlertedSensorManager.idl:41
sensors::AlertedSensorManager_1_0_1::UNAVAILABLE
Sensor is unavailable.
Definition: AlertedSensorManager.idl:19
sensors::AlertedSensorManager_1_0_1::SensorData
Data about a monitored sensor.
Definition: AlertedSensorManager.idl:40
sensors::AlertedSensorManager_1_0_1::SensorCounts::total
int total
Total number of monitored sensors.
Definition: AlertedSensorManager.idl:27
sensors::AlertedSensorManager_1_0_1::CRITICAL
Sensor is in critical state.
Definition: AlertedSensorManager.idl:21
idl
Basic IDL definitions.
Definition: Event.idl:10
sensors::AlertedSensorManager_1_0_1::SensorCounts::warned
int warned
Number of warned sensors.
Definition: AlertedSensorManager.idl:30
sensors::AlertedSensorManager_1_0_1::removedSensors
vector< Sensor_4_0_3 > removedSensors
Removed sensors.
Definition: AlertedSensorManager.idl:69
sensors::AlertedSensorManager_1_0_1::SensorCounts
Statistics about monitored sensors.
Definition: AlertedSensorManager.idl:26
sensors::AlertedSensorManager_1_0_1::NORMAL
Sensor is not alerted.
Definition: AlertedSensorManager.idl:20
sensors::Sensor_4_0_3
Sensor interface
Definition: Sensor.idl:15
sensors::AlertedSensorManager_1_0_1::SensorCounts::unavailable
int unavailable
Number of unavailable sensors.
Definition: AlertedSensorManager.idl:28
sensors::AlertedSensorManager_1_0_1::AlertState
AlertState
Sensor alert state.
Definition: AlertedSensorManager.idl:18
sensors
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
sensors::AlertedSensorManager_1_0_1::changedSensors
vector< SensorData > changedSensors
Changed or added sensors.
Definition: AlertedSensorManager.idl:68
sensors::AlertedSensorManager_1_0_1::SensorData::alertState
AlertState alertState
Current alert state of the sensor.
Definition: AlertedSensorManager.idl:43
sensors::AlertedSensorManager_1_0_1::SensorCounts::critical
int critical
Number of critical sensors.
Definition: AlertedSensorManager.idl:29
sensors::AlertedSensorManager_1_0_1
A global instance keeping track of sensors in alerted state.
Definition: AlertedSensorManager.idl:15
sensors::AlertedSensorManager_1_0_1::SensorData::parent
Object parent
Reference to the sensor&#39;s parent object.
Definition: AlertedSensorManager.idl:42