Loading...
Searching...
No Matches
DataPushService.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2014 Raritan Inc. All rights reserved.
*/
#include <UserEvent.idl>
/** Event interface */
module event {
/** Data push service configuration interface */
interface DataPushService {
/**
* Data Push Entry Types
*/
enumeration EntryType {
SENSORLIST, ///< Sensor values for a set of sensors
SENSORLOG, ///< Sensor log
AMSLIST, ///< Asset Management information for a set of AMS strips
AMSLOG, ///< Asset Management log
AUDITLOG ///< Audit log
};
/** Error codes */
constant int ERR_NO_SUCH_ID = 1; ///< No such ID
constant int ERR_INVALID_PARAMS = 2; ///< Invalid parameters
constant int ERR_MAX_ENTRIES_REACHED = 3; ///< Maximum number of entries reached
/**
* Data Push Mqtt Settings
*/
structure MqttSettings {
string topicPrefix; ///< Prefix added to all topics published to,
///< must end with level separator '/' if non-empty
};
/**
* Data Push Entry Settings
*/
[sparse_in]
structure EntrySettings {
string url; ///< Destination host
boolean allowOffTimeRangeCerts; ///< allow expired and not yet valid TLS certificates
string caCertChain; ///< TLS CA certificate chain
boolean useAuth; ///< \c true to use username/password authentication
///< (basic authentication in case of HTTP)
string username; ///< Authentication user name
string password; ///< Password; write-only, empty to leave unchanged
EntryType type; ///< Type of data
vector<string> items; ///< Included items (e.g. list of sensors) depending on type
MqttSettings mqttSettings; ///< MQTT specific settings
};
/**
* Data Push Entry Status
*/
structure EntryStatus {
boolean busy; ///< \c true if the entry is currently being pushed
boolean rescheduled; ///< \c true if the entry is set to be pushed again
///< immediately after completion
time lastAttemptTime; ///< UNIX timestamp (UTC) of the last push attempt (0 = never)
time lastSuccessTime; ///< UNIX timestamp (UTC) of last successful push (0 = never)
};
/**
* Event: A new push destination has been added
*/
valueobject EntryAddedEvent extends UserEvent {
int entryId; ///< New entry id
EntrySettings settings; ///< New entry settings
};
/**
* Event: A configured push destination has been modified
*/
valueobject EntryModifiedEvent extends UserEvent {
int entryId; ///< Modified entry id
EntrySettings oldSettings; ///< Settings before change
EntrySettings newSettings; ///< Settings after change
};
/**
* Event: A configured push destination has been deleted
*/
valueobject EntryDeletedEvent extends UserEvent {
int entryId; ///< Deleted entry id
};
/**
* Event: The status of a configured push destination has changed
*/
valueobject EntryStatusChangedEvent extends idl.Event {
int entryId; ///< Entry id
EntryStatus newStatus; ///< New status
};
/**
* Add a new entry.
*
* @param entryId Result: New entry id, automatically assigned
* @param entrySettings New Model Push Entry settings
*
* @return 0 if OK
* @return 2 if the settings are invalid
* @return 3 if the maximum number of entries is reached
*/
int addEntry(out int entryId, in EntrySettings entrySettings);
/**
* Modify an existing entry.
*
* @param entryId Entry id
* @param entrySettings New Model Push Entry settings
*
* @return 0 if OK
* @return 1 if the entry does not exist
* @return 2 if the settings are invalid
*/
int modifyEntry(in int entryId, in EntrySettings entrySettings);
/**
* Delete an entry.
*
* @param entryid Entry id
*
* @return 0 if OK
* @return 1 if the entry does not exist
*/
int deleteEntry(in int entryId);
/**
* Retrieve an entry.
*
* @param entrySettings Result: Model Push Entry settings
* @param entryId Entry id
*
* @return 0 if OK
* @return 1 if the entry does not exist
*/
int getEntry(out EntrySettings entrySettings, in int entryId);
/**
* Retrieve a list of entries.
*
* @return List of Entry Settings
*/
map<int, EntrySettings> listEntries();
/**
* Push data for one specified entry
*
* @param entryId Entry id
*
* @return 0 if OK
* @return 1 if entry does not exist
*
*/
int pushData(in int entryId);
/**
* Cancels an active data push
*
* If a data push is currently in process for the specified entry,
* that push is canceled. If no push is in process, this method
* is a no-op.
*
* @param entryId Entry id
*/
void cancelDataPush(in int entryId);
/**
* Retrieve an entry's status.
*
* @param entryStatus Result: Entry status
* @param entryId Entry id
*
* @return 0 if OK
* @return 1 if the entry does not exist
*/
int getEntryStatus(out EntryStatus entryStatus, in int entryId);
};
}
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::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::cancelDataPush
void cancelDataPush(in int entryId)
Cancels an active data push.
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