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