quarantine_client
quarantine_client
Section titled “quarantine_client”Block a client and log the quarantine action with a reason.
Side effects:
- Step 1: adds the MAC to the controller’s user-block list (same as
block_client). The client is immediately disconnected and prevented from re-associating untilunblock_clientis called. - Step 2: appends a WARNING-level structured log entry capturing
macandreasonfor later forensics. - Mutates controller state. Use dry_run=True to preview the change without applying.
- Rollback: if any sub-step fails, all prior sub-steps are reverted (the log entry is best-effort and not unwound; only step 1 mutates the controller).
Example
Section titled “Example”quarantine_client(mac="aa:bb:cc:00:00:01", reason="suspected malware c2")Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
mac | string | yes | — | Client MAC address (e.g. "aa:bb:cc:00:00:01"). |
reason | string | no | "" | Free-form justification (kept in logs only, e.g. "suspected malware c2"). |
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 change set. |