X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2common%2Fconfig%2Fconfig.py;h=b0d3c0f420522ddfd388d526610564ce7190f8a8;hb=defe8209b3628593c186487857fe02586d7e1503;hp=2849e49d5899b43fde3962298c24903b15ef0969;hpb=c3ab2dcb442a0e66b7a621c59c6c7a679c26cee9;p=pti%2Fo2.git diff --git a/o2common/config/config.py b/o2common/config/config.py index 2849e49..b0d3c0f 100644 --- a/o2common/config/config.py +++ b/o2common/config/config.py @@ -28,8 +28,15 @@ def get_postgres_uri(): def get_api_url(): - host = os.environ.get("API_HOST", "localhost") - port = 5005 if host == "localhost" else 80 + host_interal = os.environ.get("API_HOST", "localhost") + host_external = os.environ.get("API_HOST_EXTERNAL_FLOATING") + host = host_interal if host_external is None or host_external == '' \ + else host_external + + port_internal = 5005 if host == "localhost" else 80 + port_external = 30205 + port = port_internal if host_external is None or host_external == '' \ + else port_external return f"http://{host}:{port}" @@ -41,8 +48,12 @@ def get_o2ims_api_base(): return get_root_api_base() + 'o2ims_infrastructureInventory/v1' +def get_provision_api_base(): + return get_root_api_base() + 'provision/v1' + + def get_o2dms_api_base(): - return get_root_api_base() + "o2dms" + return get_root_api_base() + "o2dms/v1" def get_redis_host_and_port(): @@ -91,3 +102,14 @@ def get_stx_access_info(): os_client_args['os_region_name'] = 'RegionOne' os_client_args['api_version'] = 1 return os_client_args + + +def get_k8s_api_endpoint(): + K8S_KUBECONFIG = os.environ.get("K8S_KUBECONFIG", None) + K8S_APISERVER = os.environ.get("K8S_APISERVER", None) + K8S_TOKEN = os.environ.get("K8S_TOKEN", None) + return K8S_KUBECONFIG, K8S_APISERVER, K8S_TOKEN + + +def get_helm_cli(): + return '/usr/local/bin/helm'