create_honeypot
create_honeypot
Section titled “create_honeypot”Add a honeypot trap to a network.
Side effects:
- Reads the current
ipssetting, appends a new entry{"network_id": ..., "ip_address": ..., "version": "v4"}, and writes the updated list back viaPOST /set/setting/ips. - Sets
honeypot_enabled=trueon the controller (the toggle tracks list non-emptiness). - Mutates controller state. Use dry_run=True to preview.
Refuses to write if the (network_id, ip) pair is already a
honeypot or if ip is not a valid LAN IPv4 address.
Example
Section titled “Example”create_honeypot(network_id="65f...", ip="10.0.50.2")Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
network_id | string | yes | — | The _id from list_networks for the VLAN the honeypot should live on. |
ip | string | yes | — | Unallocated IPv4 address inside the target network. |
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. |