Skip to content

create_honeypot

Add a honeypot trap to a network.

Side effects:

  • Reads the current ips setting, appends a new entry {"network_id": ..., "ip_address": ..., "version": "v4"}, and writes the updated list back via POST /set/setting/ips.
  • Sets honeypot_enabled=true on 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.

create_honeypot(network_id="65f...", ip="10.0.50.2")
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.