Uploaded image for project: 'Policy Framework'
  1. Policy Framework
  2. POLICY-486

pdp-x api pushPolicy fails to push latest version

XMLWordPrintable

      See email conversation:

      Hi Jorge,
      Yes, there is an issue found in the code. Where if we use the API push policy it just adds the new version to the PDP Group without removing the older version. A fix is there in our internal code base but not applied to ONAP. If required I can request Mike to submit that fix to ONAP. Or an alternate way would be to remove the policy from PDP using deletePolicy API to remove from the PDPGroup and then push the new policy to the PDP group. Mike, feel free to correct me here.

       

      Regards,

      Tarun Tej.

       

      From: HERNANDEZ-HERRERO, JORGE
      Sent: Wednesday, November 15, 2017 7:11 PM
      To: PLATANIA, MARCO <platania@research.att.com>; TEJ, TARUN <tt3868@att.com>; DRAGOSH, PAM <pdragosh@research.att.com>
      Subject: question about programmatically pushing new versions of policies

       

      Hi Tarun,

       

      This is the script that Marco used to modify the vFW policy already pre-provisioned, the output seemed ok, but as I mentioned, it seems that it was still using the version 1 of the firewall policy.  

       

      See the .sh script attached and the output from Marco below.    The output says that version 2 of the firewall policy is sent, which was the new one.   When I looked into the brsmgw side, RuleProjects dir, the drl is for version 1.   The pom.xml version was bumped + 0.1, from 0.4.0 to 0.5.0.

       

      Any ideas?  

       

      Thanks,

      Jorge

       

      marcoplatania$ ./update-vfw-op-policy.sh 10.12.5.113 18a20f39-a565-4a3e-ab79-def7d9c73bb5 ~/onap_lab/sec/onap_dev

      Updating vFW Operational Policy ..

      Trying 10.12.5.113...
      Connected to 10.12.5.113 (10.12.5.113) port 8081 (#0)
      > PUT /pdp/api/updatePolicy HTTP/1.1
      > Host: 10.12.5.113:8081
      > User-Agent: curl/7.43.0
      > Content-Type: application/json
      > Accept: text/plain
      > ClientAuth: cHl0aG9uOnRlc3Q=
      > Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==
      > Environment: TEST
      > Content-Length: 1309
      > Expect: 100-continue
      >
      < HTTP/1.1 100 Continue
      We are completely uploaded and fine
      < HTTP/1.1 200 OK
      < Server: Apache-Coyote/1.1
      < Content-Type: text/plain;charset=ISO-8859-1
      < Content-Length: 149
      < Date: Wed, 15 Nov 2017 20:38:26 GMT
      <
      Connection #0 to host 10.12.5.113 left intact
      Transaction ID: 7960052b-4fb8-4ea5-b5e7-ccc978448a75 --Policy with the name com.Config_BRMS_Param_BRMSParamvFirewall.2.xml was successfully updated.

      Pushing the vFW Policy ..

      Trying 10.12.5.113...
      Connected to 10.12.5.113 (10.12.5.113) port 8081 (#0)
      > PUT /pdp/api/pushPolicy HTTP/1.1
      > Host: 10.12.5.113:8081
      > User-Agent: curl/7.43.0
      > Content-Type: application/json
      > Accept: text/plain
      > ClientAuth: cHl0aG9uOnRlc3Q=
      > Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==
      > Environment: TEST
      > Content-Length: 99
      >
      upload completely sent off: 99 out of 99 bytes
      < HTTP/1.1 200 OK
      < Server: Apache-Coyote/1.1
      < Content-Type: text/plain;charset=ISO-8859-1
      < Content-Length: 162
      < Date: Wed, 15 Nov 2017 20:38:32 GMT
      <
      Connection #0 to host 10.12.5.113 left intact
      Transaction ID: 11f884de-7884-4fad-b8bc-d7001f4c63c6 --Policy 'com.Config_BRMS_Param_BRMSParamvFirewall.2.xml' was successfully pushed to the PDP group 'default'.

      Restarting PDP-D ..

      [drools-pdp-controllers]
      L []: Stopping Policy Management... Policy Management (pid=5935) is stopping... Policy Management has stopped.
      [drools-pdp-controllers]
      L []: Policy Management (pid 6275) is running

      PDP-D amsterdam maven coordinates ..

      Trying 10.12.5.113...
      Connected to 10.12.5.113 (10.12.5.113) port 9696 (#0)
      Server auth using Basic with user '@1b3rt'
      > GET policy/pdp/engine/controllers/amsterdam/drools HTTP/1.1
      > Host: 10.12.5.113:9696
      > Authorization: Basic QDFiM3J0OjMxbnN0MzFu
      > User-Agent: curl/7.43.0
      > Accept:
      >
      < HTTP/1.1 200 OK
      < Date: Wed, 15 Nov 2017 20:39:34 GMT
      < Content-Type: application/json
      < Content-Length: 382
      < Server: Jetty(9.3.14.v20161028)
      <
      { [382 bytes data]
      Connection #0 to host 10.12.5.113 left intact
      {
      "alive": true,
      "artifactId": "policy-amsterdam-rules",
      "brained": true,
      "groupId": "org.onap.policy-engine.drools.amsterdam",
      "locked": false,
      "modelClassLoaderHash": 665564874,
      "recentSinkEvents": [],
      "recentSourceEvents": [],
      "sessionCoordinates": [
      "org.onap.policy-engine.drools.amsterdam:policy-amsterdam-rules:0.5.0:closedloop-amsterdam"
      ],
      "sessions": [
      "closedloop-amsterdam"
      ],
      "version": "0.5.0"
      }

      PDP-D control loop updated ..

      Trying 10.12.5.113...
      Connected to 10.12.5.113 (10.12.5.113) port 9696 (#0)
      Server auth using Basic with user '@1b3rt'
      > GET policy/pdp/engine/controllers/amsterdam/drools/facts/closedloop-amsterdam/org.onap.policy.controlloop.Params HTTP/1.1
      > Host: 10.12.5.113:9696
      > Authorization: Basic QDFiM3J0OjMxbnN0MzFu
      > User-Agent: curl/7.43.0
      > Accept:
      >
      < HTTP/1.1 200 OK
      < Date: Wed, 15 Nov 2017 20:39:35 GMT
      < Content-Type: application/json
      < Content-Length: 3565
      < Server: Jetty(9.3.14.v20161028)
      <
      { [1196 bytes data]
      Connection #0 to host 10.12.5.113 left intact
      [
      {
      "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
      "controlLoopYaml": "controlLoop%3A%0D%0A+version%3A+2.0.0%0D%0AcontrolLoopName%3A+ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0D%0Atrigger_policy%3A+unique-policy-id-1-scale-up%0D%0Atimeout%3A+1200%0D%0Aabatement%3A+false%0D%0Apolicies%3A%0D%0A+-id%3A+unique-policy-id-1-scale-up%0D%0A++name%3A+Create+a+new+VF+Module%0D%0A++description%3A%0D%0A++actor%3A+SO%0D%0A++recipe%3A+VF+Module+Create%0D%0A++target%3A%0D%0A++++type%3A+VNF%0D%0A++retry%3A+0%0D%0A++timeout%3A+1200%0D%0A++success%3A+final_success%0D%0A++failure%3A+final_failure%0D%0A++failure_timeout%3A+final_failure_timeout%0D%0A++failure_retries%3A+final_failure_retries%0D%0A++failure_exception%3A+final_failure_exception%0D%0A+++failure_guard%3A+final_failure_guard"
      },
      {
      "closedLoopControlName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b",
      "controlLoopYaml": "controlLoop%3A%0D%0A+version%3A+2.0.0%0D%0AcontrolLoopName%3A+ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b%0D%0Atrigger_policy%3A+unique-policy-id-1-restart%0D%0Atimeout%3A+3600%0D%0Aabatement%3A+false%0D%0A%0D%0Apolicies%3A%0D%0A++-id%3A+unique-policy-id-1-restart%0D%0A++name%3A+Restart+the+VM%0D%0A++description%3A%0D%0A++actor%3A+VFC%0D%0A++recipe%3A+Restart%0D%0A++target%3A%0D%0A++++type%3A+VM%0D%0A++retry%3A+3%0D%0A++timeout%3A+1200%0D%0A++success%3A+final_success%0D%0A++failure%3A+final_failure%0D%0A++failure_timeout%3A+final_failure_timeout%0D%0A++failure_retries%3A+final_failure_retries%0D%0A++failure_exception%3A+final_failure_exception%0D%0A+++failure_guard%3A+final_failure_guard"
      },
      {
      "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
      "controlLoopYaml": "controlLoop%3A%0D%0A+version%3A+2.0.0%0D%0AcontrolLoopName%3A+ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0D%0Atrigger_policy%3A+unique-policy-id-1-restart%0D%0Atimeout%3A+3600%0D%0Aabatement%3A+true%0D%0A%0D%0Apolicies%3A%0D%0A++-id%3A+unique-policy-id-1-restart%0D%0A++name%3A+Restart+the+VM%0D%0A++description%3A%0D%0A++actor%3A+APPC%0D%0A++recipe%3A+Restart%0D%0A++target%3A%0D%0A++++type%3A+VM%0D%0A++retry%3A+3%0D%0A++timeout%3A+1200%0D%0A++success%3A+final_success%0D%0A++failure%3A+final_failure%0D%0A++failure_timeout%3A+final_failure_timeout%0D%0A++failure_retries%3A+final_failure_retries%0D%0A++failure_exception%3A+final_failure_exception%0D%0A+++failure_guard%3A+final_failure_guard"
      },
      {
      "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
      "controlLoopYaml": "controlLoop%3A%0D%0A+version%3A+2.0.0%0D%0AcontrolLoopName%3A+ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a%0D%0Atrigger_policy%3A+unique-policy-id-1-modifyConfig%0D%0Atimeout%3A+1200%0D%0Aabatement%3A+false%0D%0A%0D%0Apolicies%3A%0D%0A++id%3A+unique-policy-id-1-modifyConfig%0D%0A++name%3A+modify+packet+gen+config%0D%0A++description%3A%0D%0A++actor%3A+APPC%0D%0A++recipe%3A+ModifyConfig%0D%0A++target%3A%0D%0A++++%23+TBDCannot+be+known+until+instantiation+is+done%0D%0A++++resourceID%3A+Eace933104d443b496b8.nodes.heat.vpg%0D%0A++++type%3A+VNF%0D%0A++retry%3A+0%0D%0A++timeout%3A+300%0D%0A++success%3A+final_success%0D%0A++failure%3A+final_failure%0D%0A++failure_timeout%3A+final_failure_timeout%0D%0A++failure_retries%3A+final_failure_retries%0D%0A++failure_exception%3A+final_failure_exception%0D%0A+++failure_guard%3A+final_failure_guard"
      }
      ]

       

            mmokry mmokry
            jhh jhh
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: