fix: ne info status in 0,3
This commit is contained in:
@@ -117,7 +117,7 @@ func XormGetAllNeInfo(nes *[]NeInfo) (*[]NeInfo, error) {
|
||||
log.Debug("XormGetAllNeInfo processing... ")
|
||||
|
||||
ne := new(NeInfo)
|
||||
rows, err := dbClient.xEngine.Table("ne_info").Where("status='0'").Rows(ne)
|
||||
rows, err := dbClient.xEngine.Table("ne_info").Where("status in ('0','3')").Rows(ne)
|
||||
if err != nil {
|
||||
log.Error("Failed to get table ne_info from database:", err)
|
||||
return nil, err
|
||||
|
||||
@@ -48,9 +48,9 @@ func GetParamConfigFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
getNeInfoURI := restHostPort + getNeInfoPattern
|
||||
neId := services.GetUriParamString(r, "ne_id", ",", true, true)
|
||||
if neId == "" {
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status='0'+and+ne_type='%s'", neType)
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status in ('0','3')+and+ne_type='%s'", neType)
|
||||
} else {
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status='0'+and+ne_type='%v'+and+ne_id+in+%v", neType, neId)
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status in ('0','3')+and+ne_type='%v'+and+ne_id+in+%v", neType, neId)
|
||||
}
|
||||
log.Debug("getNeInfoURI:", getNeInfoURI)
|
||||
|
||||
|
||||
@@ -750,7 +750,7 @@ func GetStateFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
restHostPort := fmt.Sprintf("http://127.0.0.1:%d", config.GetYamlConfig().Rest[0].Port)
|
||||
getNeInfoPattern := fmt.Sprintf(config.DefaultUriPrefix+"/databaseManagement/v1/elementType/%s/objectType/ne_info",
|
||||
config.GetYamlConfig().Database.Name)
|
||||
getNeInfoURI := restHostPort + getNeInfoPattern + "?WHERE=status='0'"
|
||||
getNeInfoURI := restHostPort + getNeInfoPattern + "?WHERE=status in ('0','3')"
|
||||
log.Debug("getNeInfoPattern:", getNeInfoPattern)
|
||||
|
||||
resp, err := client.R().
|
||||
@@ -774,9 +774,9 @@ func GetStateFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
getNeInfoURI := restHostPort + getNeInfoPattern
|
||||
neId := services.GetUriParamString(r, "ne_id", ",", true, true)
|
||||
if neId == "" {
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status='0'+and+ne_type='%s'", neType)
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status in ('0','3')+and+ne_type='%s'", neType)
|
||||
} else {
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status='0'+and+ne_type='%v'+and+ne_id+in+%v", neType, neId)
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status in ('0','3')+and+ne_type='%v'+and+ne_id+in+%v", neType, neId)
|
||||
}
|
||||
log.Debug("getNeInfoURI:", getNeInfoURI)
|
||||
|
||||
@@ -886,7 +886,7 @@ func GetEMSState(ip string) *SysState {
|
||||
OsInfo: getUnameStr(),
|
||||
DbInfo: "mysql Ver 15.1 Distrib 10.3.35-MariaDB, for Linux (aarch64) using readline 5.1",
|
||||
IpAddr: []string{ip},
|
||||
Port: 3030,
|
||||
Port: config.GetYamlConfig().Rest[0].Port,
|
||||
Version: version,
|
||||
Capability: 9999999,
|
||||
SerialNum: config.GetYamlConfig().OMC.Sn,
|
||||
|
||||
@@ -222,7 +222,7 @@ func XormGetNeInfoByRmUID(neType string, rmUID string) (*NeInfo, error) {
|
||||
log.Error("Failed to get table ne_info from database:", err)
|
||||
return nil, err
|
||||
} else if !has {
|
||||
log.Infof("Not found ne_info from database, status='0', neType=%s, neId=%s", neType, rmUID)
|
||||
log.Infof("Not found ne_info from database, status in ('0','3'), neType=%s, neId=%s", neType, rmUID)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user