1 # Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved.
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.
15 # ==================================================================================
18 from ricxappframe.xapp_frame import RMRXapp
19 from ..utils.constants import Constants
20 from ._BaseHandler import _BaseHandler
21 # from ..manager import SdlAlarmManager
24 class HealthCheckHandler(_BaseHandler):
26 def __init__(self, rmr_xapp: RMRXapp, msgtype):
27 super().__init__(rmr_xapp, msgtype)
28 # self.sdl_alarm_mgr = SdlAlarmManager()
30 def request_handler(self, rmr_xapp, summary, sbuf):
31 ok = self._rmr_xapp.healthcheck()
32 # self.sdl_alarm_mgr.checkSdl()
36 payload = b"ERROR [RMR or SDL is unhealthy]\n"
37 self._rmr_xapp.rmr_rts(sbuf, new_payload=payload, new_mtype=Constants.RIC_HEALTH_CHECK_RESP)
38 self._rmr_xapp.rmr_free(sbuf)