Skip to content
Next Next commit
Added WLAN url info and configuration class.
WLAN url definitions to the configurationUrl class.  wlan API functions added to new wlan class in configuration.py.
  • Loading branch information
Collin-Koss committed Jun 21, 2023
commit 326dcb899df4f0082a2cc53e4ec6aaea9a47d9e2
38 changes: 38 additions & 0 deletions pycentral/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,3 +811,41 @@ def update_ap_settings(self, conn, serial_number: str, ap_settings_data: dict):
data = ap_settings_data
resp = conn.command(apiMethod="POST", apiPath=path, apiData=data)
return resp


class WLAN(object):
"""A python class consisting of functions to manage Aruba Central WLANs
via REST API.
"""
def create_wlan(self, conn, group_name, wlan_name, wlan_data):
"""Create new WLAN

:param conn: Instance of class:`pycentral.ArubaCentralBase` to make an
API call.
:type conn: class:`pycentral.ArubaCentralBase
:param group_name: Name of Aruba Central group to create new WLAN
inside.
:type group_name: str
:param wlan_name: Name string for new WLAN
:type wlan_name: str
:param wlan_data: Data to create new WLAN
* keyword hostname: Name string to set to the AP \n
* keyword essid:
* keyword type:
* keyword hide_ssid:
* keyword vlan:
* keyword zone:
* keyword wpa_passphrase:
* keyword wpa_passphrase_changed:
* keyword is_locked:
* keyword captive_profile_name:
* keyword bandwidth_limit_up:
* keyword bandwidth_limit_down:
* keyword bandwidth_limit_peruser_up:
* keyword bandwidth_limit_peruser_down:
* keyword access_rules:
:type ap_settings_data: dict
"""
path = urlJoin(urls.WLAN["CREATE"], group_name, wlan_name)
resp = conn.command(apiMethod="POST", apiPath=path, apiDate=wlan_data)
return resp
4 changes: 4 additions & 0 deletions pycentral/url_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class ConfigurationUrl():
"REPLACE_ALL": "/configuration/v1/devices/template_variables"
}

WLAN = {
"CREATE": "/configuration/v2/wlan"
}

class LicensingUrl():
SUBSCRIPTIONS = {
"GET_KEYS": "/platform/licensing/v1/subscriptions",
Expand Down