fix: get alarms from NFs
This commit is contained in:
@@ -491,15 +491,24 @@ func GetAlarmFromNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
//services.ResponseInternalServerError500ProcessError(w, err)
|
//services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alarmArray := new([]Alarm)
|
||||||
|
switch response.StatusCode() {
|
||||||
|
case http.StatusOK, http.StatusCreated, http.StatusNoContent, http.StatusAccepted:
|
||||||
body := response.Body()
|
body := response.Body()
|
||||||
log.Debug("Request body:", string(body))
|
log.Debug("Request body:", string(body))
|
||||||
alarmArray := new([]Alarm)
|
|
||||||
err = json.Unmarshal(body, &alarmArray)
|
err = json.Unmarshal(body, &alarmArray)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed to Unmarshal:", err)
|
log.Error("Failed to Unmarshal:", err)
|
||||||
//services.ResponseInternalServerError500ProcessError(w, err)
|
//services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
log.Error("Failed to get alarms:", response.Status)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
valueJson, err := dborm.XormGetAAConfig()
|
valueJson, err := dborm.XormGetAAConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed to XormGetAAConfig:", err)
|
log.Error("Failed to XormGetAAConfig:", err)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ case "$1" in
|
|||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "OMC"
|
echo "OMC service"
|
||||||
echo "Usage: $0 start|status|stop|restart|version"
|
echo "Usage: $0 start|status|stop|restart|version"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user