From 2c847e0855b316c162c9fd31456fdf8e338a5dba Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Fri, 22 Mar 2019 14:12:52 -0400 Subject: Adding optimization application finish guard Created Optimization application and created a translator for it. The translator makes an assumption that OOF wants to query on policyScope and policyType properties. Rearranged some of the test code for re-usability. Guard policies are now creating for frequency limiter and min max. Probably could use some clean up. Upgraded to xacml 2.0.1 to include a fix for handling null attribute values. Added some code to test missing values. Issue-ID: POLICY-1273 Change-Id: Ia3dbfa992bbe0cbb5aa294c38aa2aff430a3230a Signed-off-by: Pamela Dragosh --- main/pom.xml | 5 +++++ .../decisions/decision.guard.shoulddeny.input.json | 7 ++++--- .../decisions/decision.guard.shoulddeny.input2.json | 15 +++++++++++++++ .../decisions/decision.guard.shoulddeny.output.json | 3 --- .../decisions/decision.guard.shouldpermit.input.json | 8 +++++--- .../decisions/decision.guard.shouldpermit.output.json | 3 --- .../decisions/decision.optimization.affinity.input.json | 10 ++++++++++ 7 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 main/src/test/resources/decisions/decision.guard.shoulddeny.input2.json delete mode 100644 main/src/test/resources/decisions/decision.guard.shoulddeny.output.json delete mode 100644 main/src/test/resources/decisions/decision.guard.shouldpermit.output.json create mode 100644 main/src/test/resources/decisions/decision.optimization.affinity.input.json (limited to 'main') diff --git a/main/pom.xml b/main/pom.xml index f4b0c9f4..872a5a0e 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -71,6 +71,11 @@ guard ${project.version} + + org.onap.policy.xacml-pdp.applications + optimization + ${project.version} + diff --git a/main/src/test/resources/decisions/decision.guard.shoulddeny.input.json b/main/src/test/resources/decisions/decision.guard.shoulddeny.input.json index ba9b5543..65d40c0a 100644 --- a/main/src/test/resources/decisions/decision.guard.shoulddeny.input.json +++ b/main/src/test/resources/decisions/decision.guard.shoulddeny.input.json @@ -1,14 +1,15 @@ { "ONAPName": "Policy", - "ONAPComponent": "DCAE", - "ONAPInstance": "optional-tbd", + "ONAPComponent": "drools-pdp", + "ONAPInstance": "usecase-template", + "requestId": "unique-request-id-2", "action": "guard", "resource": { "guard": { "actor": "SO", "recipe": "scaleOut", "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "vfcount" : "5" + "operationCount" : "1" } } } \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.guard.shoulddeny.input2.json b/main/src/test/resources/decisions/decision.guard.shoulddeny.input2.json new file mode 100644 index 00000000..29dfc3dc --- /dev/null +++ b/main/src/test/resources/decisions/decision.guard.shoulddeny.input2.json @@ -0,0 +1,15 @@ +{ + "ONAPName": "Policy", + "ONAPComponent": "drools-pdp", + "ONAPInstance": "usecase-template", + "requestId": "unique-request-id-2", + "action": "guard", + "resource": { + "guard": { + "actor": "SO", + "recipe": "scaleOut", + "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", + "vfCount" : "6" + } + } +} \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.guard.shoulddeny.output.json b/main/src/test/resources/decisions/decision.guard.shoulddeny.output.json deleted file mode 100644 index 3752fe47..00000000 --- a/main/src/test/resources/decisions/decision.guard.shoulddeny.output.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "status": "deny" -} \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.guard.shouldpermit.input.json b/main/src/test/resources/decisions/decision.guard.shouldpermit.input.json index 324d495a..92e933f7 100644 --- a/main/src/test/resources/decisions/decision.guard.shouldpermit.input.json +++ b/main/src/test/resources/decisions/decision.guard.shouldpermit.input.json @@ -1,14 +1,16 @@ { "ONAPName": "Policy", - "ONAPComponent": "DCAE", - "ONAPInstance": "optional-tbd", + "ONAPComponent": "drools-pdp", + "ONAPInstance": "usecase-template", + "requestId": "unique-request-id-1", "action": "guard", "resource": { "guard": { "actor": "SO", "recipe": "scaleOut", "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "vfcount" : "1" + "operationCount": "0", + "vfCount": "1" } } } \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.guard.shouldpermit.output.json b/main/src/test/resources/decisions/decision.guard.shouldpermit.output.json deleted file mode 100644 index a1939262..00000000 --- a/main/src/test/resources/decisions/decision.guard.shouldpermit.output.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "status": "permit" -} \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.optimization.affinity.input.json b/main/src/test/resources/decisions/decision.optimization.affinity.input.json new file mode 100644 index 00000000..1794acea --- /dev/null +++ b/main/src/test/resources/decisions/decision.optimization.affinity.input.json @@ -0,0 +1,10 @@ +{ + "ONAPName": "OOF", + "ONAPComponent": "OOF-component", + "ONAPInstance": "OOF-component-instance", + "action": "optimize", + "resource": { + "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"], + "policyType": "zone" + } +} \ No newline at end of file -- cgit 1.2.3-korg