2 # -*- coding: utf-8 -*-
3 # SPDX-License-Identifier: Apache-2.0
4 """Oran A1 Simulator module."""
6 from onapsdk.onap_service import OnapService
8 class A1sim(OnapService):
9 """Oran A1 Simulator library."""
12 def check_version(cls, base_url) -> str:
17 base_url: the base url of the ric
23 url = f"{base_url}/counter/interface"
24 version = cls.send_message('GET',
30 def check_status(cls, url) -> str:
35 url: the url of the ric
42 status = cls.send_message('GET',
48 def get_policy_number(cls, url) -> str:
50 Policy numbers for ric.
53 url: the url of the ric
56 the policy numbers for ric
59 url = f"{url}/counter/num_instances"
60 policy_number = cls.send_message('GET',
61 'Get policy numbers for ric',
66 def create_policy_type(cls,
69 policy_type_data) -> None:
71 Create topic in Dmaap.
74 url: the url of the ric
75 policy_type_num: the policy type id
76 policy_type_data: the policy type data in binary format
79 url = f"{url}/policytype?id={policy_type_id}"
80 cls.send_message('PUT',
83 data=policy_type_data,
84 headers={"Accept":"application/json", "Content-Type":"application/json"})