diff --git a/orionsdk/__init__.py b/orionsdk/__init__.py index f6ffb2c..e426a32 100644 --- a/orionsdk/__init__.py +++ b/orionsdk/__init__.py @@ -16,4 +16,4 @@ from .solarwinds import SolarWinds -__version__ = "0.3.0" +__version__ = "0.4.0" diff --git a/orionsdk/solarwinds.py b/orionsdk/solarwinds.py index 9fa5c1b..76e8089 100644 --- a/orionsdk/solarwinds.py +++ b/orionsdk/solarwinds.py @@ -4,6 +4,7 @@ The following class is used to create an object representing a SolarWinds Orion instance. The object provides simple getter and setter methods for common SolarWinds actions. These methods abstract out the underlying details and SWQL calls making SolarWinds automation more accessible to a broader audience. +Pass in port 17778 for pre-2023.1 Orion Platform. """ @@ -13,12 +14,12 @@ class SolarWinds: - def __init__(self, npm_server, username, password, logger=None): - + def __init__(self, npm_server, username, password, logger=None, port=17774): + self.logger = logger or logging.getLogger('__name__') # Create the SWIS client for use throughout the instance. - self.swis = SwisClient(npm_server, username, password) + self.swis = SwisClient(npm_server, username, password, port) def does_node_exist(self, node_name): """ Checks to see if a SolarWinds node exists with the given name. Calls the get_node_id method of the class diff --git a/orionsdk/swisclient.py b/orionsdk/swisclient.py index 13cfa9d..4f72300 100644 --- a/orionsdk/swisclient.py +++ b/orionsdk/swisclient.py @@ -11,7 +11,7 @@ def _json_serial(obj): class SwisClient: - def __init__(self, hostname, username, password, port=17778, verify=False, session=None): + def __init__(self, hostname, username, password, port=17774, verify=False, session=None): self.url = "https://{}:{}/SolarWinds/InformationService/v3/Json/".\ format(hostname, port) self._session = session or requests.Session() diff --git a/setup.py b/setup.py index 072f51e..adcf6e9 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name="orionsdk", - version="0.3.0", # Update also in __init__ ; + version="0.4.0", # Update also in __init__ ; description="Python API for the SolarWinds Orion SDK", long_description="Python client for interacting with the SolarWinds Orion API", author="SolarWinds",