X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=mock_smo%2Fmock_smo%2Fconfig.py;fp=mock_smo%2Fmock_smo%2Fconfig.py;h=ab5d60788ea7f67a1cfec9f698a030833f1806c4;hb=9625c5b766377f641d9641471f10dd491a61447f;hp=0000000000000000000000000000000000000000;hpb=d14329a57d8d01d443e4158fa5030a5b5ada4060;p=pti%2Fo2.git diff --git a/mock_smo/mock_smo/config.py b/mock_smo/mock_smo/config.py new file mode 100644 index 0000000..ab5d607 --- /dev/null +++ b/mock_smo/mock_smo/config.py @@ -0,0 +1,48 @@ +# Copyright (C) 2021 Wind River Systems, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import mock_smo.logging as logging +logger = logging.get_logger(__name__) + + +def get_mock_smo_api_url(): + host = os.environ.get("API_HOST", "localhost") + port = 5001 if host == "localhost" else 80 + return f"http://{host}:{port}" + + +def get_root_api_base(): + return "/" + + +def get_o2ims_api_base(): + return get_root_api_base() + 'o2ims_infrastructureInventory/v1' + + +def get_o2dms_api_base(): + return get_root_api_base() + "o2dms" + + +def get_redis_host_and_port(): + host = os.environ.get("REDIS_HOST", "localhost") + port = 63792 if host == "localhost" else 6379 + return dict(host=host, port=port) + + +def get_smo_o2endpoint(): + smo_o2endpoint = os.environ.get( + "SMO_O2_ENDPOINT", "http://localhost/smo_sim") + return smo_o2endpoint