All Classes Files Functions Variables Enumerations Enumerator Groups Pages
Migration.idl
Go to the documentation of this file.
1 /**
2  * @file Migration.idl
3  * @brief Set user account migration in a distributed domain.
4  *
5  * @author Dusan Juhas
6  *
7  * @copyright Copyright © 2017 Kerio Technologies s.r.o.
8  */
9 
10 #import <kerio/web/idl/SharedStructures.idl>
11 #import <DistributedDomain.idl> //HomeServer
12 
13 module kerio {
14 module jsonapi {
15 module admin {
16 
17 enum MigrationStatusEnum {
18  migNotStarted, ///< Migration planed but not started
19  migCompressionStarted, ///< Migration started - packing of the mailbox and sending through network
20  migCompressionFinished, ///< Source server actions finished
21  migTransferStarted, ///< Downloading packed mailbox
22  migTransferFinished, ///< Download completed
23  migDecompressionStarted, ///< Target server actions - unpacking of the mailbox
24  migDecompressionFinished, ///< Mailbox successfully decompressed
25  migFinished, ///< Migration finished
26  migCanceled, ///< Migration canceled by user
27  migError ///< Migration failed - detailed error description can be found in logs
28 };
29 
30 /**
31  * Status of the migration task and progress of migration in percents.
32  */
34  MigrationStatusEnum migrationStatus; ///< current status of the migration
35  long progressInPercents; ///< number from 0 to 100
36  string errorMessage; ///< If migrationStatus is migError, errorMessage optionaly contains detailed info about error in english
37 };
38 
39 /**
40  * This structure contains information about:
41  * - user which will be/is migrated
42  * - current homeserver (sourceServer)
43  *
44  * In get methods is returned also status of user's migration.
45  * Whole structure is READ-ONLY
46  */
47 struct MigrationTask {
48  kerio::web::KId id; ///< id of migration task
49  kerio::web::KId userId; ///< id of migrated user
50  string userName; ///< name of migrated user
51  HomeServer sourceServer; ///< source homeserver
52  // HomeServer targetServer; ///< in current implementation it's always current server -
53  MigrationStatus status; ///< status of the migration
54 };
55 
56 /**
57  * List of migration tasks
58  */
59 typedef sequence<MigrationTask> MigrationTaskList;
60 
61 
62 interface Migration {
63  /**
64  * Cancel planned or running migration tasks.
65  *
66  * @param errors - error message list
67  * @param taskIdList - Identifiers of migration tasks which should be canceled
68  */
69  void cancel(out kerio::web::ErrorList errors, in kerio::web::KIdList taskIdList);
70 
71  /**
72  * Obtain list of migration tasks.
73  *
74  * @param list - migration tasks
75  * @param totalItems - total number of tasks
76  * @param query - query attributes and limits
77  */
78  void get(out MigrationTaskList list, out long totalItems, in kerio::web::SearchQuery query);
79 
80  /**
81  * Return hostname and cluster-id of current server.
82  * Server must be part of the cluster, otherwise the result is always false.
83  * Note: This method should be moved to DistributedDomain
84  *
85  * @param homeServer - homeserver attributes
86  */
87  void getCurrentHomeServer(out HomeServer homeServer);
88 
89  /**
90  * Obtain status of currently running migration task.
91  *
92  * @param taskId - migration task identifier
93  * @param status - migration task status
94  */
95  void getCurrentStatus(out kerio::web::KId taskId, out MigrationStatus status);
96 
97  /**
98  * Obtain status of migration task specified by the task ID.
99  *
100  * @param status - migration task status
101  * @param taskId - migration task identifier
102  */
103  void getStatus(out MigrationStatus status, in kerio::web::KId taskId);
104 
105  /**
106  * Return status of migration tasks.
107  * Note: This method may fail if caller does not have full admin rights.
108  *
109  * @param isInProgress - is there any migration task running?
110  */
111  void isInProgress(out boolean isInProgress);
112 
113  /**
114  * Start a new migration task.
115  *
116  * @param errors - error message list
117  * @param result
118  * @param userIds - users to be migrated
119  */
120  void start(out kerio::web::ErrorList errors, out kerio::web::CreateResultList result, in kerio::web::KIdList userIds);
121 };
122 
123 }; }; };//end of namespace