From 726a82abf1f485704459e2ce3777b8bac8cc16b6 Mon Sep 17 00:00:00 2001 From: Vidhu Date: Thu, 6 Jan 2022 20:07:17 +0530 Subject: [PATCH] Fixed the http request call for VES PM message [Issue-ID: ODUHIGH-412] Signed-off-by: Vidhu Change-Id: I1c0bf73ec50892588b7d658fa8914a53c2d2779e --- docs/README | 12 +++++----- docs/installation-guide.rst | 14 ++++++------ src/o1/ves/VesEvent.cpp | 50 +++++++++++++++++++++++++++++++++++++++--- src/o1/ves/VesEvent.hpp | 1 + src/o1/ves/VesEventHandler.cpp | 1 + 5 files changed, 62 insertions(+), 16 deletions(-) diff --git a/docs/README b/docs/README index 1d9199060..7a497bada 100644 --- a/docs/README +++ b/docs/README @@ -89,18 +89,18 @@ C. Pre-requisite for O1 Interface (Required only if run with O1 interface enable Install all the downloaded yang models. $cd l2/build/yang - $sysrepoctl -i _3gpp-common-top.yang - $sysrepoctl -i _3gpp-5g-common-yang-types.yang $sysrepoctl -i _3gpp-common-yang-types.yang - $sysrepoctl -i _3gpp-common-managed-element.yang + $sysrepoctl -i _3gpp-common-top.yang $sysrepoctl -i _3gpp-common-measurements.yang - $sysrepoctl -i _3gpp-common-subscription-control.yang - $sysrepoctl -i _3gpp-common-fm.yang $sysrepoctl -i _3gpp-common-trace.yang $sysrepoctl -i _3gpp-common-managed-function.yang + $sysrepoctl -i _3gpp-common-subscription-control.yang + $sysrepoctl -i _3gpp-common-fm.yang + $sysrepoctl -i _3gpp-common-managed-element.yang + $sysrepoctl -i _3gpp-5g-common-yang-types.yang + $sysrepoctl -i _3gpp-nr-nrm-rrmpolicy.yang $sysrepoctl -i _3gpp-nr-nrm-gnbdufunction.yang $sysrepoctl -i _3gpp-nr-nrm-nrcelldu.yang - $sysrepoctl -i _3gpp-nr-nrm-rrmpolicy.yang 3. Start Netopeer2-server: diff --git a/docs/installation-guide.rst b/docs/installation-guide.rst index d337736ae..4a72ca64b 100644 --- a/docs/installation-guide.rst +++ b/docs/installation-guide.rst @@ -189,20 +189,20 @@ Setting up Netconf server (Only if O1 interface enabled) - Install all the downloaded yang models. - Ubuntu : - + | cd /l2/build/yang - | sysrepoctl -i _3gpp-common-top.yang - | sysrepoctl -i _3gpp-5g-common-yang-types.yang | sysrepoctl -i _3gpp-common-yang-types.yang - | sysrepoctl -i _3gpp-common-managed-element.yang + | sysrepoctl -i _3gpp-common-top.yang | sysrepoctl -i _3gpp-common-measurements.yang - | sysrepoctl -i _3gpp-common-subscription-control.yang - | sysrepoctl -i _3gpp-common-fm.yang | sysrepoctl -i _3gpp-common-trace.yang | sysrepoctl -i _3gpp-common-managed-function.yang + | sysrepoctl -i _3gpp-common-subscription-control.yang + | sysrepoctl -i _3gpp-common-fm.yang + | sysrepoctl -i _3gpp-common-managed-element.yang + | sysrepoctl -i _3gpp-5g-common-yang-types.yang + | sysrepoctl -i _3gpp-nr-nrm-rrmpolicy.yang | sysrepoctl -i _3gpp-nr-nrm-gnbdufunction.yang | sysrepoctl -i _3gpp-nr-nrm-nrcelldu.yang - | sysrepoctl -i _3gpp-nr-nrm-rrmpolicy.yang - Start Netopeer2-server: diff --git a/src/o1/ves/VesEvent.cpp b/src/o1/ves/VesEvent.cpp index a12d1c75e..b19391ba1 100644 --- a/src/o1/ves/VesEvent.cpp +++ b/src/o1/ves/VesEvent.cpp @@ -28,9 +28,6 @@ VesEvent::VesEvent(VesEventType eventType) : mVesEventType(eventType) { - getConfig(); - createUrl(); - mHttpClient = new HttpClient(mVesUrl, mVesServerUsername, mVesServerPassword); }; @@ -45,6 +42,33 @@ VesEvent::~VesEvent() free(mSendData); } + +/******************************************************************* + * + * @brief Initialize the Ves Event + * + * @details + * + * Function : init + * + * Functionality: + * - Intialize the Ves event with configuration + * Sets the URL + * Instantiates the http client + * + * @params[in] IN - void + * @return void + * + * ****************************************************************/ + +void VesEvent::init(){ + + getConfig(); + createUrl(); + mHttpClient = new HttpClient(mVesUrl, mVesServerUsername, mVesServerPassword); + +} + /******************************************************************* * * @brief prepare Ves Event Fields @@ -130,6 +154,23 @@ bool VesEvent::prepare(const Message* msg) return true; } +/******************************************************************* + * + * @brief Send the Ves event over Http + * + * @details + * + * Function : send + * + * Functionality: + * - Sends the Ves event over http + * + * @params[in] IN - void + * @return true - success + * false - failure + * + * ****************************************************************/ + bool VesEvent::send() { return mHttpClient->send(mSendData); @@ -219,6 +260,9 @@ void VesEvent::createUrl() { mVesUrl = "https://" + mVesServerIp + ":" + mVesServerPort + "/eventListener/v7"; } + + + /********************************************************************** End of file **********************************************************************/ diff --git a/src/o1/ves/VesEvent.hpp b/src/o1/ves/VesEvent.hpp index 2f151311b..fe09ef080 100644 --- a/src/o1/ves/VesEvent.hpp +++ b/src/o1/ves/VesEvent.hpp @@ -41,6 +41,7 @@ class VesEvent{ VesEvent(); VesEvent(VesEventType); virtual ~VesEvent(); + void init(); bool prepare(const Message* msg = NULL); bool send(); diff --git a/src/o1/ves/VesEventHandler.cpp b/src/o1/ves/VesEventHandler.cpp index 60f85137c..09339cfcd 100644 --- a/src/o1/ves/VesEventHandler.cpp +++ b/src/o1/ves/VesEventHandler.cpp @@ -105,6 +105,7 @@ bool VesEventHandler::prepare(VesEventType evtType, const Message* msg) ret = false; break; } + mVesEvent->init(); if(!mVesEvent->prepare(msg)) { O1_LOG("\nO1 VesEventHandler : Failed to prepare VES message"); ret = false; -- 2.16.6