Skip to content

Commit f90c6e2

Browse files
change client REST port to 17774
adjust SolarWinds class to be able to override port for changes to main OrionSDK and rationale behind the change see solarwinds/OrionSDK#333 (review)
1 parent 8157f80 commit f90c6e2

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

orionsdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
from .solarwinds import SolarWinds
1717

1818

19-
__version__ = "0.3.0"
19+
__version__ = "0.4.0"

orionsdk/solarwinds.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
The following class is used to create an object representing a SolarWinds Orion instance. The object provides simple
55
getter and setter methods for common SolarWinds actions. These methods abstract out the underlying details and SWQL
66
calls making SolarWinds automation more accessible to a broader audience.
7+
Pass in port 17778 for pre-2023.1 Orion Platform.
78
89
"""
910

@@ -13,12 +14,12 @@
1314

1415
class SolarWinds:
1516

16-
def __init__(self, npm_server, username, password, logger=None):
17-
17+
def __init__(self, npm_server, username, password, logger=None, port=17774):
18+
1819
self.logger = logger or logging.getLogger('__name__')
1920

2021
# Create the SWIS client for use throughout the instance.
21-
self.swis = SwisClient(npm_server, username, password)
22+
self.swis = SwisClient(npm_server, username, password, port)
2223

2324
def does_node_exist(self, node_name):
2425
""" Checks to see if a SolarWinds node exists with the given name. Calls the get_node_id method of the class

orionsdk/swisclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def _json_serial(obj):
1111

1212

1313
class SwisClient:
14-
def __init__(self, hostname, username, password, port=17778, verify=False, session=None):
14+
def __init__(self, hostname, username, password, port=17774, verify=False, session=None):
1515
self.url = "https://{}:{}/SolarWinds/InformationService/v3/Json/".\
1616
format(hostname, port)
1717
self._session = session or requests.Session()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name="orionsdk",
14-
version="0.3.0", # Update also in __init__ ;
14+
version="0.4.0", # Update also in __init__ ;
1515
description="Python API for the SolarWinds Orion SDK",
1616
long_description="Python client for interacting with the SolarWinds Orion API",
1717
author="SolarWinds",

0 commit comments

Comments
 (0)