1 # Copyright (C) 2021 Wind River Systems, Inc.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 import mock_smo.logging as logging
18 logger = logging.get_logger(__name__)
21 def get_mock_smo_api_url():
22 host = os.environ.get("API_HOST", "localhost")
23 port = 5001 if host == "localhost" else 80
24 return f"http://{host}:{port}"
27 def get_root_api_base():
31 def get_o2ims_api_base():
32 return get_root_api_base() + 'o2ims_infrastructureInventory/v1'
35 def get_o2dms_api_base():
36 return get_root_api_base() + "o2dms"
39 def get_redis_host_and_port():
40 host = os.environ.get("REDIS_HOST", "localhost")
41 port = 63792 if host == "localhost" else 6379
42 return dict(host=host, port=port)
45 def get_smo_o2endpoint():
46 smo_o2endpoint = os.environ.get(
47 "SMO_O2_ENDPOINT", "http://localhost/smo_sim")