Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
Loading...
Searching...
No Matches
BulkConfiguration.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2010 Raritan Inc. All rights reserved.
4 */
5
6#include <UserEvent.idl>
7
8/** Bulk Configuration */
9module bulkcfg {
10
11 /** Bulk Configuration Interface */
13
14 /** Status of the last bulk configuration restore operation */
15 enumeration Status {
16 UNKNOWN, ///< No bulk configuration was done yet
17 UPLOAD_FAILED, ///< Uploading a bulk configuration failed
18 RESTORE_PENDING, ///< Restore is pending
19 RESTORE_OK, ///< Restoring bulk configuration successful
20 RESTORE_FAILED ///< Restoring bulk configuration failed
21 };
22
23 /**
24 * Retrieve the status of the last bulk configuration restore
25 * operation.
26 *
27 * @param status Result: Bulk configuration restore status
28 * @param timeStamp Result: Time of last restore operation (UNIX timestamp, UTC)
29 */
30 void getStatus(out Status status, out time timeStamp);
31
32 /**
33 * These are the supported supported filter types.
34 */
35 enumeration FilterType {
36 WHITELIST, ///< Whitelist filter (value is part of the bulk configuration)
37 BLACKLIST ///< Blacklist filter (value is not part of the bulk configuration)
38 };
39
40 /**
41 * This structure defines a filter.
42 */
43 structure Filter {
44 string name; ///< internal name of the filter
45 string displayName; ///< name of the filter in the user interface
46 boolean noOverride; ///< true if filter is always active and has a fixed type
47 boolean bulkOnly; ///< true if filter is not for backup
48 vector<string> ruleSpecs; ///< filter rule specifications (used only internally)
49 };
50
51 /**
52 * Filter profiles are named collections of filters.
53 *
54 * Custom filter profiles inherit all filters from the builtin profile, i.e. if the filter profile
55 * is empty it is identical to the builtin profile. The type for most of the inherited filters can
56 * be changed in the derived profile. Only filters with the noOverride flag set are unchangable.
57 */
58 structure FilterProfile {
59 string name; ///< name of the filter profile
60 string description; ///< description of the filter profile
61 map<string,FilterType> filterNameToTypeMap; ///< map filter name to type
62 };
63
64 /**
65 * Settings
66 */
67 structure Settings {
68 vector<FilterProfile> filterProfiles; ///< Defined filter profiles
69 string defaultProfileName; ///< Name of the default profile
70 };
71
72 /** Event: Bulk configuration settings changed */
73 valueobject SettingsChangedEvent extends event.UserEvent {
74 };
75
76 /** Event: Bulk configuration saved (also used for saving config backup) */
77 valueobject SavedEvent extends event.UserEvent {
78 boolean isBackup; ///< true if the event is caused by saving a full configuration backup
79 };
80
81 /** Event: Bulk configuration restored (also used for restoring config backup) */
82 valueobject RestoredEvent extends event.UserEvent {
83 boolean isBackup; ///< true if the event is caused by restoring a full configuration backup
84 };
85
86 /**
87 * Error codes
88 */
89 constant int SUCCESS = 0; ///< The operation was successful
90 constant int ERR_FILTER_NAME_UNKNOWN = 1; ///< A referenced filter name is unknown
91 constant int ERR_FILTER_TYPE_READONLY = 2; ///< A referenced filter can't be overridden
92 constant int ERR_PROFILE_ALREADY_EXISTS = 3; ///< A profile with the given name already exists
93 constant int ERR_PROFILE_DOES_NOT_EXIST = 4; ///< A profile with the given name does not exist
94 constant int ERR_PROFILE_IS_DEFAULT = 5; ///< The selected profile is the current default profile
95 constant int ERR_PROFILE_IS_BUILTIN = 6; ///< The selected profile is the builtin profile
96 constant int ERR_PROFILE_NAME_TOO_LONG = 7; ///< The profile name is too long
97 constant int ERR_PROFILE_NAME_INVALID = 8; ///< The profile name contains invalid characters
98 constant int ERR_PROFILE_TOO_MANY = 9; ///< The maximum number of profiles already exist.
99
100 /**
101 * Retrieve the list of supported filters.
102 *
103 * @return List of supported filters
104 */
105 vector<Filter> getFilters();
106
107 /**
108 * Retrieve the configured filter profiles.
109 *
110 * @return List of filter profiles
111 */
112 vector<FilterProfile> getFilterProfiles();
113
114 /**
115 * Add a new filter profile.
116 *
117 * @param profile The new filter profile
118 *
119 * @return SUCCESS if OK
120 * @return ERR_FILTER_NAME_UNKNOWN if a referenced filter name is unknown
121 * @return ERR_FILTER_TYPE_READONLY if a referenced filter can't be overridden
122 * @return ERR_PROFILE_ALREADY_EXISTS if a profile with the given name already exists
123 * @return ERR_PROFILE_IS_BUILTIN if the selected profile is the builtin profile
124 * @return ERR_PROFILE_NAME_TOO_LONG if the profile name is too long
125 * @return ERR_PROFILE_NAME_INVALID if the profile name contains invalid characters
126 * @return ERR_PROFILE_TOO_MANY if the maximum number of profiles already exist
127 */
129
130 /**
131 * Modify an existing filter profile.
132 *
133 * @param profile The updated filter profile
134 *
135 * @return SUCCESS if OK
136 * @return ERR_FILTER_NAME_UNKNOWN if a referenced filter name is unknown
137 * @return ERR_FILTER_TYPE_READONLY if a referenced filter can't be overridden
138 * @return ERR_PROFILE_DOES_NOT_EXIST if a profile with the given name does not exist
139 * @return ERR_PROFILE_IS_BUILTIN if the selected profile is the builtin profile
140 */
142
143 /**
144 * Delete an existing filter profile.
145 *
146 * @param profileName The name of the profile to be deleted
147 *
148 * @return SUCCESS if OK
149 * @return ERR_PROFILE_DOES_NOT_EXIST if a profile with the given name does not exist
150 * @return ERR_PROFILE_IS_DEFAULT if the selected profile is the current default profile
151 * @return ERR_PROFILE_IS_BUILTIN if the selected profile is the builtin profile
152 */
153 int deleteFilterProfile(in string profileName);
154
155 /**
156 * Retrieve the name of the currently selected default profile.
157 *
158 * @return The name of the current default profile
159 */
161
162 /**
163 * Select a new default filter profile.
164 *
165 * @param profileName The name of the new default profile
166 *
167 * @return SUCCESS if OK
168 * @return ERR_PROFILE_DOES_NOT_EXIST if a profile with the given name does not exist
169 */
170 int selectDefaultFilterProfile(in string profileName);
171
172 /**
173 * Get settings
174 *
175 * @return Settings
176 */
178
179 /**
180 * Set settings
181 *
182 * NOTE: The builtin profile will be ignored when present in the list of filter profiles.
183 *
184 * @param settings The settings to set
185 *
186 * @return SUCCESS if OK
187 * @return ERR_FILTER_NAME_UNKNOWN if a referenced filter name is unknown
188 * @return ERR_FILTER_TYPE_READONLY if a referenced filter can't be overridden
189 * @return ERR_PROFILE_ALREADY_EXISTS if the settings contain multiple profiles with the same name
190 * @return ERR_PROFILE_NAME_TOO_LONG if the profile name is too long
191 * @return ERR_PROFILE_NAME_INVALID if the profile name contains invalid characters
192 * @return ERR_PROFILE_TOO_MANY if the settings contain too many profiles
193 * @return ERR_PROFILE_DOES_NOT_EXIST if a profile with the given name does not exist
194 */
195 int setSettings(in Settings settings);
196
197 };
198
199}
Bulk Configuration Interface.
string getDefaultFilterProfileName()
Retrieve the name of the currently selected default profile.
Settings getSettings()
Get settings.
int setSettings(in Settings settings)
Set settings.
vector< FilterProfile > getFilterProfiles()
Retrieve the configured filter profiles.
vector< Filter > getFilters()
Retrieve the list of supported filters.
Status
Status of the last bulk configuration restore operation.
@ RESTORE_OK
Restoring bulk configuration successful.
@ UNKNOWN
No bulk configuration was done yet.
@ UPLOAD_FAILED
Uploading a bulk configuration failed.
@ RESTORE_PENDING
Restore is pending.
int addFilterProfile(in FilterProfile profile)
Add a new filter profile.
void getStatus(out Status status, out time timeStamp)
Retrieve the status of the last bulk configuration restore operation.
int deleteFilterProfile(in string profileName)
Delete an existing filter profile.
FilterType
These are the supported supported filter types.
@ WHITELIST
Whitelist filter (value is part of the bulk configuration)
int modifyFilterProfile(in FilterProfile profile)
Modify an existing filter profile.
int selectDefaultFilterProfile(in string profileName)
Select a new default filter profile.
Bulk Configuration.
Filter profiles are named collections of filters.
map< string, FilterType > filterNameToTypeMap
map filter name to type
string name
name of the filter profile
string description
description of the filter profile
This structure defines a filter.
string displayName
name of the filter in the user interface
boolean noOverride
true if filter is always active and has a fixed type
vector< string > ruleSpecs
filter rule specifications (used only internally)
boolean bulkOnly
true if filter is not for backup
string name
internal name of the filter
Event: Bulk configuration restored (also used for restoring config backup)
boolean isBackup
true if the event is caused by restoring a full configuration backup
Event: Bulk configuration saved (also used for saving config backup)
boolean isBackup
true if the event is caused by saving a full configuration backup
Event: Bulk configuration settings changed.
string defaultProfileName
Name of the default profile.
vector< FilterProfile > filterProfiles
Defined filter profiles.