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

Loading...
Searching...
No Matches
AssetStripLogger.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2012 Raritan Inc. All rights reserved.
4 */
5
6#ifndef __ASSETMGRMODEL_ASSETSTRIP_LOGGER_IDL__
7#define __ASSETMGRMODEL_ASSETSTRIP_LOGGER_IDL__
8
9#include <AssetStrip.idl>
10
11/**
12 * Asset Management Model
13 */
14module assetmgrmodel {
15
16 /** Asset Strip Logger interface */
17 interface AssetStripLogger {
18
19 /**
20 * Error codes
21 */
22 constant int NO_ERROR = 0; ///< Operation successful, no error
23 constant int ERR_INVALID_PARAM = 1; ///< Invalid parameter
24
25 /**
26 * Log information structure
27 */
28 structure Info {
29 int capacity; ///< Maximum number of entries in the record ring buffer
30 int oldestRecord; ///< Pointer to the oldest log entry; -1 if the log is empty
31 int newestRecord; ///< Pointer to the newest log entry; -1 if the log is empty
32 int totalEventCount; ///< Total number of events logged
33 };
34
35 /**
36 * Log record type
37 */
38 enumeration RecordType {
39 EMPTY, ///< The log record is empty
40 ASSET_TAG_CONNECTED, ///< An asset tag has been connected
41 ASSET_TAG_DISCONNECTED, ///< An asset tag has been disconnected
42 ASSET_STRIP_STATE_CHANGED ///< The state of the asset strip changed
43 };
44
45 /**
46 * Log record structure
47 */
48 structure Record {
49 time timestamp; ///< Time of log entry creation (UNIX timestamp, UTC)
50 RecordType type; ///< Entry type
51 int assetStripNumber; ///< Asset strip number (0-based), -1 if unknown
52 int rackUnitNumber; ///< Rack unit number (0-based), -1 if unknown
53 int rackUnitPosition; ///< Rack unit position, -1 if unknown
54 int slotNumber; ///< Blade extension slot number, -1 if unknown, 0 is main strip, >0 is blade
55 string tagId; ///< The ID of the asset management tag, empty if unknown
56 string parentBladeId; ///< ID of the parent blade extension tag in case slotNumber>0, empty otherwise
57 AssetStrip.State state; ///< Asset strip state
58 };
59
60 /**
61 * Retrieve the log information.
62 *
63 * @return Log information
64 */
65 Info getInfo();
66
67 /**
68 * Retrieve records from the log ring buffer.
69 *
70 * This method is used to read one or more records from the log ring
71 * buffer. It is allowed to read unused entries. The record index
72 * will wrap to 0 when reading beyond the end of the log.
73 *
74 * @param records Result: The requested log entries
75 * @param id Index of the first log index to read (0..capacity)
76 * @param count Number of records to read (1..capacity)
77 *
78 * @return NO_ERROR on success
79 * @return ERR_INVALID_PARAM if any parameter is out of range
80 */
81 int getRecords(out vector<Record> records, in int id, in int count);
82
83 };
84
85}
86
87#endif /* __ASSETMGRMODEL_ASSETSTRIP_LOGGER_IDL__ */
assetmgrmodel::AssetStripLogger
Asset Strip Logger interface.
Definition AssetStripLogger.idl:17
assetmgrmodel::AssetStripLogger::RecordType
RecordType
Log record type.
Definition AssetStripLogger.idl:38
assetmgrmodel::AssetStripLogger::ASSET_TAG_CONNECTED
@ ASSET_TAG_CONNECTED
An asset tag has been connected.
Definition AssetStripLogger.idl:40
assetmgrmodel::AssetStripLogger::ASSET_STRIP_STATE_CHANGED
@ ASSET_STRIP_STATE_CHANGED
The state of the asset strip changed.
Definition AssetStripLogger.idl:42
assetmgrmodel::AssetStripLogger::EMPTY
@ EMPTY
The log record is empty.
Definition AssetStripLogger.idl:39
assetmgrmodel::AssetStripLogger::ASSET_TAG_DISCONNECTED
@ ASSET_TAG_DISCONNECTED
An asset tag has been disconnected.
Definition AssetStripLogger.idl:41
assetmgrmodel::AssetStripLogger::getInfo
Info getInfo()
Retrieve the log information.
assetmgrmodel::AssetStripLogger::ERR_INVALID_PARAM
constant int ERR_INVALID_PARAM
Invalid parameter.
Definition AssetStripLogger.idl:23
assetmgrmodel::AssetStripLogger::getRecords
int getRecords(out vector< Record > records, in int id, in int count)
Retrieve records from the log ring buffer.
assetmgrmodel::AssetStripLogger::NO_ERROR
constant int NO_ERROR
Error codes.
Definition AssetStripLogger.idl:22
assetmgrmodel::AssetStrip
Asset Management Strip interface.
Definition AssetStrip.idl:17
assetmgrmodel::AssetStrip::State
State
AssetStrip state
Definition AssetStrip.idl:34
assetmgrmodel
Asset Management Model.
Definition AssetStrip.idl:15
assetmgrmodel::AssetStripLogger::Info
Log information structure.
Definition AssetStripLogger.idl:28
assetmgrmodel::AssetStripLogger::Info::newestRecord
int newestRecord
Pointer to the newest log entry; -1 if the log is empty.
Definition AssetStripLogger.idl:31
assetmgrmodel::AssetStripLogger::Info::capacity
int capacity
Maximum number of entries in the record ring buffer.
Definition AssetStripLogger.idl:29
assetmgrmodel::AssetStripLogger::Info::oldestRecord
int oldestRecord
Pointer to the oldest log entry; -1 if the log is empty.
Definition AssetStripLogger.idl:30
assetmgrmodel::AssetStripLogger::Info::totalEventCount
int totalEventCount
Total number of events logged.
Definition AssetStripLogger.idl:32
assetmgrmodel::AssetStripLogger::Record
Log record structure.
Definition AssetStripLogger.idl:48
assetmgrmodel::AssetStripLogger::Record::rackUnitPosition
int rackUnitPosition
Rack unit position, -1 if unknown.
Definition AssetStripLogger.idl:53
assetmgrmodel::AssetStripLogger::Record::type
RecordType type
Entry type.
Definition AssetStripLogger.idl:50
assetmgrmodel::AssetStripLogger::Record::tagId
string tagId
The ID of the asset management tag, empty if unknown.
Definition AssetStripLogger.idl:55
assetmgrmodel::AssetStripLogger::Record::state
AssetStrip::State state
Asset strip state.
Definition AssetStripLogger.idl:57
assetmgrmodel::AssetStripLogger::Record::rackUnitNumber
int rackUnitNumber
Rack unit number (0-based), -1 if unknown.
Definition AssetStripLogger.idl:52
assetmgrmodel::AssetStripLogger::Record::parentBladeId
string parentBladeId
ID of the parent blade extension tag in case slotNumber>0, empty otherwise.
Definition AssetStripLogger.idl:56
assetmgrmodel::AssetStripLogger::Record::timestamp
time timestamp
Time of log entry creation (UNIX timestamp, UTC)
Definition AssetStripLogger.idl:49
assetmgrmodel::AssetStripLogger::Record::assetStripNumber
int assetStripNumber
Asset strip number (0-based), -1 if unknown.
Definition AssetStripLogger.idl:51
assetmgrmodel::AssetStripLogger::Record::slotNumber
int slotNumber
Blade extension slot number, -1 if unknown, 0 is main strip, >0 is blade.
Definition AssetStripLogger.idl:54