From 836848724094f8ae98c31c886ca827a41a366b21 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 20 Jan 2022 17:05:04 -0500 Subject: [Enterprise] APIs for get/set server url --- python/enterprise.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'python') diff --git a/python/enterprise.py b/python/enterprise.py index 1d9743a1..18062153 100644 --- a/python/enterprise.py +++ b/python/enterprise.py @@ -110,6 +110,25 @@ def token() -> Optional[str]: return value +def server_url() -> str: + """ + Get the url of the Enterprise Server. + :return: The current url + """ + return core.BNGetEnterpriseServerUrl() + + +def set_server_url(url: str): + """ + Set the url of the Enterprise Server. + .. note:: This will raise an Exception if the server is already initialized + + :param url: New Enterprise Server url + """ + if not core.BNSetEnterpriseServerUrl(url): + raise RuntimeError(last_error()) + + def server_name() -> Optional[str]: """ Get the display name of the currently connected server @@ -230,6 +249,14 @@ def last_error() -> str: return core.BNGetEnterpriseServerLastError() +def is_initialized() -> bool: + """ + Determine if the Enterprise Client has been initialized yet. + :return: True if any other Enterprise methods have been called + """ + return core.BNIsEnterpriseServerInitialized() + + class LicenseCheckout: """ Helper class for scripts to make use of a license checkout in a scope. -- cgit v1.3.1