This page describes the classes and methods to read, modify and update the system.
Settings classes are not instantiated directly, but instead are accessed via a NetShark instance. The following table lists the available settings related classes and the accessor name:
Settings | Class | Accessor Attribute | API Versions |
---|---|---|---|
Basic | Basic | ns.settings.basic | v4.x, v5.x |
Auth | Auth | ns.settings.auth | v4.x, v5.x |
Audit | Audit | ns.settings.audit | v4.x, v5.x |
Licenses | Licenses | ns.settings.licenses | v4.x, v5.x |
Firewall | Firewall | ns.settings.firewall | v4.x, v5.x |
Certificates | Certificates | ns.settings.certificates | v4.x, v5.x |
Profiler Export | ProfilerExport | ns.settings.profiler_export | v4.x, v5.x |
CORS Domain | CorsDomain | ns.settings.cors_domain | v4.x, v5.x |
Users | Users | ns.settings.users | v4.x, v5.x |
Groups | Groups | ns.settings.groups | v4.x, v5.x |
Update | Update | ns.settings.update | v4.x, v5.x |
Storage | Storage | ns.settings.storage | v4.x, v5.x |
Port Definitions | Port Definitions | ns.settings.port_definitions | v5.x |
Port Groups | Port Groups | ns.settings.port_groups | v5.x |
Layer 4 Mappings | L4Mapping | ns.settings.l4_mappings | v5.x |
Custom Applications | CustomApplications | ns.settings.custom_application | v5.x |
Alerts | Alerts | ns.settings.alerts | v5.x |
For example, modifying basic settings can be accomplished as follows:
>>> ns = NetShark(...)
>>> basic = ns.settings.basic
>>> basic.get()
>>> basic.data['primary_dns'] = '10.1.2.3'
>>> basic.save()
This class is used as a base for all the settings related classes.
Cancel pending changes and reload the configuration from server.
Current settings are stored in this property.
This is updated by calls to get() and load(). The attribute may be modified directly and the resulting value pushed to the server via save().
Download settings and save to a file.
Gets the configuration from the server
Parameters: | force (bool) – set to true to ignore a cached copy |
---|---|
Returns: | a dictionary of settings |
Load the configuration from a path or dict
Parameters: |
|
---|
On success, this discards any changes to data.
Save configuration to the server.
Base class to force get of new configuration in not bulk update capable settings
This basically overrides the save method such that it doesn’t perform a bulk update on the resource but fetches the new data from the server only
Bases: steelscript.netshark.core._settings4.BasicSettingsFunctionality
Wrapper class around basic system settings.
Bases: steelscript.netshark.core._settings4.BasicSettingsFunctionality
Wrapper class around authentication settings.
Bases: steelscript.netshark.core._settings4.BasicSettingsFunctionality
Wrapper class around audit configuration.
Bases: steelscript.netshark.core._settings4.NoBulk, steelscript.netshark.core._settings4.BasicSettingsFunctionality
Wrapper class around license configuration.
Add a license key.
Clear all license keys.
Remove a license key.
Return the license status.
Bases: steelscript.netshark.core._settings4.BasicSettingsFunctionality
Wrapper class around firewall settings.
Bases: steelscript.netshark.core._settings4.NoBulk, steelscript.netshark.core._settings4.BasicSettingsFunctionality
Wrapper class around the certificates configuration
Adds the given PEM certificate to the list of trusted certificates under the given name
Generates a new certificate for netprofiler export
Generates a new certificate for the webui
Removes the name of a PEM certificate that is trusted, removes from the list of trusted certificates
Give a certificate in PEM format, uploads to the server and sets as netprofiler export certificate
The PEM certificate must contain both private key and CA-signed public certificate
Given a certificate in PEM format, uploads to the server and sets as webui certificate.
The PEM certificate must contain both private key and CA-signed public certificate
Copies netprofiler export certificate and use it for webui
Copies webui certificate and use it for netprofiler export
Bases: steelscript.netshark.core._settings4.ProfilerExport
Wrapper class arouind Profiler Export
Helper method to select the current profiler to sync DPI with.
This method modifes self.data to reflect the changes. save() must be called to push the changes to the NetShark.
Helper method to select the current profiler to sync DPI with.
This method modifes self.data to reflect the changes. save() must be called to push the changes to the NetShark.
Bases: steelscript.netshark.core._settings4.BasicSettingsFunctionality
Wrapper class around CORS Domain settings.
Bases: steelscript.netshark.core._settings4.NoBulk, steelscript.netshark.core._settings4.BasicSettingsFunctionality
Wrapper class around Users configuration settings.
Adds a user to the NetShark
username is a string representing the username
groups is the group the user should be added in. Administrators is the administrators group. Add user to that group to make the user with administator privileges.
can_be_locked is a boolean representing if the user can be locked out from the system or not
Change password of an user
Delete user from the system
username is the username of the user to be deleted
Bases: steelscript.netshark.core._settings4.NoBulk, steelscript.netshark.core._settings4.BasicSettingsFunctionality
Wrapper class around settings for user groups.
Adds a new group to the system
Parameters: |
|
---|
Removes group from the groups in the NetShark
Bases: steelscript.netshark.core._settings4.NoBulk, steelscript.netshark.core._settings4.BasicSettingsFunctionality
Manage system update, ISOs and settings.
Clear any ISO that the NetShark is configured to use.
Instruct the NetShark to upload a new ISO from a URL.
Initiate an update using the configured ISO.
Upload a new ISO From a file.
Parameters: | f (file) – file descriptor to read from |
---|
Bases: steelscript.netshark.core._settings4.NoBulk, steelscript.netshark.core._settings4.BasicSettingsFunctionality
Formats the packet storage
Warning
This operation will lose all packets in every job
Parameters: | percentage_reserved_space (int) – percentage of disk reserved starting from the outher boundaries of the disk. |
---|
Since I/O operations at the farmost parts of the disk have higher latency this is often used to increase performances of the packet recorder. percentage_reserved_space can be any value from 0 (default) to 95.
Reinitializes the packet storage
Warning
This operation will lose all packets in every job
Parameters: | wait (bool) – set to True to wait for the packet storage to be back again before returning |
---|
New in version API: 5.x
Bases: steelscript.netshark.core._settings5.DPIResource
Wrapper class and port definitions.
Add a port definition
Parameters: |
|
---|
Remove port identified by name and port number from the Port Definitions
Parameters: |
|
---|
New in version API: 5.x
Bases: steelscript.netshark.core._settings5.DPIResource
Wrapper class and port group definitions.
Remove a port group by name or by priority
It accepts one of name or priority. If name and priority are issued it will remove the rule named name only if it matches priority
Parameters: |
|
---|
New in version API: 5.x
Bases: steelscript.netshark.core._settings5.PortGroups
Wrapper class around Layer 4 Mappings.
Add a l4 mapping rule
Parameters: |
|
---|
Remove a l4 mapping rule
It accepts one of name or priority. If name and priority are issued it will remove the rule named name only if it matches priority
Parameters: |
|
---|
New in version API: 5.x
Bases: steelscript.netshark.core._settings5.DPIResource
Wrapper class around custom application defintions.
Add a custom application rule
Parameters: |
|
---|
Remove a custom application rule
Parameters: | name (str) – the name of the rule |
---|
New in version API: 5.x
Bases: steelscript.netshark.core._settings4.BasicSettingsFunctionality
Sends a test email via SMTP.
Sends a test SNMP trap
Parameters: | obj (dict) – object representing the trap to send. |
---|
The obj must be of the form:
{"address":"trap.riverbed.com","version":"V1","community":"test"}
or
{"address":"trap.riverbed.com","community":"public","version":"V2C"}
or
{
"address": "trap.riverbed.com",
"version": "V3",
"username": "test",
"engine_id": "testengine",
"security_level": "AUTH_PRIVACY",
"authentication": {"protocol":"MD5",
"passphrase":"testpassword"},
"privacy": {"protocol":"DES",
"passphrase":"testpassword"}
}