X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2common%2Fconfig%2Fconfig.py;fp=o2common%2Fconfig%2Fconfig.py;h=b0d3c0f420522ddfd388d526610564ce7190f8a8;hb=330e15935177e9d9e8442eb67354f9122f2871b1;hp=8a869da9eca8e1954621d41e6c58df238e29494e;hpb=955e499773dcfd80e2b5497d3cb1b38c9ae294eb;p=pti%2Fo2.git diff --git a/o2common/config/config.py b/o2common/config/config.py index 8a869da..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}" @@ -46,7 +53,7 @@ def get_provision_api_base(): def get_o2dms_api_base(): - return get_root_api_base() + "o2dms" + return get_root_api_base() + "o2dms/v1" def get_redis_host_and_port():