All Classes Files Functions Variables Pages
UpdateChecker.idl
Go to the documentation of this file.
1 /**
2  * @file UpdateChecker.idl
3  * @brief API for update checker
4  * @version 4
5  */
6 
7 #import <kerio/web/idl/SharedStructures.idl>
8 #import <common.idl>
9 
10 module webadmin {
11 
13  boolean enabled;
14  boolean betaVersion; /** check also for beta ver. If currently running version is beta, it will be forced regardless of this value */
15  boolean download; /** auto download and update */
16  OptionalIdReference autoUpdateTimeRange; /** Time interval when auto update will be scheduled */
17 };
18 
19 enum CheckVersionType {
20  CheckVersionConfig,
21  CheckVersionBeta,
22  CheckVersionFinal
23 };
24 
25 enum UpdateStatus {
26  UpdateStatusOk,
27  UpdateStatusChecking,
28  UpdateStatusCheckFailed,
29  /** States only for Linux version */
30  UpdateStatusDownloadOk,
31  UpdateStatusDownloading,
32  UpdateStatusDownloadFailed,
33  UpdateStatusUpgrading,
34  UpdateStatusUpgradeFailed
35 };
36 
38  UpdateStatus status;
39  boolean newVersion; /** new version may or may not be available or downloaded */
40  long lastCheckTime; /**< time_t (seconds since 1.1.1970) */
41  TimeSpan lastUpdateCheck; /**< how long is since last rules update check */
42  string packageCode; /**< e.g. "KWF:010.001.00000.B.001.000" */
43  string description; /**< e.g. "Kerio Control 10.1.0 beta 1 - QA Team" */
44  string downloadUrl; /** significant only for Windows version */
45  string infoUrl;
46  string updateErrorDescr; /**< optional description of failure happened during attempt to check or download upgrade image */
47  boolean autoUpdatePlanned; /**< true if auto update is planned */
48  string autoUpdateDateTime; /**< When auto update is planned */
49 };
50 
51 interface UpdateChecker {
52 
53  /**
54  * Returns configuration
55  * @param config - Contains Structure with update checker's settings.
56  * @throws kerio::web::ApiException \n
57  * -32001 Session expired. - "The user is not logged in." \n
58  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
59  */
60  void get(out UpdateCheckerConfig config);
61 
62  /**
63  * Stores configuration
64  * @param config - Contains Structure with update checker's settings to be stored &a pplied.
65  * @throws kerio::web::ApiException \n
66  * -32001 Session expired. - "The user is not logged in." \n
67  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
68  */
69  void set(in UpdateCheckerConfig config);
70 
71  /**
72  * Checks for a new version
73  * @throws kerio::web::ApiException \n
74  * -32001 Session expired. - "The user is not logged in." \n
75  * 1000 Operation failed. - "No connection available, update disabled or already in progress." \n
76  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
77  * 8000 Internal error. - "Internal error."
78  */
79  void check(in CheckVersionType type);
80 
81  /**
82  * Returns actual state of Update checker
83  * @param status - a phase of update process.
84  * @throws kerio::web::ApiException \n
85  * -32001 Session expired. - "The user is not logged in." \n
86  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
87  * 8000 Internal error. - "Internal error."
88  */
89  void getStatus(out UpdateCheckerInfo status);
90 
91  /**
92  * METHODS ONLY FOR LINUX VERSION
93  */
94 
95  /**
96  * @param percentage - Returns percentage progress for Status Downloading \n
97  * Stop reading this, when percentage == -1 (DownloadFailed) \n
98  * or percentage == 100 (DownloadOk)
99  * @throws kerio::web::ApiException \n
100  * -32001 Session expired. - "The user is not logged in." \n
101  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
102  */
103  void getProgressStatus(out long percentage);
104 
105  /**
106  * Starts Downloading
107  * @throws kerio::web::ApiException \n
108  * -32001 Session expired. - "The user is not logged in." \n
109  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
110  * 8000 Internal error. - "Internal error."
111  */
112  void download(in CheckVersionType type);
113 
114  /**
115  * Converts fileId to id, that will be passed into performCustomUpgrade.
116  * @param id - an id obtained from fileId (same values);
117  * @param fileId - according to spec 390.
118  * @throws kerio::web::ApiException \n
119  * -32001 Session expired. - "The user is not logged in." \n
120  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
121  */
122  void uploadImage(out kerio::web::KId id, in string fileId);
123 
124  /**
125  * Processes newly uploaded image for upgrade. Ids according to spec 390.
126  * In case of return true, it reboots machine (after 2s delay)
127  * @throws kerio::web::ApiException \n
128  * -32001 Session expired. - "The user is not logged in." \n
129  * 1000 Operation failed. - "Unable to perform update: %1" \n
130  * 1002 No such entity. - "Unable to open upgrade image file." \n
131  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
132  * 8000 Internal error. - "Internal error."
133  */
134  void performCustomUpgrade(in kerio::web::KId id);
135 
136  /**
137  * Runs upgrade
138  * In case of return true, it reboots machine (after 2s delay)
139  * @throws kerio::web::ApiException \n
140  * -32001 Session expired. - "The user is not logged in." \n
141  * 1000 Operation failed. - "Unable to perform update: %1" \n
142  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
143  */
144  void performUpgrade();
145 
146  /**
147  * Stops Downloading
148  * @throws kerio::web::ApiException \n
149  * -32001 Session expired. - "The user is not logged in." \n
150  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
151  * 8000 Internal error. - "Internal error."
152  */
153  void cancelDownload();
154 
155 };
156 
157 }; //webadmin
158 
Common Kerio Control structures, enums and types.
Definition: UpdateChecker.idl:51
Definition: UpdateChecker.idl:37
string autoUpdateDateTime
Definition: UpdateChecker.idl:48
Definition: UpdateChecker.idl:12
string description
Definition: UpdateChecker.idl:43
string infoUrl
Definition: UpdateChecker.idl:45
Definition: common.idl:67
string updateErrorDescr
Definition: UpdateChecker.idl:46
OptionalIdReference autoUpdateTimeRange
Definition: UpdateChecker.idl:16
Definition: common.idl:36
string packageCode
Definition: UpdateChecker.idl:42
Definition: Accounting.idl:11
long lastCheckTime
Definition: UpdateChecker.idl:40
TimeSpan lastUpdateCheck
Definition: UpdateChecker.idl:41
boolean download
Definition: UpdateChecker.idl:15
boolean autoUpdatePlanned
Definition: UpdateChecker.idl:47