Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
Loading...
Searching...
No Matches
StorageManager.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2011 Raritan Inc. All rights reserved.
4 */
5
6#include <UserEvent.idl>
7#include <Webcam.idl>
8
9/** Webcam Management */
10module webcam {
11
12 /** The storage manager interface */
13 interface StorageManager {
14 /**
15 * Error codes
16 */
17 constant int NO_ERROR = 0; ///< Operation successful, no error
18 constant int ERR_INVALID_PARAM = 1; ///< Invalid parameter for an operation
19 constant int ERR_INIT_IN_PROGRESS = 2; ///< Storage information is going to be initialized
20 constant int ERR_ALREADY_RUNNING = 3; ///< The activity is already running
21 constant int ERR_TOO_LARGE = 4; ///< The requested result is too large
22 constant int ERR_OPERATION_NOT_SUPPORTED = 5; ///< The requested operation is not supported on the current storage type
23
24 /** StorageType */
25 enumeration StorageType {
26 LOCAL, ///< Local
27 FTP, ///< FTP
28 CIFS, ///< CIFS
29 NFS ///< NFS
30 };
31
32 /** Direction */
33 enumeration Direction {
34 ASCENDING, ///< ascending
35 DESCENDING ///< descending
36 };
37
38 /** StorageStatus */
39 enumeration StorageStatus {
40 INITIALIZING, ///< Initializing is in progress,
41 READY ///< Storage is ready for usage
42 };
43
44 /** Webcam Storage Info */
46 Webcam webcam; ///< webcam object
47 long newestIndex; ///< newest know index
48 long oldestIndex; ///< oldest know index
49 int count; ///< nr of stored images from this webcam
50 };
51
52 /** Information */
54 StorageStatus status; ///< storage status
55 int capacity; ///< over-all nr of storable images
56 int used; ///< nr of stored images (local storage only)
57 vector<WebcamStorageInfo> webcamStorageInfo; ///< List of storage information for each webcam (local storage only)
58 };
59
60 /** Settings */
61 structure StorageSettings {
62 StorageType type; ///< storage type
63 int capacity; ///< maximum number of stored images; obsolete, no longer used
64 string server; ///< server ip, share and path (empty/ignored for LOCAL storage type)
65 string username; ///< username (empty/ignored for LOCAL storage type)
66 string password; ///< password (empty/ignored for LOCAL storage type)
67 };
68
69 /** StorageMetaData */
70 structure StorageMetaData {
71 long index; ///< current image index
72 Webcam webcam; ///< source webcam
73 };
74
75 /** StorageMetaData */
77 ImageMetaData imageMeta; ///< image related meta data
78 int fileSize; ///< image file size in bytes
79 StorageMetaData storageMeta;///< store related meta data
80 };
81
82 /** StorageImage */
83 structure StorageImage {
84 Image image; ///< image object
85 StorageMetaData metaData; ///< meta data
86 };
87
88 /** Activity */
89 structure Activity {
90 Webcam webcam; ///< webcam object
91 int interval; ///< capture interval
92 int count; ///< nr of images to take
93 int done; ///< nr of images taken
94 };
95
96 /** Event: image upload to storage started */
97 valueobject ImageUploadStartedEvent extends event.UserEvent {
98 Webcam webcam; ///< webcam object
99 string folderUrl; ///< URL under which the containing folder can be accessed
100 };
101
102 /**
103 * Get supported storage types
104 *
105 * @return a list of supported storage types
106 */
107 vector<StorageType> getSupportedStorageTypes();
108
109 /**
110 * get storage information
111 *
112 * @return StorageInformation
113 */
115
116 /**
117 * get storage settings
118 *
119 * @return StorageSettings
120 */
122
123 /**
124 * set storage settings
125 *
126 * @param settings settings structure
127 *
128 * @return NO_ERROR on success
129 * @return ERR_INVALID_PARAM invalid settings
130 */
131 int setSettings(in StorageSettings settings);
132
133 /**
134 * add an image to the storage
135 *
136 * @param webcam image source webcam
137 * @param image image
138 * @param index index of the added image
139 *
140 * @return NO_ERROR on success
141 */
142 int addImage(in Webcam webcam, in Image image, out long index);
143
144 /**
145 * remove an image of the storage
146 *
147 * @note not supported for remote storage (CIFS and FTP)
148 *
149 * @param webcam image source webcam
150 * @param start start index
151 * @param count number of images
152 * @param direction index counting direction
153 *
154 * @return NO_ERROR on success
155 */
156 int removeImages(in Webcam webcam, in long start, in int count, in Direction direction);
157
158 /**
159 * get meta data of images from storage
160 *
161 * @note not supported for remote storage (CIFS and FTP)
162 *
163 * @param webcam image source webcam
164 * @param start start index
165 * @param count number of images
166 * @param direction index counting direction
167 * @param meta result: list of storage meta data
168 *
169 * @return NO_ERROR on success
170 * @return ERR_TOO_LARGE too many information requested
171 */
172 int getMetaData(in Webcam webcam, in long start, in int count,
173 in Direction direction, out vector<ImageStorageMetaData> meta);
174
175 /**
176 * retrieve images from the storage
177 *
178 * @note not supported for remote storage (CIFS and FTP)
179 *
180 * @param webcam image source webcam
181 * @param start start index
182 * @param count number of images
183 * @param direction index counting direction
184 * @param image result: list of storage images
185 *
186 * @return NO_ERROR on success
187 * @return ERR_TOO_LARGE too many images requested
188 */
189 int getImages(in Webcam webcam, in long start, in int count,
190 in Direction direction, out vector<StorageImage> image);
191
192 /**
193 * get all running activities
194 *
195 * @return list of running activities
196 */
197 vector<Activity> getActivities();
198
199 /**
200 * start a capture activity
201 *
202 * @param webcam webcam
203 * @param count number of images to store, zero is interpreted as infinite
204 * @param interval interval in ms
205 *
206 * @return NO_ERROR on success
207 * @return ERR_INVALID_PARAM webcam not found
208 */
209 int startActivity(in Webcam webcam, in int count, in int interval);
210
211 /**
212 * Start a capture activity, storing the images to a specific storage folder
213 *
214 * @param webcam webcam
215 * @param count number of images to store, zero is interpreted as infinite
216 * @param interval interval in ms
217 * @param folder folder path to store the images into
218 *
219 * @return NO_ERROR on success
220 * @return ERR_INVALID_PARAM webcam not found
221 */
222 int startActivityWithFolder(in Webcam webcam, in int count, in int interval, in string folder);
223
224 /**
225 * stop a capture activity
226 *
227 * @param webcam webcam
228 *
229 * @return NO_ERROR on success
230 * @return ERR_INVALID_PARAM no matching activity found
231 */
233 };
234}
The storage manager interface.
StorageInformation getInformation()
get storage information
int getMetaData(in Webcam webcam, in long start, in int count, in Direction direction, out vector< ImageStorageMetaData > meta)
get meta data of images from storage
int removeImages(in Webcam webcam, in long start, in int count, in Direction direction)
remove an image of the storage
int getImages(in Webcam webcam, in long start, in int count, in Direction direction, out vector< StorageImage > image)
retrieve images from the storage
vector< Activity > getActivities()
get all running activities
int startActivity(in Webcam webcam, in int count, in int interval)
start a capture activity
StorageStatus
StorageStatus.
@ INITIALIZING
Initializing is in progress,.
vector< StorageType > getSupportedStorageTypes()
Get supported storage types.
int addImage(in Webcam webcam, in Image image, out long index)
add an image to the storage
int startActivityWithFolder(in Webcam webcam, in int count, in int interval, in string folder)
Start a capture activity, storing the images to a specific storage folder.
int setSettings(in StorageSettings settings)
set storage settings
StorageSettings getSettings()
get storage settings
int stopActivity(in Webcam webcam)
stop a capture activity
The webcam interface.
Definition: Webcam.idl:86
Webcam Management.
Image meta data.
Definition: Webcam.idl:57
Image.
Definition: Webcam.idl:64
int count
nr of images to take
ImageMetaData imageMeta
image related meta data
StorageMetaData storageMeta
store related meta data
Event: image upload to storage started.
string folderUrl
URL under which the containing folder can be accessed.
StorageMetaData metaData
meta data
int used
nr of stored images (local storage only)
vector< WebcamStorageInfo > webcamStorageInfo
List of storage information for each webcam (local storage only)
int capacity
over-all nr of storable images
string username
username (empty/ignored for LOCAL storage type)
string password
password (empty/ignored for LOCAL storage type)
int capacity
maximum number of stored images; obsolete, no longer used
string server
server ip, share and path (empty/ignored for LOCAL storage type)
int count
nr of stored images from this webcam