policy/models.git
4 years agoTOSCA Compliant Guard Policies 27/103127/8
Pamela Dragosh [Thu, 5 Mar 2020 12:55:57 +0000 (07:55 -0500)]
TOSCA Compliant Guard Policies

Fixing the legacy guard policies and renaming them so we are
able to differentiate them.

Adding newer, cleaner TOSCA Guard Policies that match the operational
guard policies.

Removing legacy guard policies.

Fixing JUnit so that they don't use indexes to test whether versions
are changed correctly.

Added back in new guard policies. Fixed the guard policy types to use
camel case.

Issue-ID: POLICY-2243
Change-Id: Ie611f26f73f41e64c0b467f524f470739158f437
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMerge "Add SO VF Module Delete Operation"
Jim Hahn [Fri, 6 Mar 2020 01:49:43 +0000 (01:49 +0000)]
Merge "Add SO VF Module Delete Operation"

4 years agoAdd SO VF Module Delete Operation 22/102922/10
Jim Hahn [Wed, 4 Mar 2020 02:02:13 +0000 (21:02 -0500)]
Add SO VF Module Delete Operation

Redesigned the SO Operation classes; moved some code from the subclass
to the superclass so it could be reused by the VF Module Delete Operation.
JerseyClient does not support DELETE with a request body, so had to
implement a delete() method using java11 HttpClient.
Fix some issues found while testing with drools-apps.
Added "delete" operation to SO simulator.

Issue-ID: POLICY-2371
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I269fe13cf90c295ec2bbac92bc5a59b3820ea265

4 years agoMake Controller policy type derived from native 69/103169/2
jhh [Thu, 5 Mar 2020 18:50:37 +0000 (12:50 -0600)]
Make Controller policy type derived from native

onap.policies.drools.Controller has been made to
be derived from native, and it has been consolidated
under the onap.policies.native.Drools.yaml.
Additionallly some renaming of fields has been done in
an attempt to be more representative of its content.

Issue-ID: POLICY-2388
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I5b1cf04f36db01b917b77eff4ab5254073be9b0c
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMerge "Add APPC-LCM actor"
Ram Krishna Verma [Thu, 5 Mar 2020 16:22:53 +0000 (16:22 +0000)]
Merge "Add APPC-LCM actor"

4 years agoAdd APPC-LCM actor 83/102783/8
Peyton Puckett [Mon, 2 Mar 2020 22:02:07 +0000 (16:02 -0600)]
Add APPC-LCM actor

Issue-ID: POLICY-2403
Change-Id: Ia7b26cce9ec8308c3d83c374e5ac6aea3af38a1d
Signed-off-by: Peyton Puckett <peyton.puckett@att.com>
4 years agoMerge "SDNC Actor doesn't use full URL"
Pamela Dragosh [Thu, 5 Mar 2020 13:24:05 +0000 (13:24 +0000)]
Merge "SDNC Actor doesn't use full URL"

4 years agoMerge "Fix tca monitoring tca_policy type"
Liam Fallon [Thu, 5 Mar 2020 08:14:58 +0000 (08:14 +0000)]
Merge "Fix tca monitoring tca_policy type"

4 years agoSDNC Actor doesn't use full URL 53/103053/1
Jim Hahn [Wed, 4 Mar 2020 20:02:45 +0000 (15:02 -0500)]
SDNC Actor doesn't use full URL

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ib9e6e4d988013966317df5b7c15867e3691b5748

4 years agoFix exception message in Actors 32/103032/2
Jim Hahn [Wed, 4 Mar 2020 17:01:06 +0000 (12:01 -0500)]
Fix exception message in Actors

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I1efa70785e162c9a02ed90f5f8d94e85d2432d73

4 years agoFix tca monitoring tca_policy type 18/103018/4
Pamela Dragosh [Wed, 4 Mar 2020 15:29:54 +0000 (10:29 -0500)]
Fix tca monitoring tca_policy type

Should not use map or entry_schema

Issue-ID: POLICY-2408
Change-Id: Ieebe625676edab6c44323b7c69a50cc22099235f
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoTranslate APPC Instant to Long 17/103017/1
Jim Hahn [Tue, 3 Mar 2020 21:54:52 +0000 (16:54 -0500)]
Translate APPC Instant to Long

APPC uses encode Instant fields as milliseconds instead of as
ISO date strings.

Issue-ID: POLICY-2363
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Id9bedb11c43264f882b6fd044155621c8ccc79f6

4 years agoMerge "Fix path issues"
Ram Krishna Verma [Tue, 3 Mar 2020 19:41:16 +0000 (19:41 +0000)]
Merge "Fix path issues"

4 years agoReturn incoming service templates on create 80/102880/1
liamfallon [Tue, 3 Mar 2020 16:14:34 +0000 (16:14 +0000)]
Return incoming service templates on create

We should return the incoming service template on create requests. This
change is required for CSIT tests.

Issue-ID: POLICY-1402
Change-Id: I1072c9c16d2b267c34fa015e7e7a355ba9f5338a
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoMerge "Don't log cancellation exception"
Jim Hahn [Tue, 3 Mar 2020 14:57:35 +0000 (14:57 +0000)]
Merge "Don't log cancellation exception"

4 years agoLog topic message before publishing 09/102809/1
Jim Hahn [Tue, 3 Mar 2020 04:55:07 +0000 (23:55 -0500)]
Log topic message before publishing

Code was publishing and then logging the message.  Reversed the
order.

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I1b5dd5e96d86d818cd38d2a671fb37c2576e2054

4 years agoDon't log cancellation exception 98/102798/1
Jim Hahn [Tue, 3 Mar 2020 02:50:28 +0000 (21:50 -0500)]
Don't log cancellation exception

When an Actor operation is canceled it's done on purpose, yet the whole
exception stack trace is included in the log.  Modified the code to
leave out the stack trace for cancellations.  I don't THINK this will
cause a sonar issue, as it isn't the exception is never caught via
a "catch" clause.

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ib5238e4791ae491b30286cdc8ed9caf67432dc26

4 years agoFix path issues 78/102778/4
Jim Hahn [Mon, 2 Mar 2020 21:17:36 +0000 (16:17 -0500)]
Fix path issues

A&AI tenant query is prepending the target entity with "/", but it should
not.  Fixed it.
Modified A&AI and SO actors to get path prefixes from parameters.
Fixed a bug in an A&AI simulator response (extra "}" at the end.

Issue-ID: POLICY-2349
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I71f8b1e5fb8a4bd29b4f616a7757d366c7d58127

4 years agoMerge "Log Actor parameter error message"
Ram Krishna Verma [Mon, 2 Mar 2020 21:36:02 +0000 (21:36 +0000)]
Merge "Log Actor parameter error message"

4 years agoLog Actor parameter error message 71/102771/1
Jim Hahn [Mon, 2 Mar 2020 19:50:11 +0000 (14:50 -0500)]
Log Actor parameter error message

When an operation cannot be configured, the message did not
include information describing the issue.  Fixed it.

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I671bf27693a8bfa87305099fcefa0e4e0c48928d

4 years agoTestcases for cds actor 42/102642/2
Ram Krishna Verma [Fri, 28 Feb 2020 22:53:54 +0000 (17:53 -0500)]
Testcases for cds actor

Adding test cases for cds actor, operator, operation & manager.
Coverage is more than 95% overall.
Fixed review comments.

Issue-ID: POLICY-2384
Change-Id: I64beeb0c46918b990ad7e67248559169fc7940a1
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
4 years agoAdd SDNR Actor 62/102162/6
Pamela Dragosh [Fri, 21 Feb 2020 19:57:50 +0000 (14:57 -0500)]
Add SDNR Actor

Actor for SDNR and necessary JUnit tests.

Removed the Pair code.

Issue-ID: POLICY-2382
Change-Id: I3da1d95f431cc076f12e9ad26280b92058fe51cc
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMerge "Add sequence number to Actors"
Ram Krishna Verma [Sun, 1 Mar 2020 15:44:26 +0000 (15:44 +0000)]
Merge "Add sequence number to Actors"

4 years agoMerge "Sequence throws NPE if task outcome is null"
Liam Fallon [Sun, 1 Mar 2020 14:38:22 +0000 (14:38 +0000)]
Merge "Sequence throws NPE if task outcome is null"

4 years agoGuard Actor is adding the wrong type of Operator 60/102660/1
Jim Hahn [Sat, 29 Feb 2020 19:34:53 +0000 (14:34 -0500)]
Guard Actor is adding the wrong type of Operator

The Guard Actor should be adding a GuardOperator, but it was
adding an HttpOperator, instead.  Fixed the code.

Issue-ID: POLICY-2350
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I03517e993442da13a4dbd1eb0c4a0318b0c1c9f2

4 years agoAdd sequence number to Actors 59/102659/1
Jim Hahn [Sat, 29 Feb 2020 18:20:06 +0000 (13:20 -0500)]
Add sequence number to Actors

When actors with duplicate names are loaded, a way is needed to
determine which should take precedence. Added a sequence number to
Actor to facilitate this.  Unfortunately, couldn't use OrderedServiceImpl,
because it only creates the Actors once, which would break a number
of junit tests.

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I1ade92f4fe516cfc54bb92d0a3624c67e8981075

4 years agoSequence throws NPE if task outcome is null 54/102654/1
Jim Hahn [Sat, 29 Feb 2020 13:16:34 +0000 (08:16 -0500)]
Sequence throws NPE if task outcome is null

If a task outcome is null, then sequence() throws an NPE.  Modified
it to treat a null outcome as a failure.

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I57b8be27f72c7cbf43e0b3b8816696ab1928f396

4 years agoRemove controllerVersion (no use at this point). 31/102531/1
jhh [Fri, 28 Feb 2020 01:28:59 +0000 (19:28 -0600)]
Remove controllerVersion (no use at this point).

It is not clear what would be the controller version for
at this point.   We could add back if we find a good use
for this field.

Issue-ID: POLICY-2388
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Ic5dfeb1f39172550c7a0bda538992b0c64d1c71e

4 years agoChange ActorService config to Map<String,Object> 45/102445/1
Jim Hahn [Wed, 26 Feb 2020 22:14:34 +0000 (17:14 -0500)]
Change ActorService config to Map<String,Object>

It's a bit of a pain to pass Map<String, Map<String,Object>> to
the ActorService configure() method.  Changed it to simply take
a Map<String,Object>, as it had been in a previous iteration.

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ib6e703115027bc4919cc93762ca5b38d254f2b8f

4 years agoMerge "ActorService constructor should be public"
Ram Krishna Verma [Wed, 26 Feb 2020 21:03:39 +0000 (21:03 +0000)]
Merge "ActorService constructor should be public"

4 years agoActorService constructor should be public 37/102437/1
Jim Hahn [Wed, 26 Feb 2020 18:37:21 +0000 (13:37 -0500)]
ActorService constructor should be public

Now that ActorService is no longer a singleton, the constructor
should be public so other classes can create an instance.
Also added a test to verify that each ActorService instance gets
its own instances of the actors.

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I78cabecc0ca6b355696a5d27489a4e59b6e7c012

4 years agoCustom Query should always use vserver 25/102425/2
Jim Hahn [Wed, 26 Feb 2020 16:07:35 +0000 (11:07 -0500)]
Custom Query should always use vserver

Modified the Custom Query Operation to ignore the target entity
passed via the "params" and always use the vserver name found in
the enrichment data.

Issue-ID: POLICY-2349
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: If2c45df2d0377ca08059bdbfa0bcc3d3f043c5b9

4 years agoMerge "Add actor for CDS"
Liam Fallon [Wed, 26 Feb 2020 15:37:35 +0000 (15:37 +0000)]
Merge "Add actor for CDS"

4 years agoMerge "Remove ActorService singleton"
Ram Krishna Verma [Wed, 26 Feb 2020 14:14:58 +0000 (14:14 +0000)]
Merge "Remove ActorService singleton"

4 years agoEliminate a couple more xxxAsync calls in Actors 49/102349/2
Jim Hahn [Tue, 25 Feb 2020 23:33:47 +0000 (18:33 -0500)]
Eliminate a couple more xxxAsync calls in Actors

Eliminated a few more xxxAsync calls in Actors.  Now, the remaining
xxxAsync calls are necessary so that the callbacks are executed using
the executor specified via the "params".

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ia4ff758f71f8bbe014ae5b1a58d8439c0d4ea2ed

4 years agoMerge "Add "disabled" property to Guard Actor"
Ram Krishna Verma [Tue, 25 Feb 2020 21:36:18 +0000 (21:36 +0000)]
Merge "Add "disabled" property to Guard Actor"

4 years agoAdd actor for CDS 67/102167/5
Ram Krishna Verma [Fri, 21 Feb 2020 22:24:47 +0000 (17:24 -0500)]
Add actor for CDS

1) Create the operator, operation & manager classes for gRPC request.
2) Use CompletableFuture to track CDS request flow.

Issue-ID: POLICY-2384
Change-Id: I84e30131a69c2d24c1871ceebced2b69194f619c
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
4 years agoMerge "Support separate VF Counts for different Targets"
Pamela Dragosh [Tue, 25 Feb 2020 20:33:49 +0000 (20:33 +0000)]
Merge "Support separate VF Counts for different Targets"

4 years agoRemove ActorService singleton 36/102336/2
Jim Hahn [Tue, 25 Feb 2020 18:53:28 +0000 (13:53 -0500)]
Remove ActorService singleton

The ActorService singleton is not needed at this time, so it was
removed.

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I9b4cbb72cedbeb77b39422e71650ab60c9aec7ec

4 years agoSupport separate VF Counts for different Targets 35/102335/3
Jim Hahn [Tue, 25 Feb 2020 17:29:08 +0000 (12:29 -0500)]
Support separate VF Counts for different Targets

Changed the key by which the VF Count is stored within the context
so that each Target can have its own VF Count.  Also moved VF Count
code from VfModuleCreate to SoOperation, to hide the determination
of the VF Count "key".
Fixed sonar issue about return "null" instead of returning an empty
list - modified the code to use Optional.

Issue-ID: POLICY-2371
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ia23eabea0edf6857372e269a2db1a21e741824c6

4 years agoAdd "disabled" property to Guard Actor 26/102326/2
Jim Hahn [Tue, 25 Feb 2020 15:49:32 +0000 (10:49 -0500)]
Add "disabled" property to Guard Actor

Issue-ID: POLICY-2350
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I3e9c9aae474d4b288a162243bc492b301d1044c0

4 years agoAdd PipelineUtil 73/102273/3
Jim Hahn [Mon, 24 Feb 2020 20:11:35 +0000 (15:11 -0500)]
Add PipelineUtil

Issue-ID: POLICY-2385
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I7745e8286dd6f086941b979f16b2328bfa066788

4 years agoMerge "Move CQ operation name from actor.aai to aai"
Ram Krishna Verma [Tue, 25 Feb 2020 14:37:04 +0000 (14:37 +0000)]
Merge "Move CQ operation name from actor.aai to aai"

4 years agoMove CQ operation name from actor.aai to aai 72/102272/3
Jim Hahn [Mon, 24 Feb 2020 19:37:53 +0000 (14:37 -0500)]
Move CQ operation name from actor.aai to aai

Issue-ID: POLICY-2385
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I12a7d55b118baa5f0f849855fbcf0602a1208b52

4 years agoAdd "finalOutcome" flag to OperationOutcome 67/102267/4
Jim Hahn [Mon, 24 Feb 2020 15:38:07 +0000 (10:38 -0500)]
Add "finalOutcome" flag to OperationOutcome

The Actor clients receive notifications of operation failures, but
no indication if it's the final failure, thus they do not know if
they should progress on to the "failure" policies.

Issue-ID: POLICY-2385
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: If053ed459e1d790e58eca950a8feeabaf4d67a41

4 years agoMerge "Change payload to Map<String,Object> so it's more versatile"
Ram Krishna Verma [Mon, 24 Feb 2020 19:01:23 +0000 (19:01 +0000)]
Merge "Change payload to Map<String,Object> so it's more versatile"

4 years agoFix to avoid ConcurrentModificationException in policy-models 49/102149/3
a.sreekumar [Fri, 21 Feb 2020 14:06:57 +0000 (14:06 +0000)]
Fix to avoid ConcurrentModificationException in policy-models

Change-Id: If911bdd4116b722e13e00199d05b1794de4e79c2
Issue-ID: POLICY-1402
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
4 years agoChange payload to Map<String,Object> so it's more versatile 73/102173/1
Jim Hahn [Fri, 21 Feb 2020 00:08:55 +0000 (19:08 -0500)]
Change payload to Map<String,Object> so it's more versatile

This was supposed to be two separate commits, but I goofed something.

Added guard query to Operation superclass.  Modified VfModuleCreate
to store the VF count, pass it to the guard, and bump it once the
create completes successfully.
Added code to check Actors for proper plug-in to ActorService.
Renamed "operation" property to "operations", to be more consistent
with other parameters (e.g., TopicParameterGroup).
The META-INF/services files for the actors had mixed case, which
did not match the package name of the Actor class, preventing the
ServiceLoader from recognizing them.  Also modified the ActorService
to skip any that cannot actually be loaded, for whatever reason
(e.g., not in the classpath).

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ifa97744543f2866cc553138ec5ec644b033de780

4 years agoModifications in vDNS tosca policies to match spec 65/102165/2
jhh [Fri, 21 Feb 2020 21:19:12 +0000 (15:19 -0600)]
Modifications in vDNS tosca policies to match spec

Issue-ID: POLICY-2383
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I875612ab47dd35277426fd9ec81d2e5e00188355
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoChanged the encoding scheme for native xacml policy string 60/102160/1
Chenfei Gao [Fri, 21 Feb 2020 17:20:49 +0000 (12:20 -0500)]
Changed the encoding scheme for native xacml policy string

Issue-ID: POLICY-2182
Change-Id: I47dc7253b2ffb325a4a2a873d66499634ae23d16
Signed-off-by: Chenfei Gao <cgao@research.att.com>
4 years agoMerge "More actor clean-up"
Ram Krishna Verma [Fri, 21 Feb 2020 15:37:22 +0000 (15:37 +0000)]
Merge "More actor clean-up"

4 years agoCorrections in vCPE and vFW tosca to match spec. 96/102096/2
jhh [Thu, 20 Feb 2020 21:40:08 +0000 (15:40 -0600)]
Corrections in vCPE and vFW tosca to match spec.

Issue-ID: POLICY-2375
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Ibffc67dd0b68da8597a5fdff7c65321ef4313352
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMore actor clean-up 95/102095/1
Jim Hahn [Thu, 20 Feb 2020 14:40:14 +0000 (09:40 -0500)]
More actor clean-up

Currently, Operator classes refer to Operation classes, and
vice versa, creating a dependency cycle.  In addition, there is
a slight problem in that if an operator is reconfigured, any
running operation may get inconsistent configuration data.
Modified the code to create Config objects that are passed to
the operation, instead of passing the Operator to the operations.
This solved both issues.

Replaceed makeOperator() with constructors.
Added parameter type to HttpActors.

Modified guard to get "ONAP" properties from its configuration,
as a default.

Changed setUp() to setUpBasic(), so "throws Exception" could be
removed, thus resolving a sonar issue.

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I21eb8798acfbc636ff1bd8741b21c7278365b6e4

4 years agoMerge "Add Guard Actor"
Jorge Hernandez [Thu, 20 Feb 2020 16:50:04 +0000 (16:50 +0000)]
Merge "Add Guard Actor"

4 years agoMerge "Minor fix to avoid ConcurrentModificationException in policy-models"
Pamela Dragosh [Thu, 20 Feb 2020 15:42:37 +0000 (15:42 +0000)]
Merge "Minor fix to avoid ConcurrentModificationException in policy-models"

4 years agoMerge "Add SO actor"
Liam Fallon [Thu, 20 Feb 2020 13:16:30 +0000 (13:16 +0000)]
Merge "Add SO actor"

4 years agoMinor fix to avoid ConcurrentModificationException in policy-models 73/102073/2
a.sreekumar [Thu, 20 Feb 2020 11:58:45 +0000 (11:58 +0000)]
Minor fix to avoid ConcurrentModificationException in policy-models

Change-Id: If737f6ae0bcb0f8c694711a67a3c879fee8c11c5
Issue-ID: POLICY-1402
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
4 years agoAdd Guard Actor 25/102025/2
Jim Hahn [Wed, 19 Feb 2020 22:24:11 +0000 (17:24 -0500)]
Add Guard Actor

Issue-ID: POLICY-2350
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ib68c22a1154607563cb8a657b8101757a29b47ef

4 years agoMerge "Fix cascaded get filtering and speed"
Pamela Dragosh [Wed, 19 Feb 2020 17:47:18 +0000 (17:47 +0000)]
Merge "Fix cascaded get filtering and speed"

4 years agoAdd SO actor 38/101938/3
Jim Hahn [Tue, 18 Feb 2020 17:25:37 +0000 (12:25 -0500)]
Add SO actor

Issue-ID: POLICY-2371
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I3faf0276e8039dc43a976d18ff8e704fdbec3d49

4 years agoFix cascaded get filtering and speed 08/102008/2
liamfallon [Wed, 19 Feb 2020 16:54:34 +0000 (16:54 +0000)]
Fix cascaded get filtering and speed

This change adds proper cascading bahaviour to the returned service
template for filtered gets on policies.

It also significantly improves the performance on get operations, all
get operations on the API now result in only one database query.

Issue-ID: POLICY-1402
Change-Id: I7c7d0a8d9f1caf8b610461779e242c34b7f77365
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoValidate request content of various actors 31/101931/3
Jim Hahn [Tue, 18 Feb 2020 20:28:39 +0000 (15:28 -0500)]
Validate request content of various actors

Created common junit superclass, BasicOperation, containing
verifyRequest() method, among others.

Issue-ID: POLICY-2363
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I7ff4428e94bfd301ff4194e1766ef61906714dcf

4 years agoMerge "Actor updates to support SO"
Jim Hahn [Tue, 18 Feb 2020 19:38:13 +0000 (19:38 +0000)]
Merge "Actor updates to support SO"

4 years agoMerge "APPC Actor"
Jim Hahn [Tue, 18 Feb 2020 19:37:52 +0000 (19:37 +0000)]
Merge "APPC Actor"

4 years agoMerge "Add safe entity delete, fix multiple entity get"
Ram Krishna Verma [Tue, 18 Feb 2020 19:14:33 +0000 (19:14 +0000)]
Merge "Add safe entity delete, fix multiple entity get"

4 years agoAPPC Actor 23/101923/2
Jim Hahn [Tue, 18 Feb 2020 17:26:34 +0000 (12:26 -0500)]
APPC Actor

Issue-ID: POLICY-2363
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I21908c9875aa1d2ad3678cb7613b5a3e1fada340

4 years agoActor updates to support SO 25/101925/1
Jim Hahn [Tue, 18 Feb 2020 13:13:45 +0000 (08:13 -0500)]
Actor updates to support SO

Used SuperBuilder in operation Params classes.
Added rawResponse to http setOutcome().
Made HttpOperation.operator private.

Issue-ID: POLICY-2371
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ie894f2e6ae4a31b69a700e425f9e94c5e8a15daa

4 years agoMerge "Allow storing database password in environment variables"
Ram Krishna Verma [Tue, 18 Feb 2020 17:49:40 +0000 (17:49 +0000)]
Merge "Allow storing database password in environment variables"

4 years agoAdd safe entity delete, fix multiple entity get 24/101924/1
liamfallon [Tue, 18 Feb 2020 16:14:59 +0000 (16:14 +0000)]
Add safe entity delete, fix multiple entity get

This review implements checks on whether entities are being used or
referenced propr to allowing deletes.

The review also fixes bugs on multiple entity get returning 4040 not
found

Issue-ID: POLICY-1402
Change-Id: I9cebb9a873098740e9ff4be6284d6307e19838bd
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoMerge "More changes to actor code"
Pamela Dragosh [Tue, 18 Feb 2020 17:14:29 +0000 (17:14 +0000)]
Merge "More changes to actor code"

4 years agoMerge "add unit test for pdpstatistics provider"
Liam Fallon [Tue, 18 Feb 2020 16:13:01 +0000 (16:13 +0000)]
Merge "add unit test for pdpstatistics provider"

4 years agoAdd missing classes to persistence.xml 79/101879/1
liamfallon [Tue, 18 Feb 2020 08:53:02 +0000 (08:53 +0000)]
Add missing classes to persistence.xml

The recent policy-models changes cascade database changes to some new
classes. THis change adds these classes to persistence.xml.

Issue-ID: POLICY-1402
Change-Id: I4d9953c8423dc6e33f6852744c394c9cfbc21ac6
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoMore changes to actor code 59/101859/5
Jim Hahn [Mon, 17 Feb 2020 18:57:56 +0000 (13:57 -0500)]
More changes to actor code

Use Coder.convert() from policy-common.
Passed response to setOutcome().
Changed class names from XxxOperator to XxxOperation.
Modified SDNC junits to invoke start() instead of startOperationAsync().
Changed context obtain() to re-run if the future was canceled.
Added junit support class, BasicBidirectionalTopicOperation.

Modified HttpOperation to allow subsequent requests to be issued.
Some actors, like SO, send an initial HTTP request and then follow
it with HTTP "are you done?" requests.

Issue-ID: POLICY-2363-prop
Change-Id: I12b5c2d4f07254e0cb79fabfe1ccf844b70a0654
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoadd unit test for pdpstatistics provider 20/101720/3
ning.xi [Thu, 13 Feb 2020 10:00:36 +0000 (18:00 +0800)]
add unit test for pdpstatistics provider

Issue-ID: POLICY-2314
Signed-off-by: ning.xi <ning.xi@est.tech>
Change-Id: Ifb23ab301a326cc30950ecc2f115979fa261bc68

4 years agoMerge "Use BidirectionalTopicClient from policy-common"
Jim Hahn [Mon, 17 Feb 2020 22:25:03 +0000 (22:25 +0000)]
Merge "Use BidirectionalTopicClient from policy-common"

4 years agoMerge "Add/Update test cases for PdpStatistics entity"
Pamela Dragosh [Mon, 17 Feb 2020 16:47:37 +0000 (16:47 +0000)]
Merge "Add/Update test cases for PdpStatistics entity"

4 years agoUse BidirectionalTopicClient from policy-common 70/101770/5
Jim Hahn [Fri, 14 Feb 2020 19:22:48 +0000 (14:22 -0500)]
Use BidirectionalTopicClient from policy-common

Also modified "target" to sink in various places, and renamed
various uses of "pair" to "bidirectional" (e.g., TopicPairParams
=> BidirectionalTopicParams).
Also replaced MyExec with PseudoExecutor, from policy-common.
As part of this, extracted the logRequest and logResponse methods
from the Http and Topic classes, moving them into the common
OperationPartial class.
Modified A&AI, SDNC junit tests to use PseudoExecutor.
Added support for incomplete responses on Topics, where multiple
responses may be received for one request
Fixed a duplicate entry in actor.aai pom.

As the changes were already big enough, went ahead and also did the
following to support the APPC Actor:
- Reorganized parameter classes and content.
- Modified anyOf, allOf to take functions instead of futures and handle
  exceptions thrown by any of the functions.  Also added sequence() method.
- Deleted doTask.
- Modified ActorService.config to take a map of maps, not just a map.
- Decided NOT to move anyOf, allOf, and sequence from OperationPartial
  to a utility class, because they depend on "params".

Issue-ID: POLICY-2363
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I5a8bae05dfef22fe71c57c58f265b9dac20df5c5

4 years agoAdd missing entry_schema for operational policy type 30/101630/8
Pamela Dragosh [Wed, 12 Feb 2020 16:35:07 +0000 (11:35 -0500)]
Add missing entry_schema for operational policy type

Also ensure the json for vFirewall matches the yaml. We will
need to clean up some of the other legacy operational policies.
Or at least rename them.

Renamed legacy Operational policies to avoid confusion.

Fixed wrong derived_from policy types.

Operational Policy Types are now solely for new TOSCA compliant
operational policy types.

Issue-ID: POLICY-2146
Change-Id: Ia0bcabe6cca8e197f1bec8157a3004a420033969
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoAdd/Update test cases for PdpStatistics entity 34/101734/2
huaxing [Thu, 13 Feb 2020 03:40:35 +0000 (11:40 +0800)]
Add/Update test cases for PdpStatistics entity

Add test cases for PdpStatistics / PdpEngineWorkerStatistics / JpaPdpStatistics.
Add lombok.Data annotation to PdpStatistics and
PdpEngineWorkerStatistics to facilitate testing.

Issue-ID: POLICY-1628

Signed-off-by: huaxing <huaxing.jin@est.tech>
Change-Id: I4269678641716a56db260ad67a30c97b904123cd

4 years agoFix return building on policy get 99/101799/1
liamfallon [Mon, 17 Feb 2020 00:51:13 +0000 (00:51 +0000)]
Fix return building on policy get

The service template that is being returned for the "get" has to be built
up in the correct order. A policy and the policy types and data types it
is referencing must be added together. Before, all the policies were added
at once and then the policy types and data types for the policies were added
afterwards. This means that if the service template is validated during
the service template build, validation may fail, depending on the order
of building of the template.

Issue-ID: POLICY-1402
Change-Id: Ia4fb9ee3819dccfc8c346c682545b2d27ebc4058
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoMerge "Fix return codes and policy get"
Pamela Dragosh [Fri, 14 Feb 2020 17:53:13 +0000 (17:53 +0000)]
Merge "Fix return codes and policy get"

4 years agoFix return codes and policy get 50/101750/1
liamfallon [Fri, 14 Feb 2020 15:53:50 +0000 (15:53 +0000)]
Fix return codes and policy get

Change the return codes for validation to return more helpful and
correct codes.

Fix the policy "get" request to get policy types and data types for a
policy get.

Issue-ID: POLICY-1402
Change-Id: I89d67f830e9a75bdeef39c4142523c718879f19c
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoAdd Topic Actor superclasses 14/101714/3
Jim Hahn [Thu, 13 Feb 2020 17:34:46 +0000 (12:34 -0500)]
Add Topic Actor superclasses

Issue-ID: POLICY-2363
Change-Id: I5d29d85f6c5f40fb6c8f1bf678d9c718760a7558
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Add A&AI actor and some operators"
Jim Hahn [Thu, 13 Feb 2020 17:16:10 +0000 (17:16 +0000)]
Merge "Add A&AI actor and some operators"

4 years agoAllow storing database password in environment variables 80/101680/1
Dominik Mizyn [Thu, 13 Feb 2020 14:04:53 +0000 (15:04 +0100)]
Allow storing database password in environment variables

This patch allows to store and get database passwor from
environment variables. This is needed if we want to send those
variables by helm secrets.

Issue-ID: OOM-2287
Change-Id: Id9ea8f43dd07c2b0cdeaa6d14a8033336d26923f
Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
4 years agoUpdate models-tosca for hetter handling 74/101674/1
liamfallon [Thu, 13 Feb 2020 13:05:09 +0000 (13:05 +0000)]
Update models-tosca for hetter handling

More additions, updates, and fixes for TOSCA service template handling.
Better handling of 404 not found on list requests.

Issue-ID: POLICY-1402
Change-Id: Id73b9a3cebb5445d4f05ae83e301330ee38a6598
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoAdd A&AI actor and some operators 35/101635/3
Jim Hahn [Wed, 12 Feb 2020 18:01:57 +0000 (13:01 -0500)]
Add A&AI actor and some operators

Added A&AI Actor, as well as operators for the "custom query" and
the "tenant" query (on which the custom query depends).

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ic9dadc07a6057cb1abb9698da86eb9431fc9ed3e

4 years agoMerge "Implement validation and hierarchical get"
Pamela Dragosh [Wed, 12 Feb 2020 19:27:42 +0000 (19:27 +0000)]
Merge "Implement validation and hierarchical get"

4 years agoImplement validation and hierarchical get 44/101544/4
liamfallon [Tue, 11 Feb 2020 16:18:32 +0000 (16:18 +0000)]
Implement validation and hierarchical get

NOTE: This review will require changes to the persistence.xml file in
other policy framework components.

This change brings in two changes:

1) Validation of the references betwen policies, policy types, and data
types

This change mans that additions to and changes to policies, policy
types, and data types must be structurally correct in the change coming
in and with whatever is already in the database

2) Hierarchical return of referenced entitites on policy types,
policies and data types.

When a policy, policy type, or data type is read from the database, the
entities referenced byt the returned policy, policy type, or data type
are returned as well.

Tests are amended for the stricter validation and structure.

Examples are corrected where they are incorrect.

Issue-ID: POLICY-1402
Change-Id: Ie6a4cb7ed336562338924079114df405f0ab889f
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoAdd more code to facilitate actor implementation 02/101502/4
Jim Hahn [Sat, 8 Feb 2020 13:32:59 +0000 (08:32 -0500)]
Add more code to facilitate actor implementation

Added obtain() to Context
Added startGuardAsync(), in anticipation of adding guards.
Moved logRestXxx() from Util to HttpOperation.
Added actor.test to facilitate testing of actors.
Changed timeoutSec from long to int in various places.
Made a couple of methods public to support junit testing.

Most of the methods required Params to be passed, which indicated a
design issue.  Split Operator and Operation so that the Params could
be kept in a field and thus need not be passed to every method.
Basically, renamed OperatorPartial.java to OperationPartial.java and
created a new OperatorPartial.java.  Of course, this makes it look to
gerrit like it's all new code, when in fact, most of it is unchanged,
other than removing the Params argument to the method calls.  That
accounts for about half of the "lines changed" count.

Issue-ID: POLICY-1625
Change-Id: I9e98c9dadcbed145bf84deb06c9db1c864a3c24a
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoGet the tree of parent entities for an entity in a container 85/101485/1
liamfallon [Mon, 10 Feb 2020 15:23:33 +0000 (15:23 +0000)]
Get the tree of parent entities for an entity in a container

Utilityu method to filter out all bit an entity and its parents from a
service template entity container.

Issue-ID: POLICY-1402
Change-Id: I8c3b4c21b27fd8787cdfde0e1b726646f52c437b
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoMerge "Add data type and policy type reference checking"
Jim Hahn [Mon, 10 Feb 2020 12:31:03 +0000 (12:31 +0000)]
Merge "Add data type and policy type reference checking"

4 years agoClean up and enhancement of Actor re-design 59/101359/2
Jim Hahn [Fri, 7 Feb 2020 02:48:12 +0000 (21:48 -0500)]
Clean up and enhancement of Actor re-design

Added junits for the remaining code.

Enhancements to facilitate implementation of Operators:
- Added allOf(), anyOf() facilities
- Added AsyncResponseHandler for handling asynchronous I/O via the
  HttpClient
- Added logRestRequest() and logRestResponse() for logging REST
  requests and responses
- Added HttpActor and HttpOperator, which can be used as superclasses
- Added doTask()
- Lifted data from the event into ControlLoopEventContext

Updates per previous review comments:
- Changed logException() to runFunction().
- Removed the aaiCqResponse field.
- Lifted fields from Policy into ControlLoopOperationParams, eliminating
  the need to include Policy in the class.

OperatorPartial depends on the string values in the ControlLoopOperation
being set to one of the string values of PolicyResult.  Instead of
passing ControlLoopOperation around, the operators should pass around
an object that uses PolicyResult directly, rather than depending on
the string values being set correctly.  Created OperationOutcome for
this purpose.
Stop pipeline when the controller completes.
Use whenComplete() where appropriate.
startOperationAsync() should not block.  Modified it to launch the task
in the background via its own thread.
Extracted CallbackManager into its own file.
Replaced actor setOperators() with addOperator()
Renamed add() to wrap(), and modified it to remove the future when it
completes.
Fixed the signature on delayedRemove() and delayedComplete().
Replaced xxxAsync() calls with just xxx() calls, where appropriate to
avoid the extra overhead of submitting it to a work queue.
Renamed handleFailure() to handlePreprocessorFailure().
Updates per WIP review comments

Issue-ID: POLICY-1625
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Id4c4c7ade979bdb76cc54266837609cc69a22c58

4 years agoMerge "Change recipe to operation to match type"
Ram Krishna Verma [Fri, 7 Feb 2020 18:06:42 +0000 (18:06 +0000)]
Merge "Change recipe to operation to match type"

4 years agoAdd data type and policy type reference checking 74/101374/1
liamfallon [Thu, 6 Feb 2020 17:32:48 +0000 (17:32 +0000)]
Add data type and policy type reference checking

Full validation including references to policy types and data types
added. Unit tests fixed to cope with new stricter validation.

Issue-ID: POLICY-1402
Change-Id: I59f37640a99494a53960a54d2fc82cc96861d43b
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoChange recipe to operation to match type 84/101284/2
jhh [Thu, 6 Feb 2020 21:03:54 +0000 (15:03 -0600)]
Change recipe to operation to match type

Issue-ID: POLICY-2345
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I4a79459cf7dfdccd7d9d88ec983afb6bce746493
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMerge "Actor redesign."
Jim Hahn [Thu, 6 Feb 2020 18:55:49 +0000 (18:55 +0000)]
Merge "Actor redesign."

4 years agoAdd vaidation for entity hierarchies 25/101125/2
liamfallon [Tue, 4 Feb 2020 15:45:58 +0000 (15:45 +0000)]
Add vaidation for entity hierarchies

This change brings in proper hierarchical checks for service templates,
making sure that all parents of data types, policy types, and policies
must be in place.

Issue-ID: POLICY-1402
Change-Id: I61b1b556403f74aeaa092f0d4d6ed19bf6a0b715
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoMerge "Add merge utility for service templates"
Ram Krishna Verma [Tue, 4 Feb 2020 15:40:22 +0000 (15:40 +0000)]
Merge "Add merge utility for service templates"

4 years agoAdd merge utility for service templates 53/101053/6
liamfallon [Mon, 3 Feb 2020 14:37:33 +0000 (14:37 +0000)]
Add merge utility for service templates

This utility function allows a TOSCA service template fragment to be
merged with an exsiting service template and will be tbe backbone of
"create" methods on the API from now on.

Issue-ID: POLICY-1402
Change-Id: I3381cb2a1bd30621a639dedc213c546eeb2bf9aa
Signed-off-by: liamfallon <liam.fallon@est.tech>