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
|
||||
newValueJson := string(meJSON)
|
||||
if err != nil || lastJson == "" {
|
||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newAmfValueJson := string(amfJSON)
|
||||
if err != nil || lastAmfJson == "" {
|
||||
common.InsertNbiCm(ne, "AmfFunction", newAmfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "AmfFunction", newAmfValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "AmfFunction", newAmfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "AmfFunction", newAmfValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastAmfJson, newAmfValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newN8ValueJson := string(n8JSON)
|
||||
if err != nil || lastN8Json == "" {
|
||||
common.InsertNbiCm(ne, "EpRpDynN8Amf", newN8ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN8Amf", newN8ValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "EpRpDynN8Amf", newN8ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN8Amf", newN8ValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastN8Json, newN8ValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newN11ValueJson := string(n11JSON)
|
||||
if err != nil || lastN11Json == "" {
|
||||
common.InsertNbiCm(ne, "EpRpDynN11Amf", newN11ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN11Amf", newN11ValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "EpRpDynN11Amf", newN11ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN11Amf", newN11ValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastN11Json, newN11ValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newN12ValueJson := string(n12JSON)
|
||||
if err != nil || lastN12Json == "" {
|
||||
common.InsertNbiCm(ne, "EpRpDynN12Amf", newN12ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN12Amf", newN12ValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "EpRpDynN12Amf", newN12ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN12Amf", newN12ValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastN12Json, newN12ValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newIpValueJson := string(ipJSON)
|
||||
if err != nil || lastIpJson == "" {
|
||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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{
|
||||
NeType: ne.NeType,
|
||||
NeId: ne.NeId,
|
||||
CmVersion: CmVersion,
|
||||
CmVersion: version,
|
||||
RmUid: ne.RmUid,
|
||||
EventType: eventType,
|
||||
ObjectType: objType,
|
||||
|
||||
@@ -62,28 +62,28 @@ func SyncNbiCM() error {
|
||||
Order("timestamp ASC").Pluck("value_json", &lastJson).Error
|
||||
newValueJson := string(meJSON)
|
||||
if err != nil || lastJson == "" {
|
||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newPcfValueJson := string(pcfJSON)
|
||||
if err != nil || lastPcfJson == "" {
|
||||
common.InsertNbiCm(ne, "PcfFunction", newPcfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "PcfFunction", newPcfValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "PcfFunction", newPcfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "PcfFunction", newPcfValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastPcfJson, newPcfValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newUdrValueJson := string(udrJSON)
|
||||
if err != nil || lastUdrJson == "" {
|
||||
common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastUdrJson, newUdrValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newIpValueJson := string(ipJSON)
|
||||
if err != nil || lastIpJson == "" {
|
||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newValueJson := string(meJSON)
|
||||
if err != nil || lastJson == "" {
|
||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newSmfValueJson := string(smfJSON)
|
||||
if err != nil || lastSmfJson == "" {
|
||||
common.InsertNbiCm(ne, "SmfFunction", newSmfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "SmfFunction", newSmfValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "SmfFunction", newSmfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "SmfFunction", newSmfValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastSmfJson, newSmfValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newAddrPoolValueJson := string(addrPoolJSON)
|
||||
if err != nil || lastAddrPoolJson == "" {
|
||||
common.InsertNbiCm(ne, "AddrPool", newAddrPoolValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "AddrPool", newAddrPoolValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "AddrPool", newAddrPoolValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "AddrPool", newAddrPoolValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastAddrPoolJson, newAddrPoolValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newN7ValueJson := string(n7JSON)
|
||||
if err != nil || lastN7Json == "" {
|
||||
common.InsertNbiCm(ne, "EpRpDynN7Smf", newN7ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN7Smf", newN7ValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "EpRpDynN7Smf", newN7ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN7Smf", newN7ValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastN7Json, newN7ValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newN10ValueJson := string(n10JSON)
|
||||
if err != nil || lastN10Json == "" {
|
||||
common.InsertNbiCm(ne, "EpRpDynN10Smf", newN10ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN10Smf", newN10ValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "EpRpDynN10Smf", newN10ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN10Smf", newN10ValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastN10Json, newN10ValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newIpValueJson := string(ipJSON)
|
||||
if err != nil || lastIpJson == "" {
|
||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newValueJson := string(meJSON)
|
||||
if err != nil || lastJson == "" {
|
||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newUdmValueJson := string(udmJSON)
|
||||
if err != nil || lastUdmJson == "" {
|
||||
common.InsertNbiCm(ne, "UdmFunction", newUdmValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "UdmFunction", newUdmValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "UdmFunction", newUdmValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "UdmFunction", newUdmValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastUdmJson, newUdmValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newUdrValueJson := string(udrJSON)
|
||||
if err != nil || lastUdrJson == "" {
|
||||
common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "UdrFunction", newUdrValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "UdrFunction", newUdrValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastUdrJson, newUdrValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newAusfValueJson := string(ausfJSON)
|
||||
if err != nil || lastAusfJson == "" {
|
||||
common.InsertNbiCm(ne, "AusfFunction", newAusfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "AusfFunction", newAusfValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "AusfFunction", newAusfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "AusfFunction", newAusfValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastAusfJson, newAusfValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newIpValueJson := string(ipJSON)
|
||||
if err != nil || lastIpJson == "" {
|
||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newValueJson := string(meJSON)
|
||||
if err != nil || lastJson == "" {
|
||||
common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "ManagedElement", newValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastJson, newValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newRackValueJson := string(rackJSON)
|
||||
if err != nil || lastRackJson == "" {
|
||||
common.InsertNbiCm(ne, "InventoryUnitRack", newRackValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitRack", newRackValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "InventoryUnitRack", newRackValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitRack", newRackValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastRackJson, newRackValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newShelfValueJson := string(shelfJSON)
|
||||
if err != nil || lastShelfJson == "" {
|
||||
common.InsertNbiCm(ne, "InventoryUnitShelf", newShelfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitShelf", newShelfValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "InventoryUnitShelf", newShelfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitShelf", newShelfValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastShelfJson, newShelfValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newPackValueJson := string(packJSON)
|
||||
if err != nil || lastPackJson == "" {
|
||||
common.InsertNbiCm(ne, "InventoryUnitPack", newPackValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitPack", newPackValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "InventoryUnitPack", newPackValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitPack", newPackValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastPackJson, newPackValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newHostValueJson := string(hostJSON)
|
||||
if err != nil || lastHostJson == "" {
|
||||
common.InsertNbiCm(ne, "InventoryUnitHost", newHostValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitHost", newHostValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "InventoryUnitHost", newHostValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitHost", newHostValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastHostJson, newHostValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newAccValueJson := string(accJSON)
|
||||
if err != nil || lastAccJson == "" {
|
||||
common.InsertNbiCm(ne, "InventoryUnitAccessory", newAccValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "InventoryUnitAccessory", newAccValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "InventoryUnitAccessory", newAccValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "InventoryUnitAccessory", newAccValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastAccJson, newAccValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newUpfValueJson := string(upfJSON)
|
||||
if err != nil || lastUpfJson == "" {
|
||||
common.InsertNbiCm(ne, "UpfFunction", newUpfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "UpfFunction", newUpfValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "UpfFunction", newUpfValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "UpfFunction", newUpfValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastUpfJson, newUpfValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newN3ValueJson := string(n3JSON)
|
||||
if err != nil || lastN3Json == "" {
|
||||
common.InsertNbiCm(ne, "EpRpDynN3Upf", newN3ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN3Upf", newN3ValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "EpRpDynN3Upf", newN3ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN3Upf", newN3ValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastN3Json, newN3ValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newN9ValueJson := string(n9JSON)
|
||||
if err != nil || lastN9Json == "" {
|
||||
common.InsertNbiCm(ne, "EpRpDynN9Upf", newN9ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "EpRpDynN9Upf", newN9ValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "EpRpDynN9Upf", newN9ValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "EpRpDynN9Upf", newN9ValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastN9Json, newN9ValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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
|
||||
newIpValueJson := string(ipJSON)
|
||||
if err != nil || lastIpJson == "" {
|
||||
common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectOriginalEvent)
|
||||
nbiCm := common.InsertNbiCm(ne, version, "IPResource", newIpValueJson, common.ObjectCreationEvent)
|
||||
redisqueue.AddNbiCMQueue([]string{strconv.Itoa(nbiCm.Id)})
|
||||
} else {
|
||||
var ids []string
|
||||
added, modified, deleted, _ := common.CompareJSON(lastIpJson, newIpValueJson)
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
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