Skip to content

create_port_profile

Create a switch port profile.

Side effects:

  • Adds a new profile defining native (untagged) VLAN, tagged VLANs, PoE behaviour, and forwarding mode. The profile is dormant until a switch port is assigned to it (via set_port_state).
  • Mutates controller state. Use dry_run=True to preview the change without applying.
create_port_profile(name="iot-trunk", native_networkconf_id="65f...", tagged_networkconf_ids=["65a...", "65b..."], poe_mode="auto")
ParameterTypeRequiredDefaultDescription
namestringyesDisplay name for the profile (e.g. "iot-trunk").
native_networkconf_idstringno""_id of the native (untagged) network. Empty for trunk-only ports.
forwardstringno”all”"all" (default), "native", "customize", or "disabled".
poe_modestringno”auto”"auto" (default), "passive24v", "passthrough", or "off".
tagged_networkconf_ids`arraynull`nonull
controllerstringno”default”Name of the UniFi controller to target. Defaults to "default".
dry_runbooleannofalsePreview the change without applying it. Returns the predicted change set.