Skip to content

Commit

Permalink
Make AXL TCP port a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nkallergis authored Jun 27, 2022
1 parent f3a78ef commit f37f20f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ciscoaxl/axl.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ class axl(object):
Python 3.6
"""

def __init__(self, username, password, cucm, cucm_version, strict_ssl=False):
def __init__(self, username, password, cucm, cucm_version, cucm_port=8443, strict_ssl=False):
"""
:param username: axl username
:param password: axl password
:param cucm: UCM IP address
:param cucm_version: UCM version
:param cucm_port: UCM TCP port
:param strict_ssl: do not work around an SSL failure, default False
example usage:
Expand All @@ -55,7 +56,7 @@ def __init__(self, username, password, cucm, cucm_version, strict_ssl=False):
session.auth = (username, password)

# validate session before assigning to Transport
url = f"https://{cucm}:8443/axl/"
url = f"https://{cucm}:{cucm_port}/axl/"
try:
ret_code = session.get(url, stream=True, timeout=10).status_code
except SSLError:
Expand Down Expand Up @@ -100,7 +101,7 @@ def __init__(self, username, password, cucm, cucm_version, strict_ssl=False):
)
self.client = axl_client.create_service(
"{http://www.cisco.com/AXLAPIService/}AXLAPIBinding",
f"https://{cucm}:8443/axl/",
f"https://{cucm}:{cucm_port}/axl/",
)

def get_locations(
Expand Down

0 comments on commit f37f20f

Please sign in to comment.