Legrand / Raritan Xerus™ JSON-RPC API for Remote Access Devices like KX4-101, KX3G2

Loading...
Searching...
No Matches
PowerDeviceManager.idl
1#ifndef __RADM_POWER_DEVICE_MANAGER_IDL__
2#define __RADM_POWER_DEVICE__MANAGER_IDL__
3
4#include <UserEvent.idl>
5#include <PowerDevice.idl>
6
7module radm {
8
9 interface PowerDeviceManager {
10 constant int ERR_INVALID_ARGUMENT = 1; ///< Invalid argument
11 constant int ERR_PDU_ALREADY_EXISTS = 2; ///< A PDU with that host name already exists
12 constant int ERR_MAX_PDUS_REACHED = 3; ///< Maximum number of pdus reached
13 constant int ERR_PDU_NOT_FOUND = 4; ///< A PDU with that host name does not exist
14
15 structure Settings {
16 int powerCycleDelay; ///< Delay between turning off and turning on in power cycle (in seconds)
17 };
18
19 /**
20 * Get configured power devices
21 *
22 * @return Map of configured power devices, keyed by host name
23 */
24 map<string, PowerDevice> getPowerDevices();
25
26 /**
27 * Add a new power device (PDU)
28 *
29 * @param settings Settings for creating the new power device
30 *
31 * @return 0 on success
32 * @return 1 if any given setting was invalid
33 * @return 2 if a PDU with that host name or name already exists
34 * @return 3 if the maximum number of PDUs is reached
35 * @return 101..106 in case of an SNMP error during PDU connection (see constants in {@link PowerDevice}
36 */
37 int addPowerDevice(in PowerDevice.Settings settings);
38
39 /**
40 * Remove the given power device (PDU)
41 *
42 * @param host Host name of the PDU to be removed
43 *
44 * @return 0 on success
45 * @return 4 if there is no PDU with that host name
46 */
47 int deletePowerDevice(in string host);
48
49 /**
50 * Get global power device settings
51 *
52 * @return Settings
53 */
54 Settings getSettings();
55
56 /**
57 * Set global power device settings
58 *
59 * @param settings New settings
60 *
61 * @return 0 on success
62 * @return 1 if any setting was invalid
63 */
64 int setSettings(in Settings settings);
65
66 /** Event: A power device was added or removed */
67 valueobject PowerDeviceChangedEvent extends event.UserEvent {
68 map<string, PowerDevice> powerDevices; ///< Map of power devices after change
69 };
70
71 /** Event: A power device was added */
72 valueobject PowerDeviceAddedEvent extends PowerDeviceChangedEvent {
73 PowerDevice device; ///< Newly created power device
74 };
75
76 /** Event: A power device was removed */
77 valueobject PowerDeviceRemovedEvent extends PowerDeviceChangedEvent {
78 string deviceId; ///< ID of the removed power device
79 string deviceName; ///< Name of the removed power device
80 };
81
82 /** Event: Manager settings changed */
83 valueobject SettingsChangedEvent extends event.UserEvent {
84 Settings oldSettings; ///< Settings before change
85 Settings newSettings; ///< Settings after change
86 };
87 };
88}
89
90#endif //__RADM_POWER_DEVICE_MANAGER_IDL__
radm::PowerDeviceManager
Definition PowerDeviceManager.idl:9
radm::PowerDeviceManager::getPowerDevices
map< string, PowerDevice > getPowerDevices()
Get configured power devices.
radm::PowerDeviceManager::getSettings
Settings getSettings()
Get global power device settings.
radm::PowerDeviceManager::deletePowerDevice
int deletePowerDevice(in string host)
Remove the given power device (PDU)
radm::PowerDeviceManager::setSettings
int setSettings(in Settings settings)
Set global power device settings.
radm::PowerDeviceManager::ERR_INVALID_ARGUMENT
constant int ERR_INVALID_ARGUMENT
Invalid argument.
Definition PowerDeviceManager.idl:10
radm::PowerDeviceManager::ERR_PDU_ALREADY_EXISTS
constant int ERR_PDU_ALREADY_EXISTS
A PDU with that host name already exists.
Definition PowerDeviceManager.idl:11
radm::PowerDeviceManager::ERR_MAX_PDUS_REACHED
constant int ERR_MAX_PDUS_REACHED
Maximum number of pdus reached.
Definition PowerDeviceManager.idl:12
radm::PowerDeviceManager::addPowerDevice
int addPowerDevice(in PowerDevice::Settings settings)
Add a new power device (PDU)
radm::PowerDeviceManager::ERR_PDU_NOT_FOUND
constant int ERR_PDU_NOT_FOUND
A PDU with that host name does not exist.
Definition PowerDeviceManager.idl:13
radm::PowerDevice
Definition PowerDevice.idl:8
radm
Radm Model.
Definition AccessPort.idl:8
radm::PowerDeviceManager::PowerDeviceAddedEvent
Event: A power device was added.
Definition PowerDeviceManager.idl:72
radm::PowerDeviceManager::PowerDeviceAddedEvent::device
PowerDevice device
Newly created power device.
Definition PowerDeviceManager.idl:73
radm::PowerDeviceManager::PowerDeviceChangedEvent
Event: A power device was added or removed.
Definition PowerDeviceManager.idl:67
radm::PowerDeviceManager::PowerDeviceChangedEvent::powerDevices
map< string, PowerDevice > powerDevices
Map of power devices after change.
Definition PowerDeviceManager.idl:68
radm::PowerDeviceManager::PowerDeviceRemovedEvent
Event: A power device was removed.
Definition PowerDeviceManager.idl:77
radm::PowerDeviceManager::PowerDeviceRemovedEvent::deviceName
string deviceName
Name of the removed power device.
Definition PowerDeviceManager.idl:79
radm::PowerDeviceManager::PowerDeviceRemovedEvent::deviceId
string deviceId
ID of the removed power device.
Definition PowerDeviceManager.idl:78
radm::PowerDeviceManager::SettingsChangedEvent
Event: Manager settings changed.
Definition PowerDeviceManager.idl:83
radm::PowerDeviceManager::SettingsChangedEvent::newSettings
Settings newSettings
Settings after change.
Definition PowerDeviceManager.idl:85
radm::PowerDeviceManager::SettingsChangedEvent::oldSettings
Settings oldSettings
Settings before change.
Definition PowerDeviceManager.idl:84
radm::PowerDeviceManager::Settings
Definition PowerDeviceManager.idl:15
radm::PowerDeviceManager::Settings::powerCycleDelay
int powerCycleDelay
Delay between turning off and turning on in power cycle (in seconds)
Definition PowerDeviceManager.idl:16
radm::PowerDevice::Settings
Definition PowerDevice.idl:47