X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2common%2Fconfig%2Fconfig.py;h=b0d3c0f420522ddfd388d526610564ce7190f8a8;hb=330e15935177e9d9e8442eb67354f9122f2871b1;hp=55d475506c25ec90c02ebfd40c75930e44910eea;hpb=5e02e76308e1677fb106572b885a366eb6c0fbec;p=pti%2Fo2.git diff --git a/o2common/config/config.py b/o2common/config/config.py index 55d4755..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,6 +48,10 @@ 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/v1" @@ -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'