All Classes Files Functions Variables Enumerations Enumerator Groups Pages
Server.idl
Go to the documentation of this file.
1 /**
2  * @file Server.idl
3  * @brief Work with product specific options like alerts, connections, opened folders, active (web) sessions.
4  *
5  * @author Dusan Juhas
6  *
7  * @copyright Copyright © 2011-2012 Kerio Technologies s.r.o.
8  */
9 
10 #import <kerio/web/idl/SharedStructures.idl>
11 #import <common.idl> //WebComponent
12 #import <AdminStructures.idl> // DirectoryAccessResult, DirectoryList
13 #import <Domains.idl> //MaximumUsers
14 
15 
16 module kerio {
17 module jsonapi {
18 module admin {
19 
20 /**
21  * Available entities, entity prefix due to name collision
22  */
23 enum Entity {
24  EntityUser, ///< User Entity
25  EntityAlias, ///< Alias Entity
26  EntityGroup, ///< Group Entity
27  EntityMailingList, ///< Mailing List Entity
28  EntityResource, ///< Resource Scheduling Entity
29  EntityTimeRange, ///< Time Range Entity
30  EntityTimeRangeGroup, ///< Time Range Group Entity
31  EntityIpAddress, ///< Ip Address Entity
32  EntityIpAddressGroup, ///< Ip Address Group Entity
33  EntityService, ///< Service Entity
34  EntityDomain
35 };
36 
37 /**
38  * Restriction Items
39  */
41  kerio::web::ItemName name;
42  kerio::web::RestrictionKind kind;
43  kerio::web::StringList values;
44 };
45 
46 /**
47  * Restriction tuple for 1 entity
48  */
49 typedef sequence<RestrictionTuple> RestrictionTupleList;
50 
51 /**
52  * Entity name restriction definition
53  */
54 struct Restriction {
55  Entity entityName; ///< IDL entity name, eg. User
56  RestrictionTupleList tuples; ///< Restriction tuples
57 };
58 
59 /**
60  * List of restrictions
61  */
62 typedef sequence<Restriction> RestrictionList;
63 
64 /**
65  * JavaScript timestamp
66  */
67 typedef string JavaScriptDate;
68 
69 /**
70  * Subscription information
71  */
73  boolean isUnlimited; ///< is it a special license with expiration == never ?
74  boolean showAlert; ///< show subscription expiration alert
75  long remainingDays; ///< days remaining to subscription expiration
76  JavaScriptDate subscriptionDate; ///< last date of subscription
77 };
78 
79 /**
80  * About information
81  */
82 struct AboutInfo {
83  long currentUsers; ///< number of created users on domain
84  MaximumUsers allowedUsers; ///< number of allowed users, take stricter limit from max. number for domain, max. number by license
85  string serverSoftware; ///< product name and version string, same as SERVER_SOFTWARE
86  SubscriptionInfo subscription; ///< information about subscription
87  string copyright; ///< copyright string
88  string productHomepage; ///< url to homepage of product
89 };
90 
91 /**
92  * Type of Alert
93  */
94 enum AlertName {
95  LicenseExpired, ///< License has expired
96  LicenseInvalidMinVersion, ///< Invalid minimal version of a product found
97  LicenseInvalidEdition, ///< The license was not issued for this edition of the product
98  LicenseInvalidUser, ///< The license was not issued for this user
99  LicenseInvalidDomain, ///< The license was not issued for this domain
100  LicenseInvalidOS, ///< The license was not issued for this operating system
101  LicenseCheckForwardingEnabled, ///< The license was not alowed forward the message to another host
102  LicenseTooManyUsers, ///< More users try login to their mailboxes then allowed License.
103  StorageSpaceLow, ///< Low space in storage
104  SubscriptionExpired, ///< Subscription has expired
105  SubscriptionSoonExpire, ///< Subscription soon expire
106  LicenseSoonExpire, ///< License soon expire
107  CoredumpFound, ///< Some coredump was found after crash
108  MacOSServicesKeepsPorts ///< Apache on Lion server keeps ports (Eg. port 443), which are assigned to our services. See Services.stopMacOSServices()
109 };
110 
111 /**
112  * Type of Alert
113  */
114 enum TypeAlert {
115  Warning,
116  Critical
117 };
118 
119 /**
120  * Alert
121  */
122 struct Alert {
123  AlertName alertName; ///< Alert Id
124  TypeAlert alertType; ///< Alert type
125  string currentValue; ///< Current Value
126  string criticalValue; ///< Critical Value
127 };
128 
129 typedef sequence<Alert> AlertList;
130 
131 /**
132  * Potential duplicate
133  */
135  Entity kind; ///< which entity was found as first duplicate
136  string name; ///< name of duplicate
137  string collisionAddress;
138  boolean win; ///< if entity is winner in this collision of mail address
139  boolean isPattern; ///< is true if it is the pattern to check (self duplicity)
140 };
141 
142 typedef sequence<EntityDuplicate> EntityDuplicateList;
143 
144 /**
145  * Detail about entity to be checked. Kind or id must be filled.
146  */
147 struct EntityDetail {
148  Entity kind; ///< which entity is inserting
149  kerio::web::KId id; ///< entity global identification of updated entity
150 };
151 
152 typedef sequence<string> UserNameList;
153 
154 struct FolderInfo {
155  string folderName;
156  long referenceCount;
157  boolean indexLoaded;
158  UserNameList users;
159 };
160 
161 typedef sequence<FolderInfo> FolderInfoList;
162 
163 struct WebSession {
164  string userName;
165  string clientAddress; ///< IPv4 address
166  string expirationTime; ///< format dd.mm.yyyy hh:mm:ss
167  WebComponent componentType; ///< what about CalDav, WebDav, ActiveSync
168  boolean isSecure; ///< is protocol secure
169 };
170 
171 typedef sequence<WebSession> WebSessionList;
172 
173 enum Protocol {
174  protocolAdmin,
175  protocolSmtp,
176  protocolSmtps,
177  protocolSubmission,
178  protocolPop3,
179  protocolPop3s,
180  protocolImap,
181  protocolImaps,
182  protocolNntp,
183  protocolNntps,
184  protocolLdap,
185  protocolLdaps,
186  protocolHttp,
187  protocolHttps,
188  protocolXmpp,
189  protocolXmpps
190 };
191 
192 enum HttpExtension {
193  NoExtension,
194  WebGeneric, ///< WebMail or WebMail Mini or WebAdmin
195  WebDav,
196  CalDav,
197  ActiveSync,
198  KocOffline,
199  KBC, ///< Kerio Connector for BlackBerry Enterprise Server
200  EWS ///< Exchange Web Services
201 };
202 
203 struct Connection {
204  Protocol proto;
205  HttpExtension extension;
206  boolean isSecure;
207  string time;
208  string from;
209  string user;
210  string description;
211 };
212 
213 typedef sequence<Connection> ConnectionList;
214 
215 /**
216  *
217  * Note: isEnabled, isLimited and groupId fields must be assigned if any of them is used in set methods
218  */
220  boolean isEnabled; ///< administration from other that local machine is enabled/disabled
221  boolean isLimited; ///< administration is limited
222  kerio::web::KId groupId; ///< IP Address Group identifier on which is limit applied
223  string groupName; ///< [READ-ONLY] IP Address Group name on which is limit applied
224 
225  boolean builtInAdminEnabled; ///< if is enabled field builtInAdminPassword is required
226  string builtInAdminUsername; ///< [READ-ONLY] user name
227  string builtInAdminPassword; ///< password
228  boolean builtInAdminPasswordIsEmpty; ///< [READ-ONLY] password is empty
229  boolean builtInAdminUsernameCollide; ///< [READ-ONLY] username colide with user in primary domain
230 };
231 
232 /**
233  * Server time information
234  */
236  long timezoneOffset; ///< +/- offset in minutes
237  DateTimeStamp startTime; ///< +/- start time of server
238  DateTimeStamp currentTime; ///< +/- current time on server
239 };
240 
241 interface Server {
242 
243  /**
244  * Server creates an archive/backup path. If credentials aren't specified, values from current configuration of backup are used.
245  *
246  * @param result - result of create action
247  * @param path - new directory to create
248  * @param credentials - (optional) user name and password required to access network disk
249  */
250  void createPath(out DirectoryAccessResult result, in string path, in Credentials credentials);
251 
252  /**
253  * Find emails duplicate among entities in this order: resources, aliases, mailing lists, groups, users;
254  * caller must be authenticated; Note: creating duplicates is often allowed but may cause unwanted effects.
255  *
256  * @param entities - list of found entities with e-mail address duplicate 'updatedEntity' is included in list and marked, if none duplicate is found list is empty
257  * @param addresses - list of email addresses (without domain) to be checked
258  * @param updatedEntity - identification of the current entity (to avoid self duplicity)
259  * @param domainId - domain identification
260  */
261  void findEntityByEmail(out EntityDuplicateList entities, in kerio::web::StringList addresses, in EntityDetail updatedEntity, in kerio::web::KId domainId);
262 
263  /**
264  * Generate a file with information for the support.
265  *
266  * @param fileDownload - description of output file
267  */
268  void generateSupportInfo(out kerio::web::Download fileDownload);
269 
270  /**
271  * Obtain information about server, caller must be authenticated.
272  *
273  * @param aboutInformation - information about server
274  */
275  void getAboutInfo(out AboutInfo aboutInformation);
276 
277  /**
278  * Obtain a list of alerts.
279  *
280  * @param alerts - list of alerts
281  */
282  void getAlertList(out AlertList alerts);
283 
284  /**
285  * Returns a list of user-preferred languages set in browser.
286  *
287  * @param calculatedLanguage - a list of 2-character language codes
288  */
289  void getBrowserLanguages(out kerio::web::StringList calculatedLanguage);
290 
291  /**
292  * Obtain client statistics settings.
293  *
294  * @param setting - new settings
295  */
296  void getClientStatistics(out boolean isEnabled);
297 
298  /**
299  * Obtain a list of columns dependent on callee role.
300  *
301  * @param columns - list of available columns
302  * @param objectName - name of the API object
303  * @param methodName - name of the method of appropriate object
304  */
305  void getColumnList(out kerio::web::StringList columns, in string objectName, in string methodName);
306 
307  /**
308  * Obtain information about active connections.
309  *
310  * @param list - active connections
311  * @param totalItems - total number of active connections
312  * @param query - condition and fields have no effect for this method
313  */
314  void getConnections(out ConnectionList list, out long totalItems, in kerio::web::SearchQuery query);
315 
316  /**
317  * Obtain a list of directories in a particular path.
318  *
319  * @param dirList - List of directories
320  * @param fullPath - directory for listing, if full path is empty logical drives will be listed
321  */
322  void getDirs(out DirectoryList dirList, in string fullPath);
323 
324  /**
325  * Obtain list of license extensions, caller must be authenticated.
326  *
327  * @param extensions - list of license extensions
328  */
329  void getLicenseExtensionsList(out kerio::web::StringList extensions);
330 
331  /**
332  * Server side list of constants.
333  *
334  * @param constants - list of constants
335  */
336  void getNamedConstantList(out NamedConstantList constants);
337 
338  /**
339  * Obtain information about folders opened on server.
340  *
341  * @param list - opened folders with info
342  * @param totalItems - total number of opened folders
343  * @param query - condition and fields have no effect for this method
344  */
345  void getOpenedFoldersInfo(out FolderInfoList list, out long totalItems, in kerio::web::SearchQuery query);
346 
347  /**
348  * Get basic information about product and its version.
349  *
350  * @param info - structure with basic information about product
351  */
352  void getProductInfo(out ProductInfo info);
353 
354  /**
355  * Obtain information about remote administration settings.
356  *
357  * @param setting - current settings
358  */
359  void getRemoteAdministration(out Administration setting);
360 
361  /**
362  * Obtain a hash string created from product name, version, and installation time.
363  *
364  * @param serverHash - server hash
365  */
366  void getServerHash(out string serverHash);
367 
368  /**
369  * List all server IP addresses.
370  *
371  * @param addresses - all IP addresses of the server
372  */
373  void getServerIpAddresses(out kerio::web::StringList addresses);
374 
375  /**
376  * Get server time information.
377  *
378  * @param info - structure with time information
379  */
380  void getServerTime(out ServerTimeInfo info);
381 
382  /**
383  * Obtain information about server version.
384  *
385  * @param product - name of product
386  * @param version - version in string consists of values of major, minor, revision, build a dot separated
387  * @param major - major version
388  * @param minor - minor version
389  * @param revision - revision number
390  * @param build - build number
391  */
392  void getVersion(out string product, out string version, out long major, out long minor, out long revision, out long build);
393 
394  /**
395  * Obtain information about web component sessions.
396  *
397  * @param list - web component sessions
398  * @param totalItems - total number of web component sessions
399  * @param query - condition and fields have no effect for this method
400  */
401  void getWebSessions(out WebSessionList list, out long totalItems, in kerio::web::SearchQuery query);
402 
403  /**
404  * Check if the selected path exists and is accessible from the server.
405  *
406  * @param path - directory name
407  * @param credentials - (optional) user name and password required to access network disk
408  * @param result - result of check
409  */
410  void pathExists(out DirectoryAccessResult result, in string path, in Credentials credentials);
411 
412  /**
413  * Reboot the host system.
414  */
415  void reboot();
416 
417  /**
418  * Restart server. The server must run as service.
419  */
420  void restart();
421 
422  /**
423  * Send a bug report to Kerio.
424  *
425  * @param name - name of sender
426  * @param email - email of sender
427  * @param language - language of report
428  * @param subject - summary of report
429  * @param description - description of problem
430  */
431  void sendBugReport(in string name, in string email, in string language, in string subject, in string description);
432 
433  /**
434  * Set client statistics settings.
435  *
436  * @param setting - new settings
437  */
438  void setClientStatistics(in boolean isEnabled);
439 
440  /**
441  * Set new remote administration parameters.
442  *
443  * @param setting - new settings
444  */
445  void setRemoteAdministration(in Administration setting);
446 
447  /**
448  * Upload license manually from a file.
449  *
450  * @param fileId - ID of the uploaded file
451  */
452  void uploadLicense(in string fileId);
453 
454  /**
455  * Validate whether the administrator can cut off him/herself from the administration.
456  *
457  * @param setting - new setting
458  */
459  void validateRemoteAdministration(in Administration setting);
460 
461  /**
462  * Determine whether to use British or American flag for English.
463  *
464  * @param preferred - use British flag
465  */
466  void isBritishPreferred(out boolean preferred);
467 };
468 
469 }; }; };//end of namespace