2 # -*- coding: utf-8 -*-
3 # SPDX-License-Identifier: Apache-2.0
4 """Onap Sdnc module."""
6 from typing import Dict
7 from oransdk.configuration import settings
8 from onapsdk.sdnc.sdnc_element import SdncElement
10 class OranSdnc(SdncElement):
13 base_url = settings.SDNC_URL
16 def get_status(cls) -> str:
18 Get status of SDNC component.
21 the status of the SDNC component
24 url = f"{cls.base_url}/apidoc/explorer/"
25 status = cls.send_message('GET',
26 'Get status of SDNC component',
31 def get_odu_oru_status(cls,
34 basic_auth: Dict[str, str]) -> dict:
36 Get status of SDNC component.
39 basic_auth: (Dict[str, str]) for example:{ 'username': 'bob', 'password': 'secret' }
42 the status of the SDNC component
45 url = f"{cls.base_url}/rests/data/network-topology:network-topology/"\
46 + f"topology=topology-netconf/node={odu_node}/yang-ext:mount/"\
47 + f"o-ran-sc-du-hello-world:network-function/du-to-ru-connection={oru_node}"
48 status = cls.send_message_json('GET',
49 'Get status of Odu Oru connectivity',
51 basic_auth=basic_auth)