From: demx8as6 Date: Fri, 2 Apr 2021 11:37:33 +0000 (+0200) Subject: Some init version X-Git-Tag: 2.2.0~24 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=f9e11bbaa0d9db27bd418a1e7b2634a54cdf054f;p=oam.git Some init version IssueID: OAM-183 Signed-off-by: demx8as6 Change-Id: Ib6f01925c8152e7412c2a65f86ea47ade2be08d6 --- diff --git a/.gitignore b/.gitignore index 45418a7..d4d7d55 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 02f9dba..0000000 Binary files a/solution/dev/ves-test-collector/client-scripts-ves-v7/__pycache__/globalVesEventEmitter.cpython-38.pyc and /dev/null differ diff --git a/solution/dev/ves-test-collector/client-scripts-ves-v7/config b/solution/dev/ves-test-collector/client-scripts-ves-v7/config index 610ed55..a5ffe77 100644 --- a/solution/dev/ves-test-collector/client-scripts-ves-v7/config +++ b/solution/dev/ves-test-collector/client-scripts-ves-v7/config @@ -58,7 +58,7 @@ pnfIdByType=( [fyng]=LKCYFL79Q01M01FYNG01 [r2d2]=MMTSIL02Q01M01R2D201 [7dev]=PRTNILACQ01M017DEV01 - [nsky]=SEDNKSAHQ01M01nSky01 + [nsky]=O-RAN-FH-IPv6-01 [1OSF]=SNSNFLR0Q01M011OSF01 [no5g]=MMTSIL02Q01M01NO5G01 diff --git a/solution/dev/ves-test-collector/client-scripts-ves-v7/globalVesEventEmitter.py b/solution/dev/ves-test-collector/client-scripts-ves-v7/globalVesEventEmitter.py index 30d596f..f9a1fd9 100644 --- a/solution/dev/ves-test-collector/client-scripts-ves-v7/globalVesEventEmitter.py +++ b/solution/dev/ves-test-collector/client-scripts-ves-v7/globalVesEventEmitter.py @@ -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 diff --git a/solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesHeartbeat.py b/solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesHeartbeat.py index 4e1ff2d..b2066fb 100644 --- a/solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesHeartbeat.py +++ b/solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesHeartbeat.py @@ -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'] diff --git a/solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesNotification.py b/solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesNotification.py index d6d0adc..99b7784 100644 --- a/solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesNotification.py +++ b/solution/dev/ves-test-collector/client-scripts-ves-v7/sendVesNotification.py @@ -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