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 */
12 interface BulkConfiguration {
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 */
128 int addFilterProfile(in FilterProfile profile);
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 */
141 int modifyFilterProfile(in FilterProfile profile);
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 */
160 string getDefaultFilterProfileName();
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 */
177 Settings getSettings();
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}
bulkcfg::BulkConfiguration
Bulk Configuration Interface.
Definition BulkConfiguration.idl:12
bulkcfg::BulkConfiguration::getDefaultFilterProfileName
string getDefaultFilterProfileName()
Retrieve the name of the currently selected default profile.
bulkcfg::BulkConfiguration::getSettings
Settings getSettings()
Get settings.
bulkcfg::BulkConfiguration::setSettings
int setSettings(in Settings settings)
Set settings.
bulkcfg::BulkConfiguration::getFilterProfiles
vector< FilterProfile > getFilterProfiles()
Retrieve the configured filter profiles.
bulkcfg::BulkConfiguration::getFilters
vector< Filter > getFilters()
Retrieve the list of supported filters.
bulkcfg::BulkConfiguration::Status
Status
Status of the last bulk configuration restore operation.
Definition BulkConfiguration.idl:15
bulkcfg::BulkConfiguration::RESTORE_OK
@ RESTORE_OK
Restoring bulk configuration successful.
Definition BulkConfiguration.idl:19
bulkcfg::BulkConfiguration::UNKNOWN
@ UNKNOWN
No bulk configuration was done yet.
Definition BulkConfiguration.idl:16
bulkcfg::BulkConfiguration::UPLOAD_FAILED
@ UPLOAD_FAILED
Uploading a bulk configuration failed.
Definition BulkConfiguration.idl:17
bulkcfg::BulkConfiguration::RESTORE_PENDING
@ RESTORE_PENDING
Restore is pending.
Definition BulkConfiguration.idl:18
bulkcfg::BulkConfiguration::addFilterProfile
int addFilterProfile(in FilterProfile profile)
Add a new filter profile.
bulkcfg::BulkConfiguration::getStatus
void getStatus(out Status status, out time timeStamp)
Retrieve the status of the last bulk configuration restore operation.
bulkcfg::BulkConfiguration::deleteFilterProfile
int deleteFilterProfile(in string profileName)
Delete an existing filter profile.
bulkcfg::BulkConfiguration::FilterType
FilterType
These are the supported supported filter types.
Definition BulkConfiguration.idl:35
bulkcfg::BulkConfiguration::WHITELIST
@ WHITELIST
Whitelist filter (value is part of the bulk configuration)
Definition BulkConfiguration.idl:36
bulkcfg::BulkConfiguration::modifyFilterProfile
int modifyFilterProfile(in FilterProfile profile)
Modify an existing filter profile.
bulkcfg::BulkConfiguration::selectDefaultFilterProfile
int selectDefaultFilterProfile(in string profileName)
Select a new default filter profile.
bulkcfg
Bulk Configuration.
Definition BulkConfiguration.idl:9
bulkcfg::BulkConfiguration::FilterProfile
Filter profiles are named collections of filters.
Definition BulkConfiguration.idl:58
bulkcfg::BulkConfiguration::FilterProfile::filterNameToTypeMap
map< string, FilterType > filterNameToTypeMap
map filter name to type
Definition BulkConfiguration.idl:61
bulkcfg::BulkConfiguration::FilterProfile::name
string name
name of the filter profile
Definition BulkConfiguration.idl:59
bulkcfg::BulkConfiguration::FilterProfile::description
string description
description of the filter profile
Definition BulkConfiguration.idl:60
bulkcfg::BulkConfiguration::Filter
This structure defines a filter.
Definition BulkConfiguration.idl:43
bulkcfg::BulkConfiguration::Filter::displayName
string displayName
name of the filter in the user interface
Definition BulkConfiguration.idl:45
bulkcfg::BulkConfiguration::Filter::noOverride
boolean noOverride
true if filter is always active and has a fixed type
Definition BulkConfiguration.idl:46
bulkcfg::BulkConfiguration::Filter::ruleSpecs
vector< string > ruleSpecs
filter rule specifications (used only internally)
Definition BulkConfiguration.idl:48
bulkcfg::BulkConfiguration::Filter::bulkOnly
boolean bulkOnly
true if filter is not for backup
Definition BulkConfiguration.idl:47
bulkcfg::BulkConfiguration::Filter::name
string name
internal name of the filter
Definition BulkConfiguration.idl:44
bulkcfg::BulkConfiguration::RestoredEvent
Event: Bulk configuration restored (also used for restoring config backup)
Definition BulkConfiguration.idl:82
bulkcfg::BulkConfiguration::RestoredEvent::isBackup
boolean isBackup
true if the event is caused by restoring a full configuration backup
Definition BulkConfiguration.idl:83
bulkcfg::BulkConfiguration::SavedEvent
Event: Bulk configuration saved (also used for saving config backup)
Definition BulkConfiguration.idl:77
bulkcfg::BulkConfiguration::SavedEvent::isBackup
boolean isBackup
true if the event is caused by saving a full configuration backup
Definition BulkConfiguration.idl:78
bulkcfg::BulkConfiguration::SettingsChangedEvent
Event: Bulk configuration settings changed.
Definition BulkConfiguration.idl:73
bulkcfg::BulkConfiguration::Settings
Settings.
Definition BulkConfiguration.idl:67
bulkcfg::BulkConfiguration::Settings::defaultProfileName
string defaultProfileName
Name of the default profile.
Definition BulkConfiguration.idl:69
bulkcfg::BulkConfiguration::Settings::filterProfiles
vector< FilterProfile > filterProfiles
Defined filter profiles.
Definition BulkConfiguration.idl:68