diff --git a/features/cm/ne.go b/features/cm/ne.go index da6d993b..665c3f8f 100644 --- a/features/cm/ne.go +++ b/features/cm/ne.go @@ -167,7 +167,7 @@ func PostNeInfo(w http.ResponseWriter, r *http.Request) { } else { hostUri := global.CombineHostUri(neInfo.Ip, neInfo.Port) //hostUri := fmt.Sprintf("http://%s:%v", neInfo.Ip, neInfo.Port) - apiUri := fmt.Sprintf("%s/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig", config.DefaultUriPrefix, strings.ToLower(neInfo.NeType)) + apiUri := fmt.Sprintf("%s/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig?ne_id=%s", config.DefaultUriPrefix, strings.ToLower(neInfo.NeType), neInfo.NeId) requestURI2NF := fmt.Sprintf("%s%s", hostUri, apiUri) log.Debug("requestURI2NF:", requestURI2NF) @@ -277,7 +277,7 @@ func PutNeInfo(w http.ResponseWriter, r *http.Request) { } else { hostUri := global.CombineHostUri(neInfo.Ip, neInfo.Port) //hostUri := fmt.Sprintf("http://%s:%v", neInfo.Ip, neInfo.Port) - apiUri := fmt.Sprintf("%s/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig", config.DefaultUriPrefix, neTypeLower) + apiUri := fmt.Sprintf("%s/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig?ne_id=%s", config.DefaultUriPrefix, neTypeLower, neInfo.NeId) requestURI2NF := fmt.Sprintf("%s%s", hostUri, apiUri) log.Debug("requestURI2NF:", requestURI2NF) diff --git a/features/cm/param.go b/features/cm/param.go index 848844bf..6ba6ccdb 100644 --- a/features/cm/param.go +++ b/features/cm/param.go @@ -42,7 +42,7 @@ func GetParamConfigFromNF(w http.ResponseWriter, r *http.Request) { neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(neType, neId) var response services.DataResponse - if neInfo.NeId == neId { + if neInfo.NeId == neId && neInfo.NeId != "" { requestURI2NF := fmt.Sprintf("http://%s:%v%s", neInfo.IP, neInfo.Port, r.RequestURI) log.Debug("requestURI2NF:", requestURI2NF) @@ -78,7 +78,7 @@ func PostParamConfigToNF(w http.ResponseWriter, r *http.Request) { neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(neType, neId) - if neInfo.NeId != neId { + if neInfo.NeId != neId || neInfo.NeId == "" { log.Error("neId is empty") services.ResponseInternalServerError500DatabaseOperationFailed(w) return @@ -130,7 +130,7 @@ func PutParamConfigToNF(w http.ResponseWriter, r *http.Request) { neId := ctx.GetQuery(r, "ne_id") neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(neType, neId) - if neInfo.NeId != neId { + if neInfo.NeId != neId || neInfo.NeId == "" { log.Error("neId is empty") services.ResponseInternalServerError500DatabaseOperationFailed(w) return @@ -183,7 +183,7 @@ func DeleteParamConfigToNF(w http.ResponseWriter, r *http.Request) { neId := ctx.GetQuery(r, "ne_id") neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(neType, neId) - if neInfo.NeId != neId { + if neInfo.NeId != neId || neInfo.NeId == "" { log.Error("neId is empty") services.ResponseInternalServerError500DatabaseOperationFailed(w) return