},
"pnfRegistrationFields": {
"oamV4IpAddress":"10.17.123.234",
- "oamV6IpAddress":""
+ "oamV6IpAddress":"",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion"
}
}
}
},
"pnfRegistrationFields": {
"oamV4IpAddress":"",
- "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8b2e:0370:7334"
+ "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8b2e:0370:7334",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion"
}
}
}
},
"pnfRegistrationFields": {
"oamV4IpAddress":"10.16.123.234",
- "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"
+ "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion"
}
}
}
--- /dev/null
+{
+ "event": {
+ "commonEventHeader": {
+ "sourceName":"NOK6061ZW1"
+ },
+ "pnfRegistrationFields": {
+ "oamV4IpAddress":"10.16.123.234",
+ "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334",
+ "serial-number":"",
+ "equip-vendor":"",
+ "equip-model":"",
+ "equip-type":"",
+ "nf-role":"",
+ "sw-version":""
+ }
+ }
+}
},
"pnfRegistrationFields": {
"oamV4IpAddress":"",
- "oamV6IpAddress":""
+ "oamV6IpAddress":"",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion"
}
}
}
--- /dev/null
+{
+ "event": {
+ "commonEventHeader": {
+ "sourceName":"NOK6061ZW1"
+ },
+ "pnfRegistrationFields": {
+ "oamV4IpAddress":"10.16.123.234",
+ "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"
+ }
+ }
+}
},
"pnfRegistrationFields": {
"oamV4IpAddress":"10.18.123.234",
- "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2a:0370:7334"
+ "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2a:0370:7334",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion"
}
}
}
},
"pnfRegistrationFields": {
"oamV4IpAddress":"",
- "oamV6IpAddress":""
+ "oamV6IpAddress":"",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion"
}
}
}
},
"pnfRegistrationFields": {
"oamV4IpAddress":"",
- "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8b2f:0370:7334"
+ "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8b2f:0370:7334",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion"
}
}
}
},
"pnfRegistrationFields": {
"oamV4IpAddress":"10.17.163.234",
- "oamV6IpAddress":""
+ "oamV6IpAddress":"",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion"
}
}
}
"sourceName":"NOK6061ZW9"
},
"pnfRegistrationFields": {
- "oamV4IpAddress":"10.17.123.24"
+ "oamV4IpAddress":"10.17.123.24",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion"
}
}
}
"pnfRegistrationFields": {
"oamV4IpAddress":"10.16.123.234",
"oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334",
+ "serial-number":"NOkkaaa123",
+ "equip-vendor":"equipVendor",
+ "equip-model":"equipModel",
+ "equip-type":"equipType",
+ "nf-role":"nf-role",
+ "sw-version":"swVersion",
}
}
}
json_to_python = json.loads(json_file)
ipv4 = json_to_python.get("event").get("pnfRegistrationFields").get("oamV4IpAddress")
ipv6 = json_to_python.get("event").get("pnfRegistrationFields").get("oamV6IpAddress") if "oamV6IpAddress" in json_to_python["event"]["pnfRegistrationFields"] else ""
+ serial_number = json_to_python.get("event").get("pnfRegistrationFields").get("serial-number") if "serial-number" in json_to_python["event"]["pnfRegistrationFields"] else ""
+ equip_vendor = json_to_python.get("event").get("pnfRegistrationFields").get("equip-vendor") if "equip-vendor" in json_to_python["event"]["pnfRegistrationFields"] else ""
+ equip_model = json_to_python.get("event").get("pnfRegistrationFields").get("equip-model") if "equip-model" in json_to_python["event"]["pnfRegistrationFields"] else ""
+ equip_type = json_to_python.get("event").get("pnfRegistrationFields").get("equip-type") if "equip-type" in json_to_python["event"]["pnfRegistrationFields"] else ""
+ nf_role = json_to_python.get("event").get("pnfRegistrationFields").get("nf-role") if "nf-role" in json_to_python["event"]["pnfRegistrationFields"] else ""
+ sw_version = json_to_python.get("event").get("pnfRegistrationFields").get("sw-version") if "sw-version" in json_to_python["event"]["pnfRegistrationFields"] else ""
correlation_id = json_to_python.get("event").get("commonEventHeader").get("sourceName")
- str_json = '{"correlationId":"' + correlation_id + '","ipaddress-v4-oam":"' + ipv4 + '","ipaddress-v6-oam":"' + ipv6 + '"}'
+ str_json = '{"correlationId":"' + correlation_id + '","ipaddress-v4-oam":"' + ipv4 + '","ipaddress-v6-oam":"' + ipv6 + '","serial-number":"' + serial_number + '","equip-vendor":"' + equip_vendor + '","equip-model":"' + equip_model + '","equip-type":"' + equip_type + '","nf-role":"' + nf_role + '","sw-version":"' + sw_version + '"}'
python_to_json = json.dumps(str_json)
return python_to_json.replace("\\", "")[1:-1]