Legrand / Raritan / Server Technology Xerus™ JSON-RPC API: DataPushService.idl Source File

Legrand / Raritan / Server Technology Xerus™ JSON-RPC API

Loading...
Searching...
No Matches
DataPushService.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2014 Raritan Inc. All rights reserved.
4 */
5
6#include <UserEvent.idl>
7
8/** Event interface */
9module event {
10
11 /** Data push service configuration interface */
12 interface DataPushService {
13
14 /**
15 * Data Push Entry Types
16 */
17 enumeration EntryType {
18 SENSORLIST, ///< Sensor values for a set of sensors
19 SENSORLOG, ///< Sensor log
20 AMSLIST, ///< Asset Management information for a set of AMS strips
21 AMSLOG, ///< Asset Management log
22 AUDITLOG ///< Audit log
23 };
24
25 /** Error codes */
26 constant int ERR_NO_SUCH_ID = 1; ///< No such ID
27 constant int ERR_INVALID_PARAMS = 2; ///< Invalid parameters
28 constant int ERR_MAX_ENTRIES_REACHED = 3; ///< Maximum number of entries reached
29
30 /**
31 * Data Push Mqtt Settings
32 */
33 structure MqttSettings {
34 string topicPrefix; ///< Prefix added to all topics published to,
35 ///< must end with level separator '/' if non-empty
36 };
37
38 /**
39 * Data Push Entry Settings
40 */
41 [sparse_in]
42 structure EntrySettings {
43 string url; ///< Destination host
44 boolean allowOffTimeRangeCerts; ///< allow expired and not yet valid TLS certificates
45 string caCertChain; ///< TLS CA certificate chain
46 boolean useAuth; ///< \c true to use username/password authentication
47 ///< (basic authentication in case of HTTP)
48 string username; ///< Authentication user name
49 string password; ///< Password; write-only, empty to leave unchanged
50 EntryType type; ///< Type of data
51 vector<string> items; ///< Included items (e.g. list of sensors) depending on type
52 MqttSettings mqttSettings; ///< MQTT specific settings
53 };
54
55 /**
56 * Data Push Entry Status
57 */
58 structure EntryStatus {
59 boolean busy; ///< \c true if the entry is currently being pushed
60 boolean rescheduled; ///< \c true if the entry is set to be pushed again
61 ///< immediately after completion
62 time lastAttemptTime; ///< UNIX timestamp (UTC) of the last push attempt (0 = never)
63 time lastSuccessTime; ///< UNIX timestamp (UTC) of last successful push (0 = never)
64 };
65
66 /**
67 * Event: A new push destination has been added
68 */
69 valueobject EntryAddedEvent extends UserEvent {
70 int entryId; ///< New entry id
71 EntrySettings settings; ///< New entry settings
72 };
73
74 /**
75 * Event: A configured push destination has been modified
76 */
77 valueobject EntryModifiedEvent extends UserEvent {
78 int entryId; ///< Modified entry id
79 EntrySettings oldSettings; ///< Settings before change
80 EntrySettings newSettings; ///< Settings after change
81 };
82
83 /**
84 * Event: A configured push destination has been deleted
85 */
86 valueobject EntryDeletedEvent extends UserEvent {
87 int entryId; ///< Deleted entry id
88 };
89
90 /**
91 * Event: The status of a configured push destination has changed
92 */
93 valueobject EntryStatusChangedEvent extends idl.Event {
94 int entryId; ///< Entry id
95 EntryStatus newStatus; ///< New status
96 };
97
98 /**
99 * Add a new entry.
100 *
101 * @param entryId Result: New entry id, automatically assigned
102 * @param entrySettings New Model Push Entry settings
103 *
104 * @return 0 if OK
105 * @return 2 if the settings are invalid
106 * @return 3 if the maximum number of entries is reached
107 */
108 int addEntry(out int entryId, in EntrySettings entrySettings);
109
110 /**
111 * Modify an existing entry.
112 *
113 * @param entryId Entry id
114 * @param entrySettings New Model Push Entry settings
115 *
116 * @return 0 if OK
117 * @return 1 if the entry does not exist
118 * @return 2 if the settings are invalid
119 */
120 int modifyEntry(in int entryId, in EntrySettings entrySettings);
121
122 /**
123 * Delete an entry.
124 *
125 * @param entryid Entry id
126 *
127 * @return 0 if OK
128 * @return 1 if the entry does not exist
129 */
130 int deleteEntry(in int entryId);
131
132 /**
133 * Retrieve an entry.
134 *
135 * @param entrySettings Result: Model Push Entry settings
136 * @param entryId Entry id
137 *
138 * @return 0 if OK
139 * @return 1 if the entry does not exist
140 */
141 int getEntry(out EntrySettings entrySettings, in int entryId);
142
143 /**
144 * Retrieve a list of entries.
145 *
146 * @return List of Entry Settings
147 */
148 map<int, EntrySettings> listEntries();
149
150 /**
151 * Push data for one specified entry
152 *
153 * @param entryId Entry id
154 *
155 * @return 0 if OK
156 * @return 1 if entry does not exist
157 *
158 */
159 int pushData(in int entryId);
160
161 /**
162 * Cancels an active data push
163 *
164 * If a data push is currently in process for the specified entry,
165 * that push is canceled. If no push is in process, this method
166 * is a no-op.
167 *
168 * @param entryId Entry id
169 */
170 void cancelDataPush(in int entryId);
171
172 /**
173 * Retrieve an entry's status.
174 *
175 * @param entryStatus Result: Entry status
176 * @param entryId Entry id
177 *
178 * @return 0 if OK
179 * @return 1 if the entry does not exist
180 */
181 int getEntryStatus(out EntryStatus entryStatus, in int entryId);
182
183 };
184
185}
event::DataPushService
Data push service configuration interface.
Definition DataPushService.idl:12
event::DataPushService::EntryType
EntryType
Data Push Entry Types.
Definition DataPushService.idl:17
event::DataPushService::SENSORLIST
@ SENSORLIST
Sensor values for a set of sensors.
Definition DataPushService.idl:18
event::DataPushService::AMSLOG
@ AMSLOG
Asset Management log.
Definition DataPushService.idl:21
event::DataPushService::AUDITLOG
@ AUDITLOG
Audit log.
Definition DataPushService.idl:22
event::DataPushService::SENSORLOG
@ SENSORLOG
Sensor log.
Definition DataPushService.idl:19
event::DataPushService::AMSLIST
@ AMSLIST
Asset Management information for a set of AMS strips.
Definition DataPushService.idl:20
event::DataPushService::ERR_MAX_ENTRIES_REACHED
constant int ERR_MAX_ENTRIES_REACHED
Maximum number of entries reached.
Definition DataPushService.idl:28
event::DataPushService::ERR_NO_SUCH_ID
constant int ERR_NO_SUCH_ID
Error codes.
Definition DataPushService.idl:26
event::DataPushService::cancelDataPush
void cancelDataPush(in int entryId)
Cancels an active data push.
event::DataPushService::ERR_INVALID_PARAMS
constant int ERR_INVALID_PARAMS
Invalid parameters.
Definition DataPushService.idl:27
event::DataPushService::pushData
int pushData(in int entryId)
Push data for one specified entry.
event::DataPushService::addEntry
int addEntry(out int entryId, in EntrySettings entrySettings)
Add a new entry.
event::DataPushService::deleteEntry
int deleteEntry(in int entryId)
Delete an entry.
event::DataPushService::getEntryStatus
int getEntryStatus(out EntryStatus entryStatus, in int entryId)
Retrieve an entry's status.
event::DataPushService::listEntries
map< int, EntrySettings > listEntries()
Retrieve a list of entries.
event::DataPushService::getEntry
int getEntry(out EntrySettings entrySettings, in int entryId)
Retrieve an entry.
event::DataPushService::modifyEntry
int modifyEntry(in int entryId, in EntrySettings entrySettings)
Modify an existing entry.
idl
Basic IDL definitions.
Definition Event.idl:10
event::DataPushService::EntryAddedEvent
Event: A new push destination has been added.
Definition DataPushService.idl:69
event::DataPushService::EntryAddedEvent::entryId
int entryId
New entry id.
Definition DataPushService.idl:70
event::DataPushService::EntryAddedEvent::settings
EntrySettings settings
New entry settings.
Definition DataPushService.idl:71
event::DataPushService::EntryDeletedEvent
Event: A configured push destination has been deleted.
Definition DataPushService.idl:86
event::DataPushService::EntryDeletedEvent::entryId
int entryId
Deleted entry id.
Definition DataPushService.idl:87
event::DataPushService::EntryModifiedEvent
Event: A configured push destination has been modified.
Definition DataPushService.idl:77
event::DataPushService::EntryModifiedEvent::oldSettings
EntrySettings oldSettings
Settings before change.
Definition DataPushService.idl:79
event::DataPushService::EntryModifiedEvent::newSettings
EntrySettings newSettings
Settings after change.
Definition DataPushService.idl:80
event::DataPushService::EntryModifiedEvent::entryId
int entryId
Modified entry id.
Definition DataPushService.idl:78
event::DataPushService::EntrySettings
Data Push Entry Settings.
Definition DataPushService.idl:42
event::DataPushService::EntrySettings::type
EntryType type
Type of data.
Definition DataPushService.idl:50
event::DataPushService::EntrySettings::useAuth
boolean useAuth
true to use username/password authentication (basic authentication in case of HTTP)
Definition DataPushService.idl:46
event::DataPushService::EntrySettings::mqttSettings
MqttSettings mqttSettings
MQTT specific settings.
Definition DataPushService.idl:52
event::DataPushService::EntrySettings::url
string url
Destination host.
Definition DataPushService.idl:43
event::DataPushService::EntrySettings::items
vector< string > items
Included items (e.g. list of sensors) depending on type.
Definition DataPushService.idl:51
event::DataPushService::EntrySettings::caCertChain
string caCertChain
TLS CA certificate chain.
Definition DataPushService.idl:45
event::DataPushService::EntrySettings::username
string username
Authentication user name.
Definition DataPushService.idl:48
event::DataPushService::EntrySettings::allowOffTimeRangeCerts
boolean allowOffTimeRangeCerts
allow expired and not yet valid TLS certificates
Definition DataPushService.idl:44
event::DataPushService::EntrySettings::password
string password
Password; write-only, empty to leave unchanged.
Definition DataPushService.idl:49
event::DataPushService::EntryStatusChangedEvent
Event: The status of a configured push destination has changed.
Definition DataPushService.idl:93
event::DataPushService::EntryStatusChangedEvent::newStatus
EntryStatus newStatus
New status.
Definition DataPushService.idl:95
event::DataPushService::EntryStatusChangedEvent::entryId
int entryId
Entry id.
Definition DataPushService.idl:94
event::DataPushService::EntryStatus
Data Push Entry Status.
Definition DataPushService.idl:58
event::DataPushService::EntryStatus::lastAttemptTime
time lastAttemptTime
UNIX timestamp (UTC) of the last push attempt (0 = never)
Definition DataPushService.idl:62
event::DataPushService::EntryStatus::rescheduled
boolean rescheduled
true if the entry is set to be pushed again immediately after completion
Definition DataPushService.idl:60
event::DataPushService::EntryStatus::busy
boolean busy
true if the entry is currently being pushed
Definition DataPushService.idl:59
event::DataPushService::EntryStatus::lastSuccessTime
time lastSuccessTime
UNIX timestamp (UTC) of last successful push (0 = never)
Definition DataPushService.idl:63
event::DataPushService::MqttSettings
Data Push Mqtt Settings.
Definition DataPushService.idl:33
event::DataPushService::MqttSettings::topicPrefix
string topicPrefix
Prefix added to all topics published to, must end with level separator '/' if non-empty.
Definition DataPushService.idl:34
event::UserEvent
This UserEvent may be used as base valueobject for all concrete events that are triggered because of ...
Definition UserEvent.idl:19
idl::Event
Common base for all events.
Definition Event.idl:13