diff --git a/sailpoint/configuration.py b/sailpoint/configuration.py index 571a772de..d5ca8551b 100644 --- a/sailpoint/configuration.py +++ b/sailpoint/configuration.py @@ -6,7 +6,6 @@ import os import ssl import sys - import urllib3 SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} @@ -28,6 +27,7 @@ class ConfigurationParams: client_secret = None token_url = None access_token = None + nerm_base_url = None ssl_ca_cert = None proxy = None proxy_headers = None @@ -45,6 +45,11 @@ def __init__(self, configurationParams: ConfigurationParams = None) -> None: self.proxy = configurationParams.proxy if configurationParams and configurationParams.proxy else None self.proxy_headers = configurationParams.proxy_headers if configurationParams and configurationParams.proxy_headers else None self.verify_ssl = configurationParams.verify_ssl if configurationParams and configurationParams.verify_ssl else True + self.nerm_base_url = ( + configurationParams.nerm_base_url + if configurationParams and configurationParams.nerm_base_url is not None + else defaultConfiguration.nerm_base_url + ) url = f"{self.token_url}" if self.access_token == None: @@ -163,6 +168,11 @@ def get_environment_params(self) -> ConfigurationParams: else None ) config.token_url = str(config.base_url) + "/oauth/token" + config.nerm_base_url = ( + os.environ.get("SAIL_NERM_BASE_URL") + if os.environ.get("SAIL_NERM_BASE_URL") + else None + ) return config @@ -177,6 +187,7 @@ def get_local_params(self) -> ConfigurationParams: config.client_id = data["ClientId"] config.client_secret = data["ClientSecret"] config.token_url = config.base_url + "/oauth/token" + config.nerm_base_url = data.get("NermBaseUrl") return config diff --git a/sdk-resources/nerm-config.yaml b/sdk-resources/nerm-config.yaml new file mode 100644 index 000000000..ee6996ea9 --- /dev/null +++ b/sdk-resources/nerm-config.yaml @@ -0,0 +1,18 @@ +templateDir: ./sdk-resources/resources +packageName: sailpoint.nerm +packageVersion: 1.4.1 +apiVersion: +generateSourceCodeOnly: true +functionPrefix: +subModuleName: +nerm: true +files: + developerSite_code_examples.mustache: + templateType: SupportingFiles + destinationFilename: sailpoint/nerm/docs/Examples/python_code_examples_overlay.yaml + docs_methods_index.mustache: + templateType: SupportingFiles + destinationFilename: sailpoint/nerm/docs/Methods/Index.md + docs_models_index.mustache: + templateType: SupportingFiles + destinationFilename: sailpoint/nerm/Index.md diff --git a/sdk-resources/resources/api_client.mustache b/sdk-resources/resources/api_client.mustache index 4099d3052..76bc9694d 100644 --- a/sdk-resources/resources/api_client.mustache +++ b/sdk-resources/resources/api_client.mustache @@ -255,7 +255,12 @@ class ApiClient: # request url if _host is None: + {{#nerm}} + url = self.configuration.nerm_base_url + '/' + resource_path + {{/nerm}} + {{^nerm}} url = self.configuration.base_url + '/{{apiVersion}}' + resource_path + {{/nerm}} else: # use server/host defined in path or operation instead url = _host + resource_path