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 */
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__ */
Asset Strip Logger interface.
@ ASSET_TAG_CONNECTED
An asset tag has been connected.
@ EMPTY
The log record is empty.
@ ASSET_TAG_DISCONNECTED
An asset tag has been disconnected.
Info getInfo()
Retrieve the log information.
int getRecords(out vector< Record > records, in int id, in int count)
Retrieve records from the log ring buffer.
Asset Management Strip interface.
Definition: AssetStrip.idl:17
State
AssetStrip state
Definition: AssetStrip.idl:34
Asset Management Model.
Definition: AssetStrip.idl:15
int newestRecord
Pointer to the newest log entry; -1 if the log is empty.
int capacity
Maximum number of entries in the record ring buffer.
int oldestRecord
Pointer to the oldest log entry; -1 if the log is empty.
int totalEventCount
Total number of events logged.
int rackUnitPosition
Rack unit position, -1 if unknown.
string tagId
The ID of the asset management tag, empty if unknown.
AssetStrip::State state
Asset strip state.
int rackUnitNumber
Rack unit number (0-based), -1 if unknown.
string parentBladeId
ID of the parent blade extension tag in case slotNumber>0, empty otherwise.
time timestamp
Time of log entry creation (UNIX timestamp, UTC)
int assetStripNumber
Asset strip number (0-based), -1 if unknown.
int slotNumber
Blade extension slot number, -1 if unknown, 0 is main strip, >0 is blade.