fix: cm_version filled by ne version
This commit is contained in:
@@ -64,28 +64,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
||||||
newValueJson := string(meJSON)
|
newValueJson := string(meJSON)
|
||||||
if err != nil || lastJson == "" {
|
if err != nil || lastJson == "" {
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,28 +122,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastAmfJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastAmfJson).Error
|
||||||
newAmfValueJson := string(amfJSON)
|
newAmfValueJson := string(amfJSON)
|
||||||
if err != nil || lastAmfJson == "" {
|
if err != nil || lastAmfJson == "" {
|
||||||
common.InsertNbiCm(ne, "AmfFunction", newAmfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "AmfFunction", newAmfValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "AmfFunction", newAmfValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AmfFunction", newAmfValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastAmfJson, newAmfValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastAmfJson, newAmfValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "AmfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AmfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "AmfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AmfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "AmfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AmfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "AmfFunction", newAmfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "AmfFunction", newAmfValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,28 +164,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastN8Json).Error
|
Order("timestamp ASC").Pluck("value_json", &lastN8Json).Error
|
||||||
newN8ValueJson := string(n8JSON)
|
newN8ValueJson := string(n8JSON)
|
||||||
if err != nil || lastN8Json == "" {
|
if err != nil || lastN8Json == "" {
|
||||||
common.InsertNbiCm(ne, "EpRpDynN8Amf", newN8ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN8Amf", newN8ValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN8Amf", newN8ValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN8Amf", newN8ValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastN8Json, newN8ValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastN8Json, newN8ValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN8Amf", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN8Amf", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN8Amf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN8Amf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN8Amf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN8Amf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "EpRpDynN8Amf", newN8ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN8Amf", newN8ValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -207,28 +207,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastN11Json).Error
|
Order("timestamp ASC").Pluck("value_json", &lastN11Json).Error
|
||||||
newN11ValueJson := string(n11JSON)
|
newN11ValueJson := string(n11JSON)
|
||||||
if err != nil || lastN11Json == "" {
|
if err != nil || lastN11Json == "" {
|
||||||
common.InsertNbiCm(ne, "EpRpDynN11Amf", newN11ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN11Amf", newN11ValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN11Amf", newN11ValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN11Amf", newN11ValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastN11Json, newN11ValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastN11Json, newN11ValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN11Amf", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN11Amf", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN11Amf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN11Amf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN11Amf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN11Amf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "EpRpDynN11Amf", newN11ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN11Amf", newN11ValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,28 +250,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastN12Json).Error
|
Order("timestamp ASC").Pluck("value_json", &lastN12Json).Error
|
||||||
newN12ValueJson := string(n12JSON)
|
newN12ValueJson := string(n12JSON)
|
||||||
if err != nil || lastN12Json == "" {
|
if err != nil || lastN12Json == "" {
|
||||||
common.InsertNbiCm(ne, "EpRpDynN12Amf", newN12ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN12Amf", newN12ValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN12Amf", newN12ValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN12Amf", newN12ValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastN12Json, newN12ValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastN12Json, newN12ValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN12Amf", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN12Amf", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN12Amf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN12Amf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN12Amf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN12Amf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "EpRpDynN12Amf", newN12ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN12Amf", newN12ValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -294,28 +294,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
||||||
newIpValueJson := string(ipJSON)
|
newIpValueJson := string(ipJSON)
|
||||||
if err != nil || lastIpJson == "" {
|
if err != nil || lastIpJson == "" {
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,11 +73,11 @@ func compareMaps(map1, map2, added, modified, deleted map[string]interface{}, pr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func InsertNbiCm(ne NeInfo, objType, valueJson string, eventType EventType) NbiCm {
|
func InsertNbiCm(ne NeInfo, version, objType, valueJson string, eventType EventType) NbiCm {
|
||||||
nbiCM := NbiCm{
|
nbiCM := NbiCm{
|
||||||
NeType: ne.NeType,
|
NeType: ne.NeType,
|
||||||
NeId: ne.NeId,
|
NeId: ne.NeId,
|
||||||
CmVersion: CmVersion,
|
CmVersion: version,
|
||||||
RmUid: ne.RmUid,
|
RmUid: ne.RmUid,
|
||||||
EventType: eventType,
|
EventType: eventType,
|
||||||
ObjectType: objType,
|
ObjectType: objType,
|
||||||
|
|||||||
@@ -62,28 +62,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
||||||
newValueJson := string(meJSON)
|
newValueJson := string(meJSON)
|
||||||
if err != nil || lastJson == "" {
|
if err != nil || lastJson == "" {
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,28 +108,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastPcfJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastPcfJson).Error
|
||||||
newPcfValueJson := string(pcfJSON)
|
newPcfValueJson := string(pcfJSON)
|
||||||
if err != nil || lastPcfJson == "" {
|
if err != nil || lastPcfJson == "" {
|
||||||
common.InsertNbiCm(ne, "PcfFunction", newPcfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "PcfFunction", newPcfValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "PcfFunction", newPcfValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "PcfFunction", newPcfValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastPcfJson, newPcfValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastPcfJson, newPcfValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "PcfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "PcfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "PcfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "PcfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "PcfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "PcfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "PcfFunction", newPcfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "PcfFunction", newPcfValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,28 +158,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastUdrJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastUdrJson).Error
|
||||||
newUdrValueJson := string(udrJSON)
|
newUdrValueJson := string(udrJSON)
|
||||||
if err != nil || lastUdrJson == "" {
|
if err != nil || lastUdrJson == "" {
|
||||||
common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastUdrJson, newUdrValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastUdrJson, newUdrValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -202,28 +202,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
||||||
newIpValueJson := string(ipJSON)
|
newIpValueJson := string(ipJSON)
|
||||||
if err != nil || lastIpJson == "" {
|
if err != nil || lastIpJson == "" {
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,28 +62,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
||||||
newValueJson := string(meJSON)
|
newValueJson := string(meJSON)
|
||||||
if err != nil || lastJson == "" {
|
if err != nil || lastJson == "" {
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,28 +118,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastSmfJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastSmfJson).Error
|
||||||
newSmfValueJson := string(smfJSON)
|
newSmfValueJson := string(smfJSON)
|
||||||
if err != nil || lastSmfJson == "" {
|
if err != nil || lastSmfJson == "" {
|
||||||
common.InsertNbiCm(ne, "SmfFunction", newSmfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "SmfFunction", newSmfValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "SmfFunction", newSmfValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "SmfFunction", newSmfValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastSmfJson, newSmfValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastSmfJson, newSmfValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "SmfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "SmfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "SmfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "SmfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "SmfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "SmfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "SmfFunction", newSmfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "SmfFunction", newSmfValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,28 +161,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastAddrPoolJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastAddrPoolJson).Error
|
||||||
newAddrPoolValueJson := string(addrPoolJSON)
|
newAddrPoolValueJson := string(addrPoolJSON)
|
||||||
if err != nil || lastAddrPoolJson == "" {
|
if err != nil || lastAddrPoolJson == "" {
|
||||||
common.InsertNbiCm(ne, "AddrPool", newAddrPoolValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "AddrPool", newAddrPoolValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "AddrPool", newAddrPoolValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AddrPool", newAddrPoolValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastAddrPoolJson, newAddrPoolValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastAddrPoolJson, newAddrPoolValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "AddrPool", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AddrPool", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "AddrPool", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AddrPool", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "AddrPool", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AddrPool", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "AddrPool", newAddrPoolValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "AddrPool", newAddrPoolValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,28 +204,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastN7Json).Error
|
Order("timestamp ASC").Pluck("value_json", &lastN7Json).Error
|
||||||
newN7ValueJson := string(n7JSON)
|
newN7ValueJson := string(n7JSON)
|
||||||
if err != nil || lastN7Json == "" {
|
if err != nil || lastN7Json == "" {
|
||||||
common.InsertNbiCm(ne, "EpRpDynN7Smf", newN7ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN7Smf", newN7ValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN7Smf", newN7ValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN7Smf", newN7ValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastN7Json, newN7ValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastN7Json, newN7ValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN7Smf", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN7Smf", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN7Smf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN7Smf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN7Smf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN7Smf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "EpRpDynN7Smf", newN7ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN7Smf", newN7ValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -247,28 +247,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastN10Json).Error
|
Order("timestamp ASC").Pluck("value_json", &lastN10Json).Error
|
||||||
newN10ValueJson := string(n10JSON)
|
newN10ValueJson := string(n10JSON)
|
||||||
if err != nil || lastN10Json == "" {
|
if err != nil || lastN10Json == "" {
|
||||||
common.InsertNbiCm(ne, "EpRpDynN10Smf", newN10ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN10Smf", newN10ValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN10Smf", newN10ValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN10Smf", newN10ValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastN10Json, newN10ValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastN10Json, newN10ValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN10Smf", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN10Smf", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN10Smf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN10Smf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN10Smf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN10Smf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "EpRpDynN10Smf", newN10ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN10Smf", newN10ValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -291,28 +291,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
||||||
newIpValueJson := string(ipJSON)
|
newIpValueJson := string(ipJSON)
|
||||||
if err != nil || lastIpJson == "" {
|
if err != nil || lastIpJson == "" {
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,28 +62,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
||||||
newValueJson := string(meJSON)
|
newValueJson := string(meJSON)
|
||||||
if err != nil || lastJson == "" {
|
if err != nil || lastJson == "" {
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,28 +108,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastUdmJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastUdmJson).Error
|
||||||
newUdmValueJson := string(udmJSON)
|
newUdmValueJson := string(udmJSON)
|
||||||
if err != nil || lastUdmJson == "" {
|
if err != nil || lastUdmJson == "" {
|
||||||
common.InsertNbiCm(ne, "UdmFunction", newUdmValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "UdmFunction", newUdmValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdmFunction", newUdmValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdmFunction", newUdmValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastUdmJson, newUdmValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastUdmJson, newUdmValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdmFunction", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdmFunction", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdmFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdmFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdmFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdmFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "UdmFunction", newUdmValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "UdmFunction", newUdmValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,28 +162,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastUdrJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastUdrJson).Error
|
||||||
newUdrValueJson := string(udrJSON)
|
newUdrValueJson := string(udrJSON)
|
||||||
if err != nil || lastUdrJson == "" {
|
if err != nil || lastUdrJson == "" {
|
||||||
common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastUdrJson, newUdrValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastUdrJson, newUdrValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,28 +208,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastAusfJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastAusfJson).Error
|
||||||
newAusfValueJson := string(ausfJSON)
|
newAusfValueJson := string(ausfJSON)
|
||||||
if err != nil || lastAusfJson == "" {
|
if err != nil || lastAusfJson == "" {
|
||||||
common.InsertNbiCm(ne, "AusfFunction", newAusfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "AusfFunction", newAusfValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "AusfFunction", newAusfValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AusfFunction", newAusfValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastAusfJson, newAusfValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastAusfJson, newAusfValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "AusfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AusfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "AusfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AusfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "AusfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "AusfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "AusfFunction", newAusfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "AusfFunction", newAusfValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,28 +252,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
||||||
newIpValueJson := string(ipJSON)
|
newIpValueJson := string(ipJSON)
|
||||||
if err != nil || lastIpJson == "" {
|
if err != nil || lastIpJson == "" {
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,28 +64,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
||||||
newValueJson := string(meJSON)
|
newValueJson := string(meJSON)
|
||||||
if err != nil || lastJson == "" {
|
if err != nil || lastJson == "" {
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,28 +113,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastRackJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastRackJson).Error
|
||||||
newRackValueJson := string(rackJSON)
|
newRackValueJson := string(rackJSON)
|
||||||
if err != nil || lastRackJson == "" {
|
if err != nil || lastRackJson == "" {
|
||||||
common.InsertNbiCm(ne, "InventoryUnitRack", newRackValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitRack", newRackValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitRack", newRackValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitRack", newRackValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastRackJson, newRackValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastRackJson, newRackValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitRack", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitRack", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitRack", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitRack", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitRack", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitRack", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "InventoryUnitRack", newRackValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitRack", newRackValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,28 +163,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastShelfJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastShelfJson).Error
|
||||||
newShelfValueJson := string(shelfJSON)
|
newShelfValueJson := string(shelfJSON)
|
||||||
if err != nil || lastShelfJson == "" {
|
if err != nil || lastShelfJson == "" {
|
||||||
common.InsertNbiCm(ne, "InventoryUnitShelf", newShelfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitShelf", newShelfValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitShelf", newShelfValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitShelf", newShelfValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastShelfJson, newShelfValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastShelfJson, newShelfValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitShelf", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitShelf", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitShelf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitShelf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitShelf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitShelf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "InventoryUnitShelf", newShelfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitShelf", newShelfValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,28 +213,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastPackJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastPackJson).Error
|
||||||
newPackValueJson := string(packJSON)
|
newPackValueJson := string(packJSON)
|
||||||
if err != nil || lastPackJson == "" {
|
if err != nil || lastPackJson == "" {
|
||||||
common.InsertNbiCm(ne, "InventoryUnitPack", newPackValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitPack", newPackValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitPack", newPackValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitPack", newPackValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastPackJson, newPackValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastPackJson, newPackValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitPack", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitPack", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitPack", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitPack", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitPack", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitPack", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "InventoryUnitPack", newPackValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitPack", newPackValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -266,28 +266,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastHostJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastHostJson).Error
|
||||||
newHostValueJson := string(hostJSON)
|
newHostValueJson := string(hostJSON)
|
||||||
if err != nil || lastHostJson == "" {
|
if err != nil || lastHostJson == "" {
|
||||||
common.InsertNbiCm(ne, "InventoryUnitHost", newHostValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitHost", newHostValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitHost", newHostValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitHost", newHostValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastHostJson, newHostValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastHostJson, newHostValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitHost", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitHost", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitHost", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitHost", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitHost", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitHost", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "InventoryUnitHost", newHostValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitHost", newHostValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -318,28 +318,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastAccJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastAccJson).Error
|
||||||
newAccValueJson := string(accJSON)
|
newAccValueJson := string(accJSON)
|
||||||
if err != nil || lastAccJson == "" {
|
if err != nil || lastAccJson == "" {
|
||||||
common.InsertNbiCm(ne, "InventoryUnitAccessory", newAccValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitAccessory", newAccValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitAccessory", newAccValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitAccessory", newAccValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastAccJson, newAccValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastAccJson, newAccValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitAccessory", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitAccessory", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitAccessory", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitAccessory", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitAccessory", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitAccessory", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "InventoryUnitAccessory", newAccValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "InventoryUnitAccessory", newAccValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -372,28 +372,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastUpfJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastUpfJson).Error
|
||||||
newUpfValueJson := string(upfJSON)
|
newUpfValueJson := string(upfJSON)
|
||||||
if err != nil || lastUpfJson == "" {
|
if err != nil || lastUpfJson == "" {
|
||||||
common.InsertNbiCm(ne, "UpfFunction", newUpfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "UpfFunction", newUpfValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "UpfFunction", newUpfValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UpfFunction", newUpfValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastUpfJson, newUpfValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastUpfJson, newUpfValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UpfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UpfFunction", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UpfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UpfFunction", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "UpfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "UpfFunction", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "UpfFunction", newUpfValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "UpfFunction", newUpfValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -415,28 +415,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastN3Json).Error
|
Order("timestamp ASC").Pluck("value_json", &lastN3Json).Error
|
||||||
newN3ValueJson := string(n3JSON)
|
newN3ValueJson := string(n3JSON)
|
||||||
if err != nil || lastN3Json == "" {
|
if err != nil || lastN3Json == "" {
|
||||||
common.InsertNbiCm(ne, "EpRpDynN3Upf", newN3ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN3Upf", newN3ValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN3Upf", newN3ValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN3Upf", newN3ValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastN3Json, newN3ValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastN3Json, newN3ValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN3Upf", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN3Upf", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN3Upf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN3Upf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN3Upf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN3Upf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "EpRpDynN3Upf", newN3ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN3Upf", newN3ValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -458,28 +458,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastN9Json).Error
|
Order("timestamp ASC").Pluck("value_json", &lastN9Json).Error
|
||||||
newN9ValueJson := string(n9JSON)
|
newN9ValueJson := string(n9JSON)
|
||||||
if err != nil || lastN9Json == "" {
|
if err != nil || lastN9Json == "" {
|
||||||
common.InsertNbiCm(ne, "EpRpDynN9Upf", newN9ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN9Upf", newN9ValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN9Upf", newN9ValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN9Upf", newN9ValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastN9Json, newN9ValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastN9Json, newN9ValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN9Upf", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN9Upf", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN9Upf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN9Upf", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN9Upf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN9Upf", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "EpRpDynN9Upf", newN9ValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "EpRpDynN9Upf", newN9ValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -502,28 +502,28 @@ func SyncNbiCM() error {
|
|||||||
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
Order("timestamp ASC").Pluck("value_json", &lastIpJson).Error
|
||||||
newIpValueJson := string(ipJSON)
|
newIpValueJson := string(ipJSON)
|
||||||
if err != nil || lastIpJson == "" {
|
if err != nil || lastIpJson == "" {
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||||
} else {
|
} else {
|
||||||
var ids []string
|
var ids []string
|
||||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||||
if len(added) > 0 {
|
if len(added) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(added), common.ObjectCreationEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(modified) > 0 {
|
if len(modified) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(modified), common.ObjectAttributeValueChangeEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
if len(deleted) > 0 {
|
if len(deleted) > 0 {
|
||||||
nbiCm := common.InsertNbiCm(ne, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
nbiCm := common.InsertNbiCm(ne, version, "IPResource", common.ToJson(deleted), common.ObjectDeletionEvent)
|
||||||
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
ids = append(ids, strconv.Itoa(nbiCm.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ids) > 0 {
|
if len(ids) > 0 {
|
||||||
redisqueue.AddNbiCMQueue(ids)
|
redisqueue.AddNbiCMQueue(ids)
|
||||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user