Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
Loading...
Searching...
No Matches
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 */
12module sensors {
13
14 /** A global instance keeping track of sensors in alerted state */
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 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 */
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> removedSensors; ///< Removed sensors
70 };
71
72 /**
73 * Retrieve the current sensor counts.
74 *
75 * @return Current sensor counts
76 */
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
A global instance keeping track of sensors in alerted state.
SensorCounts getSensorCounts()
Retrieve the current sensor counts.
vector< SensorData > getAlertedSensors()
Retrieve a list of currently alerted sensors.
@ CRITICAL
Sensor is in critical state.
@ UNAVAILABLE
Sensor is unavailable.
vector< SensorData > getAllSensors()
Retrieve a list of all monitored sensors.
Sensor interface
Definition: Sensor.idl:15
Basic IDL definitions.
Definition: Event.idl:10
Sensors Model.
Common base for all events.
Definition: Event.idl:13
Event: One or more sensors' alert states have changed.
SensorCounts counts
Sensor statistics after the change.
vector< SensorData > changedSensors
Changed or added sensors.
Event: A change in the list of monitored sensors occurred.
SensorCounts counts
Sensor statistics after the change.
Statistics about monitored sensors.
int unavailable
Number of unavailable sensors.
int total
Total number of monitored sensors.
AlertState alertState
Current alert state of the sensor.
Object parent
Reference to the sensor's parent object.
Sensor sensor
Reference to the sensor object.