Update the content send to Policy 95/21995/1
authorxg353y <xg353y@intl.att.com>
Fri, 3 Nov 2017 09:30:12 +0000 (10:30 +0100)
committerxg353y <xg353y@intl.att.com>
Fri, 3 Nov 2017 09:33:44 +0000 (10:33 +0100)
Adding tca_policy tag under content section, while sending configBody to
Policy.

Change-Id: I184d366b0cda24ff6b95c4e8c29d0a90bde7ba06
Issue-ID: CLAMP-62
Signed-off-by: xg353y <xg353y@intl.att.com>
src/main/java/org/onap/clamp/clds/client/req/TcaRequestFormatter.java
src/main/resources/clds/clds-reference.properties
src/test/resources/clds/clds-reference.properties
src/test/resources/example/tca-policy-req/tca-policy-expected.json

index a71a5f3..9698a99 100644 (file)
@@ -75,7 +75,7 @@ public class TcaRequestFormatter {
             String policyName = refProp.getStringValue("tca.policyid.prefix") + modelProperties.getCurrentPolicyScopeAndPolicyName();
             ((ObjectNode) rootNode).put("policyName", policyName);
             ((ObjectNode) rootNode).put("description", "MicroService vCPE Policy");
-            ((ObjectNode) rootNode).replace("content", createPolicyContent(refProp, modelProperties, service, policyName, tca));
+            ((ObjectNode) rootNode.get("content")).replace("tca_policy", createPolicyContent(refProp, modelProperties, service, policyName, tca));
 
             String tcaPolicyReq = rootNode.toString();
             logger.info("tcaPolicyReq=" + tcaPolicyReq);
index 3bf018d..ab33d5c 100644 (file)
@@ -48,7 +48,7 @@ policy.op.policyNamePrefix=Config_BRMS_Param_
 # TCA MicroService Policy request build properties\r
 #\r
 tca.policyid.prefix=DCAE.Config_\r
-tca.policy.template={"service": "policy_tosca_tca", "version": "1.0.0", "location": "SampleServiceLocation", "configName": "SampleConfigName", "uuid": "test", "policyScope": "resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", "templateVersion": "OpenSource.version.1", "policyName": "MicroServicevCPE", "description": "MicroService Policy", "priority": "1", "riskType": "SampleRiskType", "riskLevel": "1", "guard": "False","content":{}}\r
+tca.policy.template={"service": "tca_policy", "version": "1.0.0", "location": "SampleServiceLocation", "configName": "SampleConfigName", "uuid": "test", "policyScope": "resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", "templateVersion": "OpenSource.version.1", "policyName": "MicroServicevCPE", "description": "MicroService Policy", "priority": "1", "riskType": "SampleRiskType", "riskLevel": "1", "guard": "False","content":{"tca_policy": {}}}\r
 tca.template= {"domain": "measurementsForVfScaling", "metricsPerEventName": [{"eventName": "???", "controlLoopSchemaType":"VNF","policyScope": "DCAE","policyName": "???","policyVersion": "v0.0.1","thresholds": []}]}\r
 tca.thresholds.template={"closedLoopControlName": "???", "version": "1.0.2","fieldPath": "?????", "thresholdValue": 0,"direction": "???","severity": "MAJOR", "closedLoopEventStatus": "???"}\r
 \r
index a9670e1..f45957e 100644 (file)
@@ -29,7 +29,7 @@
 # TCA MicroService Policy request build properties\r
 #\r
 tca.policyid.prefix=DCAE.Config_\r
-tca.policy.template={"service": "policy_tosca_tca", "version": "1.0.0", "location": "SampleServiceLocation", "configName": "SampleConfigName", "uuid": "test", "policyScope": "resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", "templateVersion": "OpenSource.version.1", "policyName": "MicroServicevCPE", "description": "MicroService Policy", "priority": "1", "riskType": "SampleRiskType", "riskLevel": "1", "guard": "False","content":{}}\r
+tca.policy.template={"service": "tca_policy", "version": "1.0.0", "location": "SampleServiceLocation", "configName": "SampleConfigName", "uuid": "test", "policyScope": "resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", "templateVersion": "OpenSource.version.1", "policyName": "MicroServicevCPE", "description": "MicroService Policy", "priority": "1", "riskType": "SampleRiskType", "riskLevel": "1", "guard": "False","content":{"tca_policy": {}}}\r
 tca.template= {"domain": "measurementsForVfScaling", "metricsPerEventName": [{"eventName": "???", "controlLoopSchemaType":"VNF","policyScope": "DCAE","policyName": "???","policyVersion": "v0.0.1","thresholds": []}]}\r
 tca.thresholds.template={"closedLoopControlName": "???", "version": "1.0.2","fieldPath": "?????", "thresholdValue": 0,"direction": "???","severity": "MAJOR", "closedLoopEventStatus": "???"}\r
 #\r
index ad95c07..2ade75f 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "service": "policy_tosca_tca",
+  "service": "tca_policy",
   "version": "1.0.0",
   "location": "SampleServiceLocation",
   "configName": "SampleConfigName",
   "riskLevel": "1",
   "guard": "False",
   "content": {
-    "domain": "measurementsForVfScaling",
-    "metricsPerEventName": [
-      {
-        "eventName": "vFirewallBroadcastPackets",
-        "controlLoopSchemaType": "VNF",
-        "policyScope": "DCAE",
-        "policyName": "DCAE.Config_example_model01.ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_TCA_1jy9to4",
-        "policyVersion": "v0.0.1",
-        "thresholds": [
-          {
-            "closedLoopControlName": "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_null",
-            "version": "1.0.2",
-            "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta",
-            "thresholdValue": 123,
-            "direction": "GREATER_OR_EQUAL",
-            "severity": "MAJOR",
-            "closedLoopEventStatus": "ONSET"
-          },
-          {
-            "closedLoopControlName": "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_null",
-            "version": "1.0.2",
-            "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta",
-            "thresholdValue": 123,
-            "direction": "GREATER_OR_EQUAL",
-            "severity": "MAJOR",
-            "closedLoopEventStatus": "ONSET"
-          }
-        ]
-      }
-    ]
+    "tca_policy": {
+        "domain": "measurementsForVfScaling",
+        "metricsPerEventName": [
+        {
+          "eventName": "vFirewallBroadcastPackets",
+          "controlLoopSchemaType": "VNF",
+          "policyScope": "DCAE",
+          "policyName": "DCAE.Config_example_model01.ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_TCA_1jy9to4",
+          "policyVersion": "v0.0.1",
+          "thresholds": [
+            {
+              "closedLoopControlName": "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_null",
+              "version": "1.0.2",
+              "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta",
+              "thresholdValue": 123,
+              "direction": "GREATER_OR_EQUAL",
+              "severity": "MAJOR",
+              "closedLoopEventStatus": "ONSET"
+            },
+            {
+              "closedLoopControlName": "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_null",
+              "version": "1.0.2",
+              "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta",
+              "thresholdValue": 123,
+              "direction": "GREATER_OR_EQUAL",
+              "severity": "MAJOR",
+              "closedLoopEventStatus": "ONSET"
+            }
+          ]
+        }
+      ]
+    }
   }
 }