Skip to content
Merged

V1.4 #41

Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6424560
Added dict of cluster names & corresponding base_urls
Mar 13, 2024
32cd0c4
Added clusterBaseURL object
Mar 13, 2024
52f9eac
Updated parseInputArgs to accept cluster_name as URL input
Mar 13, 2024
c491a1b
Added func to verify that provided base_url has valid
Mar 13, 2024
f86affa
Update minimum supported python version
Mar 13, 2024
65e26f7
Updated minimum support python version
Mar 13, 2024
cab39a3
Fixed import bug
Mar 13, 2024
c313c20
Added check for customer_id
Mar 13, 2024
a4379a0
Updated create_full_wlan var name
Mar 18, 2024
e5fa0ff
Updated update_full_wlan var name
Mar 18, 2024
91b9ad4
Added msg to indicate the WLAN APIs are allowlisted log msg
Mar 18, 2024
ef08027
Added helper func for WLAN config updates
Mar 18, 2024
983bc5f
Added helper func for enable/disable WLANs
Mar 18, 2024
f7a59d8
Added enable & disable WLAN funcs
Mar 18, 2024
9e3aaf6
Added get_full_wlan func
Mar 18, 2024
c0e0f8a
Updated string messages
Apr 1, 2024
a4d0063
Updated valid_url func
Apr 1, 2024
58bda83
Updated print statements of configuration
Apr 1, 2024
a0f895a
Updated constants file with UAE cluster name
Apr 3, 2024
62744e7
Updated structure of sample token files
Apr 3, 2024
f4f6e73
Updated comments for base file
Apr 3, 2024
d77739a
Add sample files for cluster_name variable
Apr 3, 2024
fb50543
Added cluster_name relevant documentation to Readme
Apr 3, 2024
93405cc
Rollbackf of URL Utils
Apr 5, 2024
7eda8a3
Added helper functions of WLAN & AP Configuration
Apr 5, 2024
86a547d
Added new func for enable/disable WLAN
Apr 5, 2024
83badd8
full_wlan instead of v2
Apr 5, 2024
0d16131
Removed unnecessary imports
Apr 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added get_full_wlan func
  • Loading branch information
Karthik Satheesh Kumar committed Mar 18, 2024
commit 9e3aaf6365520ed55424bfcf538269189f4ae9e0
34 changes: 31 additions & 3 deletions pycentral/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import sys
from pycentral.url_utils import ConfigurationUrl, urlJoin
from pycentral.base_utils import console_logger
import json

urls = ConfigurationUrl()
DEVICE_TYPES = ["IAP", "ArubaSwitch", "CX", "MobilityController"]
Expand Down Expand Up @@ -1197,8 +1198,8 @@ def update_full_wlan(self, conn, group_name, wlan_name, wlan_data):

def get_wlan(self, conn, group_name, wlan_name):
"""
Gets full configuration of a WLAN in a Central group.

Gets configuration of a WLAN in a Central UI group
using the v2 WLAN API.
:param conn: Instance of class:`pycentral.ArubaCentralBase` to make an
API call.
:type conn: class:`pycentral.ArubaCentralBase`
Expand All @@ -1211,11 +1212,38 @@ def get_wlan(self, conn, group_name, wlan_name):
`pycentral.ArubaCentralBase`.
:rtype: dict
"""

path = urlJoin(urls.WLAN["GET"], group_name, wlan_name)
resp = conn.command(apiMethod="GET", apiPath=path)
return resp

def get_full_wlan(self, conn, group_name, wlan_name):
"""
Get the full configuration, using the full_wlan endpoint
"/configuration/full_wlan/", of a WLAN. This configuration is useful
for complex configuration changes

: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 which has the WLAN
:type group_name: str
:param wlan_name: Name of WLAN whose configuration has to be returned
:type wlan_name: str

:return: Full WLAN Configuration of WLAN
:rtype: dict
"""
path = urlJoin(urls.WLAN["FULL_WLAN"], group_name, wlan_name)
resp = conn.command(apiMethod="GET", apiPath=path)

if resp['code'] == 200:
json_object = json.loads(resp['msg'])
return json_object
else:
logger.error(
f'Response code - {resp["code"]}.\n Response message - {resp["msg"]}')
return resp

def get_all_wlans(self, conn, group_name):
"""
Gets a list of each wlan in a Central group.
Expand Down