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 */
15 interface AlertedSensorManager {
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 */
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> 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
A global instance keeping track of sensors in alerted state.
Definition AlertedSensorManager.idl:15
sensors::AlertedSensorManager::getSensorCounts
SensorCounts getSensorCounts()
Retrieve the current sensor counts.
sensors::AlertedSensorManager::getAlertedSensors
vector< SensorData > getAlertedSensors()
Retrieve a list of currently alerted sensors.
sensors::AlertedSensorManager::AlertState
AlertState
Sensor alert state.
Definition AlertedSensorManager.idl:18
sensors::AlertedSensorManager::WARNED
@ WARNED
Sensor is in warned state.
Definition AlertedSensorManager.idl:22
sensors::AlertedSensorManager::NORMAL
@ NORMAL
Sensor is not alerted.
Definition AlertedSensorManager.idl:20
sensors::AlertedSensorManager::CRITICAL
@ CRITICAL
Sensor is in critical state.
Definition AlertedSensorManager.idl:21
sensors::AlertedSensorManager::UNAVAILABLE
@ UNAVAILABLE
Sensor is unavailable.
Definition AlertedSensorManager.idl:19
sensors::AlertedSensorManager::getAllSensors
vector< SensorData > getAllSensors()
Retrieve a list of all monitored sensors.
sensors::Sensor
Sensor interface
Definition Sensor.idl:15
idl
Basic IDL definitions.
Definition Event.idl:10
sensors
Sensors Model.
Definition AccumulatingNumericSensor.idl:13
idl::Event
Common base for all events.
Definition Event.idl:13
sensors::AlertedSensorManager::AlertedSensorsChangedEvent
Event: One or more sensors' alert states have changed.
Definition AlertedSensorManager.idl:66
sensors::AlertedSensorManager::AlertedSensorsChangedEvent::counts
SensorCounts counts
Sensor statistics after the change.
Definition AlertedSensorManager.idl:67
sensors::AlertedSensorManager::AlertedSensorsChangedEvent::removedSensors
vector< Sensor > removedSensors
Removed sensors.
Definition AlertedSensorManager.idl:69
sensors::AlertedSensorManager::AlertedSensorsChangedEvent::changedSensors
vector< SensorData > changedSensors
Changed or added sensors.
Definition AlertedSensorManager.idl:68
sensors::AlertedSensorManager::MonitoredSensorsChangedEvent
Event: A change in the list of monitored sensors occurred.
Definition AlertedSensorManager.idl:53
sensors::AlertedSensorManager::MonitoredSensorsChangedEvent::counts
SensorCounts counts
Sensor statistics after the change.
Definition AlertedSensorManager.idl:54
sensors::AlertedSensorManager::SensorCounts
Statistics about monitored sensors.
Definition AlertedSensorManager.idl:26
sensors::AlertedSensorManager::SensorCounts::critical
int critical
Number of critical sensors.
Definition AlertedSensorManager.idl:29
sensors::AlertedSensorManager::SensorCounts::unavailable
int unavailable
Number of unavailable sensors.
Definition AlertedSensorManager.idl:28
sensors::AlertedSensorManager::SensorCounts::total
int total
Total number of monitored sensors.
Definition AlertedSensorManager.idl:27
sensors::AlertedSensorManager::SensorCounts::warned
int warned
Number of warned sensors.
Definition AlertedSensorManager.idl:30
sensors::AlertedSensorManager::SensorData
Data about a monitored sensor.
Definition AlertedSensorManager.idl:40
sensors::AlertedSensorManager::SensorData::alertState
AlertState alertState
Current alert state of the sensor.
Definition AlertedSensorManager.idl:43
sensors::AlertedSensorManager::SensorData::parent
Object parent
Reference to the sensor's parent object.
Definition AlertedSensorManager.idl:42
sensors::AlertedSensorManager::SensorData::sensor
Sensor sensor
Reference to the sensor object.
Definition AlertedSensorManager.idl:41