Art-of-WiFi / UniFi-API-client

A PHP API client class to interact with Ubiquiti's UniFi Controller API
MIT License
1.09k stars 217 forks source link

en/disable port #201

Closed vespino closed 8 months ago

vespino commented 8 months ago

I see it's possible to cycle power on a port, but is it possible to en/disable a port?

malle-pietje commented 8 months ago

Yes, have a look at this example that is specific to inwalls but the approach is the same. There is a “disabled” switch port profile you need to apply to disable the port and you apply the desired port profile to enable the port: https://github.com/Art-of-WiFi/UniFi-API-client/blob/master/examples/update_ac-iw_ports.php

vespino commented 8 months ago

Cheers @malle-pietje, I totally overlooked the examples and have now also found this example which seems to do exactly what I was looking for: https://github.com/Art-of-WiFi/UniFi-API-client/blob/master/examples/disable_switch_port.php. I’ll give this a try.