/py-unifi

Python Unifi API Client

Primary LanguagePython

unifi-api

Unifi Controller API

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 8.0.26
  • Package version: 0.1.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/ubiquiti-community/py-unifi.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/ubiquiti-community/py-unifi.git)

Then import the package:

import unifi_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import unifi_client

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import time
import unifi_client
from unifi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://unifi.ui.com/proxy/network/api/s/default
# See configuration.py for a list of all supported configuration parameters.
configuration = unifi_client.Configuration(
    host = "https://unifi.ui.com/proxy/network/api/s/default"
)



# Enter a context with an instance of the API client
async with unifi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifi_client.AccountApi(api_client)
    account = unifi_client.Account() # Account |  (optional)

    try:
        api_response = await api_instance.create_account(account=account)
        print("The response of AccountApi->create_account:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AccountApi->create_account: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://unifi.ui.com/proxy/network/api/s/default

Class Method HTTP request Description
AccountApi create_account POST /rest/account
AccountApi delete_account DELETE /rest/account/{id}
AccountApi get_account GET /rest/account/{id}
AccountApi list_account GET /rest/account
AccountApi update_account PUT /rest/account/{id}
BroadcastGroupApi create_broadcast_group POST /rest/broadcastgroup
BroadcastGroupApi delete_broadcast_group DELETE /rest/broadcastgroup/{id}
BroadcastGroupApi get_broadcast_group GET /rest/broadcastgroup/{id}
BroadcastGroupApi list_broadcast_group GET /rest/broadcastgroup
BroadcastGroupApi update_broadcast_group PUT /rest/broadcastgroup/{id}
ChannelPlanApi create_channel_plan POST /rest/channelplan
ChannelPlanApi delete_channel_plan DELETE /rest/channelplan/{id}
ChannelPlanApi get_channel_plan GET /rest/channelplan/{id}
ChannelPlanApi list_channel_plan GET /rest/channelplan
ChannelPlanApi update_channel_plan PUT /rest/channelplan/{id}
DHCPOptionApi create_dhcp_option POST /rest/dhcpoption
DHCPOptionApi delete_dhcp_option DELETE /rest/dhcpoption/{id}
DHCPOptionApi get_dhcp_option GET /rest/dhcpoption/{id}
DHCPOptionApi list_dhcp_option GET /rest/dhcpoption
DHCPOptionApi update_dhcp_option PUT /rest/dhcpoption/{id}
DashboardApi create_dashboard POST /rest/dashboard
DashboardApi delete_dashboard DELETE /rest/dashboard/{id}
DashboardApi get_dashboard GET /rest/dashboard/{id}
DashboardApi list_dashboard GET /rest/dashboard
DashboardApi update_dashboard PUT /rest/dashboard/{id}
DeviceApi create_device POST /rest/device
DeviceApi delete_device DELETE /rest/device/{id}
DeviceApi get_device GET /stat/device/{id}
DeviceApi list_device GET /stat/device
DeviceApi update_device PUT /rest/device/{id}
DpiAppApi create_dpi_app POST /rest/dpiapp
DpiAppApi delete_dpi_app DELETE /rest/dpiapp/{id}
DpiAppApi get_dpi_app GET /rest/dpiapp/{id}
DpiAppApi list_dpi_app GET /rest/dpiapp
DpiAppApi update_dpi_app PUT /rest/dpiapp/{id}
DpiGroupApi create_dpi_group POST /rest/dpigroup
DpiGroupApi delete_dpi_group DELETE /rest/dpigroup/{id}
DpiGroupApi get_dpi_group GET /rest/dpigroup/{id}
DpiGroupApi list_dpi_group GET /rest/dpigroup
DpiGroupApi update_dpi_group PUT /rest/dpigroup/{id}
DynamicDNSApi create_dynamic_dns POST /rest/dynamicdns
DynamicDNSApi delete_dynamic_dns DELETE /rest/dynamicdns/{id}
DynamicDNSApi get_dynamic_dns GET /rest/dynamicdns/{id}
DynamicDNSApi list_dynamic_dns GET /rest/dynamicdns
DynamicDNSApi update_dynamic_dns PUT /rest/dynamicdns/{id}
FirewallGroupApi create_firewall_group POST /rest/firewallgroup
FirewallGroupApi delete_firewall_group DELETE /rest/firewallgroup/{id}
FirewallGroupApi get_firewall_group GET /rest/firewallgroup/{id}
FirewallGroupApi list_firewall_group GET /rest/firewallgroup
FirewallGroupApi update_firewall_group PUT /rest/firewallgroup/{id}
FirewallRuleApi create_firewall_rule POST /rest/firewallrule
FirewallRuleApi delete_firewall_rule DELETE /rest/firewallrule/{id}
FirewallRuleApi get_firewall_rule GET /rest/firewallrule/{id}
FirewallRuleApi list_firewall_rule GET /rest/firewallrule
FirewallRuleApi update_firewall_rule PUT /rest/firewallrule/{id}
HeatMapApi create_heat_map POST /rest/heatmap
HeatMapApi delete_heat_map DELETE /rest/heatmap/{id}
HeatMapApi get_heat_map GET /rest/heatmap/{id}
HeatMapApi list_heat_map GET /rest/heatmap
HeatMapApi update_heat_map PUT /rest/heatmap/{id}
HeatMapPointApi create_heat_map_point POST /rest/heatmappoint
HeatMapPointApi delete_heat_map_point DELETE /rest/heatmappoint/{id}
HeatMapPointApi get_heat_map_point GET /rest/heatmappoint/{id}
HeatMapPointApi list_heat_map_point GET /rest/heatmappoint
HeatMapPointApi update_heat_map_point PUT /rest/heatmappoint/{id}
Hotspot2ConfApi create_hotspot2_conf POST /rest/hotspot2conf
Hotspot2ConfApi delete_hotspot2_conf DELETE /rest/hotspot2conf/{id}
Hotspot2ConfApi get_hotspot2_conf GET /rest/hotspot2conf/{id}
Hotspot2ConfApi list_hotspot2_conf GET /rest/hotspot2conf
Hotspot2ConfApi update_hotspot2_conf PUT /rest/hotspot2conf/{id}
HotspotOpApi create_hotspot_op POST /rest/hotspotop
HotspotOpApi delete_hotspot_op DELETE /rest/hotspotop/{id}
HotspotOpApi get_hotspot_op GET /rest/hotspotop/{id}
HotspotOpApi list_hotspot_op GET /rest/hotspotop
HotspotOpApi update_hotspot_op PUT /rest/hotspotop/{id}
HotspotPackageApi create_hotspot_package POST /rest/hotspotpackage
HotspotPackageApi delete_hotspot_package DELETE /rest/hotspotpackage/{id}
HotspotPackageApi get_hotspot_package GET /rest/hotspotpackage/{id}
HotspotPackageApi list_hotspot_package GET /rest/hotspotpackage
HotspotPackageApi update_hotspot_package PUT /rest/hotspotpackage/{id}
MapApi create_map POST /rest/map
MapApi delete_map DELETE /rest/map/{id}
MapApi get_map GET /rest/map/{id}
MapApi list_map GET /rest/map
MapApi update_map PUT /rest/map/{id}
MediaFileApi create_media_file POST /rest/mediafile
MediaFileApi delete_media_file DELETE /rest/mediafile/{id}
MediaFileApi get_media_file GET /rest/mediafile/{id}
MediaFileApi list_media_file GET /rest/mediafile
MediaFileApi update_media_file PUT /rest/mediafile/{id}
NetworkApi create_network POST /rest/networkconf
NetworkApi delete_network DELETE /rest/networkconf/{id}
NetworkApi get_network GET /rest/networkconf/{id}
NetworkApi list_network GET /rest/networkconf
NetworkApi update_network PUT /rest/networkconf/{id}
PortForwardApi create_port_forward POST /rest/portforward
PortForwardApi delete_port_forward DELETE /rest/portforward/{id}
PortForwardApi get_port_forward GET /rest/portforward/{id}
PortForwardApi list_port_forward GET /rest/portforward
PortForwardApi update_port_forward PUT /rest/portforward/{id}
PortProfileApi create_port_profile POST /rest/portconf
PortProfileApi delete_port_profile DELETE /rest/portconf/{id}
PortProfileApi get_port_profile GET /rest/portconf/{id}
PortProfileApi list_port_profile GET /rest/portconf
PortProfileApi update_port_profile PUT /rest/portconf/{id}
RADIUSProfileApi create_radius_profile POST /rest/radiusprofile
RADIUSProfileApi delete_radius_profile DELETE /rest/radiusprofile/{id}
RADIUSProfileApi get_radius_profile GET /rest/radiusprofile/{id}
RADIUSProfileApi list_radius_profile GET /rest/radiusprofile
RADIUSProfileApi update_radius_profile PUT /rest/radiusprofile/{id}
RoutingApi create_routing POST /rest/routing
RoutingApi delete_routing DELETE /rest/routing/{id}
RoutingApi get_routing GET /rest/routing/{id}
RoutingApi list_routing GET /rest/routing
RoutingApi update_routing PUT /rest/routing/{id}
ScheduleTaskApi create_schedule_task POST /rest/scheduletask
ScheduleTaskApi delete_schedule_task DELETE /rest/scheduletask/{id}
ScheduleTaskApi get_schedule_task GET /rest/scheduletask/{id}
ScheduleTaskApi list_schedule_task GET /rest/scheduletask
ScheduleTaskApi update_schedule_task PUT /rest/scheduletask/{id}
SettingAutoSpeedtestApi get_setting_auto_speedtest GET /get/setting/auto_speedtest
SettingAutoSpeedtestApi update_setting_auto_speedtest PUT /set/setting/auto_speedtest
SettingBaresipApi get_setting_baresip GET /get/setting/baresip
SettingBaresipApi update_setting_baresip PUT /set/setting/baresip
SettingBroadcastApi get_setting_broadcast GET /get/setting/broadcast
SettingBroadcastApi update_setting_broadcast PUT /set/setting/broadcast
SettingConnectivityApi get_setting_connectivity GET /get/setting/connectivity
SettingConnectivityApi update_setting_connectivity PUT /set/setting/connectivity
SettingCountryApi get_setting_country GET /get/setting/country
SettingCountryApi update_setting_country PUT /set/setting/country
SettingDohApi get_setting_doh GET /get/setting/doh
SettingDohApi update_setting_doh PUT /set/setting/doh
SettingDpiApi get_setting_dpi GET /get/setting/dpi
SettingDpiApi update_setting_dpi PUT /set/setting/dpi
SettingElementAdoptApi get_setting_element_adopt GET /get/setting/element_adopt
SettingElementAdoptApi update_setting_element_adopt PUT /set/setting/element_adopt
SettingEtherLightingApi get_setting_ether_lighting GET /get/setting/ether_lighting
SettingEtherLightingApi update_setting_ether_lighting PUT /set/setting/ether_lighting
SettingGlobalApApi get_setting_global_ap GET /get/setting/global_ap
SettingGlobalApApi update_setting_global_ap PUT /set/setting/global_ap
SettingGlobalSwitchApi get_setting_global_switch GET /get/setting/global_switch
SettingGlobalSwitchApi update_setting_global_switch PUT /set/setting/global_switch
SettingGuestAccessApi get_setting_guest_access GET /get/setting/guest_access
SettingGuestAccessApi update_setting_guest_access PUT /set/setting/guest_access
SettingIpsApi get_setting_ips GET /get/setting/ips
SettingIpsApi update_setting_ips PUT /set/setting/ips
SettingLcmApi get_setting_lcm GET /get/setting/lcm
SettingLcmApi update_setting_lcm PUT /set/setting/lcm
SettingLocaleApi get_setting_locale GET /get/setting/locale
SettingLocaleApi update_setting_locale PUT /set/setting/locale
SettingMagicSiteToSiteVpnApi get_setting_magic_site_to_site_vpn GET /get/setting/magic_site_to_site_vpn
SettingMagicSiteToSiteVpnApi update_setting_magic_site_to_site_vpn PUT /set/setting/magic_site_to_site_vpn
SettingMgmtApi get_setting_mgmt GET /get/setting/mgmt
SettingMgmtApi update_setting_mgmt PUT /set/setting/mgmt
SettingNetworkOptimizationApi get_setting_network_optimization GET /get/setting/network_optimization
SettingNetworkOptimizationApi update_setting_network_optimization PUT /set/setting/network_optimization
SettingNtpApi get_setting_ntp GET /get/setting/ntp
SettingNtpApi update_setting_ntp PUT /set/setting/ntp
SettingPortaApi get_setting_porta GET /get/setting/porta
SettingPortaApi update_setting_porta PUT /set/setting/porta
SettingRadioAiApi get_setting_radio_ai GET /get/setting/radio_ai
SettingRadioAiApi update_setting_radio_ai PUT /set/setting/radio_ai
SettingRadiusApi get_setting_radius GET /get/setting/radius
SettingRadiusApi update_setting_radius PUT /set/setting/radius
SettingRsyslogdApi get_setting_rsyslogd GET /get/setting/rsyslogd
SettingRsyslogdApi update_setting_rsyslogd PUT /set/setting/rsyslogd
SettingSnmpApi get_setting_snmp GET /get/setting/snmp
SettingSnmpApi update_setting_snmp PUT /set/setting/snmp
SettingSuperCloudaccessApi get_setting_super_cloudaccess GET /get/setting/super_cloudaccess
SettingSuperCloudaccessApi update_setting_super_cloudaccess PUT /set/setting/super_cloudaccess
SettingSuperEventsApi get_setting_super_events GET /get/setting/super_events
SettingSuperEventsApi update_setting_super_events PUT /set/setting/super_events
SettingSuperFwupdateApi get_setting_super_fwupdate GET /get/setting/super_fwupdate
SettingSuperFwupdateApi update_setting_super_fwupdate PUT /set/setting/super_fwupdate
SettingSuperIdentityApi get_setting_super_identity GET /get/setting/super_identity
SettingSuperIdentityApi update_setting_super_identity PUT /set/setting/super_identity
SettingSuperMailApi get_setting_super_mail GET /get/setting/super_mail
SettingSuperMailApi update_setting_super_mail PUT /set/setting/super_mail
SettingSuperMgmtApi get_setting_super_mgmt GET /get/setting/super_mgmt
SettingSuperMgmtApi update_setting_super_mgmt PUT /set/setting/super_mgmt
SettingSuperSdnApi get_setting_super_sdn GET /get/setting/super_sdn
SettingSuperSdnApi update_setting_super_sdn PUT /set/setting/super_sdn
SettingSuperSmtpApi get_setting_super_smtp GET /get/setting/super_smtp
SettingSuperSmtpApi update_setting_super_smtp PUT /set/setting/super_smtp
SettingTeleportApi get_setting_teleport GET /get/setting/teleport
SettingTeleportApi update_setting_teleport PUT /set/setting/teleport
SettingUsgApi get_setting_usg GET /get/setting/usg
SettingUsgApi update_setting_usg PUT /set/setting/usg
SettingUswApi get_setting_usw GET /get/setting/usw
SettingUswApi update_setting_usw PUT /set/setting/usw
SpatialRecordApi create_spatial_record POST /rest/spatialrecord
SpatialRecordApi delete_spatial_record DELETE /rest/spatialrecord/{id}
SpatialRecordApi get_spatial_record GET /rest/spatialrecord/{id}
SpatialRecordApi list_spatial_record GET /rest/spatialrecord
SpatialRecordApi update_spatial_record PUT /rest/spatialrecord/{id}
TagApi create_tag POST /rest/tag
TagApi delete_tag DELETE /rest/tag/{id}
TagApi get_tag GET /rest/tag/{id}
TagApi list_tag GET /rest/tag
TagApi update_tag PUT /rest/tag/{id}
UserApi create_user POST /rest/user
UserApi delete_user DELETE /rest/user/{id}
UserApi get_user GET /rest/user/{id}
UserApi list_user GET /rest/user
UserApi update_user PUT /rest/user/{id}
UserGroupApi create_user_group POST /rest/usergroup
UserGroupApi delete_user_group DELETE /rest/usergroup/{id}
UserGroupApi get_user_group GET /rest/usergroup/{id}
UserGroupApi list_user_group GET /rest/usergroup
UserGroupApi update_user_group PUT /rest/usergroup/{id}
VirtualDeviceApi create_virtual_device POST /rest/virtualdevice
VirtualDeviceApi delete_virtual_device DELETE /rest/virtualdevice/{id}
VirtualDeviceApi get_virtual_device GET /rest/virtualdevice/{id}
VirtualDeviceApi list_virtual_device GET /rest/virtualdevice
VirtualDeviceApi update_virtual_device PUT /rest/virtualdevice/{id}
WLANApi create_wlan POST /rest/wlanconf
WLANApi delete_wlan DELETE /rest/wlanconf/{id}
WLANApi get_wlan GET /rest/wlanconf/{id}
WLANApi list_wlan GET /rest/wlanconf
WLANApi update_wlan PUT /rest/wlanconf/{id}
WLANGroupApi create_wlan_group POST /rest/wlangroup
WLANGroupApi delete_wlan_group DELETE /rest/wlangroup/{id}
WLANGroupApi get_wlan_group GET /rest/wlangroup/{id}
WLANGroupApi list_wlan_group GET /rest/wlangroup
WLANGroupApi update_wlan_group PUT /rest/wlangroup/{id}

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

cookieAuth

  • Type: API key
  • API key parameter name: X-CSRF-TOKEN
  • Location: HTTP header

Author