fix: get alarms from NFs

This commit is contained in:
simonzhangsz committed 2023-10-24 18:52:38 +08:00
1 parent bcec4e13ae
commit 22e53ea20f
2 files changed
+16 -7

No files matched your search

+15 -6
View File
@@ -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)
+1 -1
View File
@@ -35,7 +35,7 @@ case "$1" in
done
;;
*)
echo "OMC"
echo "OMC service"
echo "Usage: $0 start|status|stop|restart|version"
;;
esac