Added A1 policy handler, healthcheck handler, sdl handler and alarm
[ric-app/hw-python.git] / src / manager / A1PolicyManager.py
1 # ==================================================================================
2 #
3 #       Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved.
4 #
5 #   Licensed under the Apache License, Version 2.0 (the "License");
6 #   you may not use this file except in compliance with the License.
7 #   You may obtain a copy of the License at
8 #
9 #          http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #   Unless required by applicable law or agreed to in writing, software
12 #   distributed under the License is distributed on an "AS IS" BASIS,
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #   See the License for the specific language governing permissions and
15 #   limitations under the License.
16 #
17 # ==================================================================================
18
19 import json
20 from ricxappframe.xapp_frame import RMRXapp, rmr
21 from ..utils.constants import Constants
22 from ._BaseManager import _BaseManager
23
24
25 class A1PolicyManager(_BaseManager):
26
27     def __init__(self, rmr_xapp: RMRXapp):
28         super().__init__(rmr_xapp)
29
30     def startup(self):
31         policy_query = '{"policy_type_id":"' + str(Constants.HELLOWORLD_POLICY_ID) + '"}'
32         self._rmr_xapp.rmr_send(policy_query.encode(), Constants.A1_POLICY_QUERY)
33         self.logger.info("A1PolicyManager.startup:: Sent A1 policy query = " + policy_query)
34