List or modify multiple system settings
When you are working with many system settings, use the methods or functions of the
SystemSettingsApi class that provide access to all system settings in a single
call:
- listSystemSettings: Returns a SystemSettings object that contains the values that are set for all system settings on Deep Security Manager.
- modifySystemSettings: Modifies all system settings according to the SystemSettings object that is provided as an argument.
Use the following general steps to use an SDK to modify a system setting:
- Create a
SettingValueobject for every system setting that you are configuring. Set the value of each object to the value that you want for the corresponding system setting. - Create a
SystemSettingsobject and set the properties to theSettingValueobjects. - Create a
SystemSettingsApiobject and use it to modify the system settings on Deep Security Manager according to theSystemSettingsobject.
SettingValue values are of type String. The following example creates a
SettingValue for a setting that you want to set to 100:
-
Python:
max_sessions = api.SettingValue() max_sessions.value = "100" -
JavaScript:
const maxSessions = new api.SettingValue(); maxSessions.value = "100"; -
Java:
SettingValue maxSessionsValue = new SettingValue(); maxSessionsValue.setValue(100);
Use the SettingValue as the value of a setting:
-
Python:
system_settings = api.SystemSettings() system_settings.platform_setting_active_sessions_max_num = max_sessions -
JavaScript:
const systemSettings = new api.SystemSettings(); systemSettings.platformSettingActiveSessionsMax = maxSessions; -
Java:
SystemSettings systemSettings = new SystemSettings(); systemSettings.setPlatformSettingActiveSessionsMax(maxSessionsValue);
Finally, modify the setting on Deep Security Manager:
-
Python:
settings_api = api.SystemSettingsApi(api.ApiClient(configuration)) return settings_api.modify_system_settings(system_settings, api_version) -
JavaScript:
const systemSettingsApi = new api.SystemSettingsApi(); return systemSettingsApi.modifySystemSettings(systemSettings, apiVersion); -
Java:
SystemSettingsApi settingsApi = new SystemSettingsApi(); return settingsApi.modifySystemSettings(systemSettings, apiVersion);
Example: Modify multiple system settings
The following example sets two system settings: the system setting that controls the maximum number of sessions that a user can create, and the action that the manager takes when the maximum is exceeded.
|
Language |
Code |
|---|---|
|
Python |
View
source |
|
JavaScript |
View
source |
|
Java |
View
source |
Also see the Modify System Settings operation in the API Reference. For information about authenticating API calls, see Authenticate with Deep Security Manager.
