All Classes Files Functions Variables Enumerations Enumerator Groups Pages
IpAddressGroups.idl
Go to the documentation of this file.
1 /**
2  * @file IpAddressGroups.idl
3  * @brief Ip Address %Group settings
4  *
5  * @author Dusan Juhas, Roman Jokl
6  *
7  * Copyright © 2017 Kerio Technologies s.r.o.
8  */
9 #import <kerio/web/idl/SharedStructures.idl>
10 
11 module kerio {
12 module web {
13 
14 /**
15  * @defgroup SUBGROUP3 Definitions
16  * @{
17  */
18 
19 
20 enum IpAddressGroupType {
21  Host,
22  Network,
23  Range,
24  ChildGroup,
25  ThisMachine,
26  IpPrefix
27 };
28 
30  KId id;
31  string name;
32 };
33 
34 /**
35  *
36  * Note: If type is changed, all fields representing associated value must be also assigned, if used in set method.
37  * And conversely, type must be assigned if value was changed.
38  * type + host + (addr1, addr2) + childGroupId
39  */
41  KId id;
42  KId groupId;
43  KId sharedId; ///< read-only; filled when the item is shared in MyKerio
44  string groupName;
45  string description;
46 
47  IpAddressGroupType type;
48  boolean enabled;
49  StoreStatus status;
50 
51  /*@{ host */
52  string host; ///< name, IP or IP prefix
53  /*@}*/
54 
55  /*@{ network, range */
56  IpAddress addr1; ///< network/from, e.g. 192.168.0.0
57  IpAddress addr2; ///< mask/to, e.g. 255.255.0.0
58  /*@}*/
59 
60  /*@{ group */
61  KId childGroupId;
62  string childGroupName;
63  /*@}*/
64 
65  /*@{ firewall */
66  // nothing
67  /*@}*/
68 };
69 
70 typedef sequence<IpAddressEntry> IpAddressEntryList;
71 typedef sequence<IpAddressGroup> IpAddressGroupList;
72 
73 interface IpAddressGroups {
74 
75  /**
76  * Create new groups.
77  *
78  * @param errors - possible errors:
79  * - "This address group already exists!" duplicate name-value
80  * @param result - list of IDs of created IpAddressGroups
81  * @param groups - details for new groups.
82  */
83  void create(out ErrorList errors, out CreateResultList result, in IpAddressEntryList groups);
84 
85  /**
86  * Get the list of IP groups.
87  *
88  * @param groups - list of groups and its details
89  * @param totalItems - count of all groups on the server (before the start/limit applied)
90  * @param query - conditions and limits. Included from weblib. KWF engine implementation notes:
91  * - LIKE matches substring (second argument) in a string (first argument). There are no wildcards.
92  * - sort and match are not case sensitive.
93  * - column alias (first operand):
94  * - TODO: "QUICKSEARCH" - requested operator applied as following: (name operator secondOperand ) || (description operator secondOperand)
95  */
96  void get(out IpAddressEntryList list, out long totalItems, in SearchQuery query);
97 
98  /**
99  * Get the list of groups, sorted in ascending order.
100  *
101  * @param groups - list of IP address groups
102  */
103  void getGroupList(out IpAddressGroupList groups);
104 
105  /**
106  * Remove groups.
107  *
108  * @param groupIds - IDs of groups that should be removed
109  * @param errors - Errors by removing groups
110  */
111  void remove(out ErrorList errors, in KIdList groupIds);
112 
113  /**
114  * Create groups.
115  *
116  * @param errors - possible errors:
117  * - "This address group already exists!" duplicate name-value
118  * @param groupIds - IDs of groups to be updated.
119  * @param details - details for update.
120  */
121  void set(out ErrorList errors, in KIdList groupIds, in IpAddressEntry details);
122 
123  /**
124  * Check if groups removal can cut off the administrator from remote administration
125  *
126  * @param groupIds - IDs of groups that should be removed
127  * @param errors - if the result is false, error argument contains additional error info; possible errors:
128  * - "You will be cut off from remote administration!"
129  */
130  void validateRemove(out ErrorList errors, in KIdList groupIds);
131 
132  /**
133  * Check update of existing groups to see whether this change cut off the administrator from remote administration.
134  *
135  * @param errors - if the result is false, error argument contains additional error info; possible errors:
136  * - "You will be cut off from remote administration!"
137  * @param groupIds - IDs of groups to be updated.
138  * @param details - details for update.
139  */
140  void validateSet(out ErrorList errors, in KIdList groupIds, in IpAddressEntry details);
141 
142 };
143 
144 }; // module web
145 }; // module kerio