Some init version 51/5851/1
authordemx8as6 <martin.skorupski@highstreet-technologies.com>
Fri, 2 Apr 2021 11:37:33 +0000 (13:37 +0200)
committerdemx8as6 <martin.skorupski@highstreet-technologies.com>
Fri, 2 Apr 2021 13:38:45 +0000 (15:38 +0200)
IssueID: OAM-183
Signed-off-by: demx8as6 <martin.skorupski@highstreet-technologies.com>
Change-Id: Ib6f01925c8152e7412c2a65f86ea47ade2be08d6

.gitignore
solution/dev/ves-test-collector/client-scripts-ves-v7/__pycache__/globalVesEventEmitter.cpython-38.pyc [deleted file]
solution/dev/ves-test-collector/client-scripts-ves-v7/config
solution/dev/ves-test-collector/client-scripts-ves-v7/globalVesEventEmitter.py
solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesHeartbeat.py
solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesNotification.py

index 45418a7..d4d7d55 100644 (file)
@@ -47,9 +47,11 @@ release.properties
 
 # VES related
 */**/json/examples
+*/**/__pycache__
 *.log
 
 # documentation
+
 .tox
 docs/_build/
 ci-management/
diff --git a/solution/dev/ves-test-collector/client-scripts-ves-v7/__pycache__/globalVesEventEmitter.cpython-38.pyc b/solution/dev/ves-test-collector/client-scripts-ves-v7/__pycache__/globalVesEventEmitter.cpython-38.pyc
deleted file mode 100644 (file)
index 02f9dba..0000000
Binary files a/solution/dev/ves-test-collector/client-scripts-ves-v7/__pycache__/globalVesEventEmitter.cpython-38.pyc and /dev/null differ
index 610ed55..a5ffe77 100644 (file)
@@ -58,7 +58,7 @@ pnfIdByType=(
     [fyng]=LKCYFL79Q01M01FYNG01 
     [r2d2]=MMTSIL02Q01M01R2D201 
     [7dev]=PRTNILACQ01M017DEV01 
-    [nsky]=SEDNKSAHQ01M01nSky01 
+    [nsky]=O-RAN-FH-IPv6-01 
     [1OSF]=SNSNFLR0Q01M011OSF01
 
     [no5g]=MMTSIL02Q01M01NO5G01 
index 30d596f..f9a1fd9 100644 (file)
@@ -52,3 +52,12 @@ def getInitData(domain):
   
   Path(result["outdir"]).mkdir(parents=True, exist_ok=True)
   return result
+
+def saveExample(data):
+  if 'directory' in data and 'domain' in data and 'body' in data:
+    outputFileName = data['directory'] + '/json/examples/' + data['domain'] + '.json'
+    with open(outputFileName, 'w') as f:
+      json.dump(data['body'], f, indent=2, sort_keys=True)
+  else:
+    print("Example could not been saved:\n" + json.dump(data, f, indent=2, sort_keys=True)) 
+  
\ No newline at end of file
index 4e1ff2d..b2066fb 100644 (file)
@@ -21,7 +21,7 @@
 # importing the datetime, json, requests, os socket and yaml library
 import json
 import requests
-from globalVesEventEmitter import getInitData
+from globalVesEventEmitter import getInitData, saveExample
 
 # Globals
 domain = 'heartbeat'
@@ -45,9 +45,7 @@ initData['body']['event']['commonEventHeader']['nfVendorName'] = 'O-RAN-SC OAM'
 initData['body']['event']['heartbeatFields']['additionalFields']['eventTime'] = initData['eventTime']
 
 # Save example body
-outputFileName = initData['directory'] + '/json/examples/' + domain + '.json'
-with open(outputFileName, 'w') as f:
-    json.dump(initData['body'], f, indent=2, sort_keys=True)
+saveExample(initData)
 
 # Send VES Event
 url = initData['config']['vesEndpoint']['url']
index d6d0adc..99b7784 100644 (file)
@@ -29,7 +29,7 @@ from pathlib import Path
 
 # Globals
 dir = os.path.dirname(os.path.realpath(__file__))
-domain = "heartbeat"
+domain = "notification"
 fqdn = socket.getfqdn()
 
 # time formats