fix: OAM配置支持omc ip修改
This commit is contained in:
@@ -54,7 +54,7 @@ func NeConfigOMC(neInfo model.NeInfo) (map[string]any, error) {
|
|||||||
func NeConfigInfo(neInfo model.NeInfo, paramName string) (map[string]any, error) {
|
func NeConfigInfo(neInfo model.NeInfo, paramName string) (map[string]any, error) {
|
||||||
// 网元配置对端网管信息
|
// 网元配置对端网管信息
|
||||||
neUrl := fmt.Sprintf("http://%s:%d/api/rest/systemManagement/v1/elementType/%s/objectType/config/%s", neInfo.IP, neInfo.Port, strings.ToLower(neInfo.NeType), paramName)
|
neUrl := fmt.Sprintf("http://%s:%d/api/rest/systemManagement/v1/elementType/%s/objectType/config/%s", neInfo.IP, neInfo.Port, strings.ToLower(neInfo.NeType), paramName)
|
||||||
resBytes, err := fetch.Get(neUrl, nil, 1000)
|
resBytes, err := fetch.Get(neUrl, nil, 60_000)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warnf("NeConfigInfo Get \"%s\"", neUrl)
|
logger.Warnf("NeConfigInfo Get \"%s\"", neUrl)
|
||||||
logger.Errorf("NeConfigInfo %s", err.Error())
|
logger.Errorf("NeConfigInfo %s", err.Error())
|
||||||
|
|||||||
@@ -540,6 +540,7 @@ func (r *NeInfoImpl) NeConfOAMSync(neInfo model.NeInfo, content map[string]any,
|
|||||||
"pvFlag": neInfo.PvFlag,
|
"pvFlag": neInfo.PvFlag,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 公共参数指定的OMC
|
||||||
if omcIP, ok := r.Para5GData["OMC_IP"]; ok && omcIP != "" {
|
if omcIP, ok := r.Para5GData["OMC_IP"]; ok && omcIP != "" {
|
||||||
if strings.Contains(omcIP, ":") {
|
if strings.Contains(omcIP, ":") {
|
||||||
item["ipType"] = "ipv6"
|
item["ipType"] = "ipv6"
|
||||||
@@ -551,6 +552,17 @@ func (r *NeInfoImpl) NeConfOAMSync(neInfo model.NeInfo, content map[string]any,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v, ok := content["omcIP"]; ok && v != "" && v != nil {
|
||||||
|
omcIP := v.(string)
|
||||||
|
if strings.Contains(omcIP, ":") {
|
||||||
|
item["ipType"] = "ipv6"
|
||||||
|
item["ipv6"] = omcIP
|
||||||
|
}
|
||||||
|
if strings.Contains(omcIP, ".") {
|
||||||
|
item["ipType"] = "ipv4"
|
||||||
|
item["ipv4"] = omcIP
|
||||||
|
}
|
||||||
|
}
|
||||||
if oamEnable, ok := content["oamEnable"]; ok && oamEnable != nil {
|
if oamEnable, ok := content["oamEnable"]; ok && oamEnable != nil {
|
||||||
item["enable"] = parse.Boolean(oamEnable)
|
item["enable"] = parse.Boolean(oamEnable)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user