Fixed the http request call for VES PM message [Issue-ID: ODUHIGH-412] 09/7509/1
authorVidhu <vidhu.pandey@hcl.com>
Thu, 6 Jan 2022 14:37:17 +0000 (20:07 +0530)
committerVidhu <vidhu.pandey@hcl.com>
Thu, 6 Jan 2022 14:37:17 +0000 (20:07 +0530)
Signed-off-by: Vidhu <vidhu.pandey@hcl.com>
Change-Id: I1c0bf73ec50892588b7d658fa8914a53c2d2779e

docs/README
docs/installation-guide.rst
src/o1/ves/VesEvent.cpp
src/o1/ves/VesEvent.hpp
src/o1/ves/VesEventHandler.cpp

index 1d91990..7a497ba 100644 (file)
@@ -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:
index d337736..4a72ca6 100644 (file)
@@ -189,20 +189,20 @@ Setting up Netconf server (Only if O1 interface enabled)
    - Install all the downloaded yang models.
 
        - Ubuntu :
-       
+
        | cd <O-DU High Directory>/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:
 
index a12d1c7..b19391b 100644 (file)
@@ -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
  **********************************************************************/
index 2f15131..fe09ef0 100644 (file)
@@ -41,6 +41,7 @@ class VesEvent{
       VesEvent();
       VesEvent(VesEventType);
       virtual ~VesEvent();
+      void init();
       bool prepare(const Message* msg = NULL);
       bool send();
 
index 60f8513..09339cf 100644 (file)
@@ -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;