set_threat_management
set_threat_management
Section titled “set_threat_management”Update Threat Management (IDS/IPS) configuration.
Side effects:
- Patches the controller’s
ipssetting record. Whenenabled=Falsethe mode is forced tooff; the controller then disables packet inspection on every network. Whenenabled=True,modeselects detection-only (ids) or inline blocking (ips). - Untouched fields (signature categories, network bindings, ad
blocking, DNS filtering) are preserved by the controller’s merge
semantics. Supplying
signature_categoriesreplaces the active list wholesale;Noneleaves it unchanged. - Mutates controller state. Use dry_run=True to preview the change.
Example
Section titled “Example”set_threat_management(enabled=True, mode="ips")Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
enabled | boolean | yes | — | True activates inspection; False sets mode=off and overrides any mode argument. |
mode | string | no | ”ids” | When enabled=True, one of "ids" (detection-only, default) or "ips" (inline blocking). Ignored when enabled=False. |
signature_categories | `array | null` | no | null |
controller | string | no | ”default” | Name of the UniFi controller to target. Defaults to "default". |
dry_run | boolean | no | false | Preview the change without applying it. Returns the predicted patch envelope. |