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 clusterBaseURL object
  • Loading branch information
Karthik Satheesh Kumar committed Mar 13, 2024
commit 32cd0c4f38e85cad21d9076000f806b0a73328a4
37 changes: 37 additions & 0 deletions pycentral/base_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,43 @@
"token": None
}

URL_BASE_ERR_MESSAGE = "Please provide either the base_url of API Gateway or a valid cluster_name of cluster where Central account is provisioned!"


class clusterBaseURL(object):
"""This class helps to fetch the API Base URL when Aruba Central cluster
name is provided.
"""

def getBaseURL(self, cluster_name):
"""This method returns the API Base URL of the provided Aruba Central\
cluster.

:param cluster_name: Name of the Aruba Central cluster whose base_url\
needs to be returned
:type cluster_name: str
:return: Base URL of provided cluster
:rtype: str
"""
if cluster_name in CLUSTER_API_BASE_URL_LIST:
return f'https://{CLUSTER_API_BASE_URL_LIST[cluster_name]}'
else:
errorMessage = f"Unable to find cluster_name - {cluster_name}.\n"
+ URL_BASE_ERR_MESSAGE
raise ValueError(errorMessage)

def getAllBaseURLs(self):
"""This method returns the list of base URLs of all the clusters of\
Aruba Central

:return: List of all valid base URLs of Aruba Central
:rtype: list
"""
return list(CLUSTER_API_BASE_URL_LIST.values())


c = clusterBaseURL()


def parseInputArgs(central_info):
"""This method parses user input, checks for the availability of mandatory\
Expand Down