diff --git a/nimbleclient/__init__.py b/nimbleclient/__init__.py index cea4b68..a5800c7 100644 --- a/nimbleclient/__init__.py +++ b/nimbleclient/__init__.py @@ -12,7 +12,7 @@ ) # Version for NimbleOS SDK client package -__version__ = "2.0.0" +__version__ = "1.2.1" __all__ = [ "v1", diff --git a/nimbleclient/v1/client.py b/nimbleclient/v1/client.py index 3453732..8861c63 100644 --- a/nimbleclient/v1/client.py +++ b/nimbleclient/v1/client.py @@ -59,8 +59,8 @@ class NimOSClient: """Nimble client for NimOS v1 REST API.""" - def __init__(self, hostname, username, password, job_timeout=60, port=5392): - self._client = NimOSAPIClient(hostname, username, password, job_timeout, port) + def __init__(self, hostname, username, password, app_name=None, job_timeout=60, port=5392): + self._client = NimOSAPIClient(hostname, username, password, app_name, job_timeout, port) @property def access_control_records(self): diff --git a/nimbleclient/v1/restclient.py b/nimbleclient/v1/restclient.py index 26a5c81..23e28e3 100644 --- a/nimbleclient/v1/restclient.py +++ b/nimbleclient/v1/restclient.py @@ -76,7 +76,7 @@ class NimOSAPIClient: 'witnesses': 'v1/witnesses', } - def __init__(self, hostname, username, password, job_timeout=60, port=5392): + def __init__(self, hostname, username, password, app_name=None, job_timeout=60, port=5392): """Initialize a session to the NimOS REST API.""" connection_hash = str(uuid.uuid3(uuid.NAMESPACE_OID, f'{hostname}{port}{username}{password}')) @@ -85,11 +85,18 @@ def __init__(self, hostname, username, password, job_timeout=60, port=5392): self.port = port self.job_timeout = job_timeout + if app_name is None: + self.app_info = f'NimOS Python SDK v{__version__}' + else: + self.app_info = app_name + + logging.debug(f"Instantiating NimOS client for App '{self.app_info}'") + self.__auth = { 'data': { 'username': username, 'password': password, - 'app_name': f'NimOS Python SDK v{__version__}' + 'app_name': self.app_info } } logging.debug(f"NimOSAPIClient created with [hostname: {hostname}], [job_timeout: {job_timeout} seconds], [port: {port}], [SDK Version: v{__version__}]")