Outline PDP-D new policy types in design doc.
[policy/parent.git] / docs / design / design.rst
index cceba0f..190758c 100644 (file)
@@ -58,16 +58,20 @@ integration of *PolicyTypeImpl* implementation is outside the scope of the ONAP
 The *PolicyType* definitions and implementations listed below are preloaded and are always available for use in the
 Policy Framework.
 
-====================================== ===============================================================================
-**Policy Type**                        **Description**
-====================================== ===============================================================================
-onap.policies.Monitoring               Overarching model that supports Policy driven DCAE microservice components used
-                                       in a Control Loops
-onap.policies.controlloop.Operational  Used to support actor/action operational policies for control loops
-onap.policies.controlloop.Guard        Control Loop guard policies for policing control loops
-onap.policies.controlloop.Coordination Control Loop Coordination policies to assist in coordinating multiple control
-                                       loops at runtime
-====================================== ===============================================================================
+=======================================  ===============================================================================
+**Policy Type**                          **Description**
+=======================================  ===============================================================================
+onap.policies.Monitoring                 Overarching model that supports Policy driven DCAE microservice components used
+                                         in Control Loops
+onap.policies.controlloop.Operational    Used to support legacy actor/action operational policies for control loops
+onap.policies.controlloop.Guard          Control Loop guard policies for policing control loops
+onap.policies.controlloop.Coordination   Control Loop Coordination policies to assist in coordinating multiple control
+                                         loops at runtime
+onap.policies.controlloop.common.Drools  Used to support tosca compliant actor/action  operational policies for control
+                                         loops
+onap.policies.native.drools.Controller   Used to support the definition of PDP-D controllers
+onap.policies.native.drools.Artifact     Used to associate application's software with a PDP-D controller
+=======================================  ===============================================================================
 
 2.1 Policy Type: onap.policies.Monitoring
 -----------------------------------------
@@ -213,6 +217,38 @@ Guard policy type definitions for *FrequencyLimiter*, *BlackList*, and  *MinMax*
 policy-models gerrit repository
 <https://github.com/onap/policy-models/tree/master/models-examples/src/main/resources/policytypes>`__.
 
+2.4 Policy Type: onap.policies.controlloop.common.Drools
+--------------------------------------------------------
+
+This policy type supports composition of Tosca-compliant Operational Policies for the PDP-D.  The
+`onap.policies.controlloop.common.Drools policy type specification
+<https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policytypes/onap.policies.controlloop.operational.common.Drools.yaml>`__ is preferred for composition of operational
+policies over its `onap.policies.controlloop.Operational policy type specification
+<https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policytypes/onap.policies.controlloop.Operational.yaml>`__ precursor, which eventually will be deprecated.
+Both policy types are functionally equivalent.
+
+2.5 Policy Type: onap.policies.native.drools.Controller
+-------------------------------------------------------
+
+This policy type supports creation of native PDP-D controllers via policy.   A controller is an abstraction on
+the PDP-D that groups communication channels, message mapping rules, and
+any other arbitrary configuration data to realize an application.
+
+Policies of this type are composed against the
+`onap.policies.native.drools.Controller policy type specification
+<https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policytypes/onap.policies.native.Drools.yaml>`__ specification.
+
+2.6 Policy Type: onap.policies.native.drools.Artifact
+-------------------------------------------------------
+
+This policy type supports the dynamic association of a native PDP-D controller with rules and dependent
+java libraries.   This policy type is used in conjuction with the onap.policies.native.drools.Controller
+type to create or upgrade a drools application on a live PDP-D.
+
+Policies of this type are composed against the
+`onap.policies.native.drools.Controller policy type specification
+<https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policytypes/onap.policies.native.Drools.yaml>`__ specification.
+
 3 PDP Deployment and Registration with PAP
 ==========================================
 
@@ -396,7 +432,10 @@ pdp_subgroups                R       M        N/A        A list of PDP subgroups
 ->pdp_type                   R       M        N/A        The PDP type of this PDP subgroup, currently xacml, drools, or
                                                          apex
 ->supported_policy_types     R       N/A      N/A        A list of the policy types supported by the PDPs in this PDP
-                                                         subgroup
+                                                         subgroup.  A trailing “.*” can be used to specify multiple
+                                                         policy types; for example, “onap.policies.monitoring.*”
+                                                         would match any policy type beginning with
+                                                         “onap.policies.monitoring.”
 ->policies                   R       M        N/A        The list of policies running on the PDPs in this PDP subgroup
 ->->(name)                   R       M        N/A        The name of a TOSCA policy running in this PDP subgroup
 ->->policy_type              R       N/A      N/A        The TOSCA policy type of the policy
@@ -449,7 +488,12 @@ action        R       String   The action that the ONAP component is performing
 
 These sub metadata structures are used to scope the resource the ONAP component is performing an action upon. At least
 one must be specified in order for Policy to return a decision. Multiple structures may be utilized to help define a
-precise scope for a decision.
+precise scope for a decision. 
+
+4.4.1 Policy Decision API - DCAE configuration examples
+-------------------------------------------------------
+
+These resource fields are examples on how DCAE implements its "configure" application to make Decision API calls.
 
 ================= ======= ======== ==================================================================
 **Field**         **R/O** **Type** **Description**
@@ -795,5 +839,96 @@ This example below shows the JSON body of a query to return all the deployed pol
     }
   }
 
-End of Document
+4.4.2 Policy Decision API - Guard Decision API examples
+-------------------------------------------------------
+
+These resource fields are examples on how Drools-PDP implements its "guard" application to make Decision API calls. This
+structure is a transition from the legacy guard API calls. So each of these resources are contained under a "guard" object
+in the "resource" object of the JSON structure.
+
+================= ======= ======== ==================================================================
+**Field**         **R/O** **Type** **Description**
+================= ======= ======== ==================================================================
+actor             O       String   The actor (eg APPC, SO) that is performing a recipe 
+recipe            O       String   The recipe (eg Restart, Reboot) that the actor going to execute
+clname            O       String   The unique ID for the Control Loop
+target            O       String   The target VNF the actor is executing the recipe on
+vfCount           O       String   Specific to SO "VF Module Create" - the current count of VNFs
+
+================= ======= ======== ==================================================================
+
+This example below shows the JSON body of a guard Decision API call.
+
+.. code-block:: json
+  :caption: Decision API Call - Guard
+  :linenos:
+
+  {
+    "ONAPName": "Policy",
+    "ONAPComponent": "drools-pdp",
+    "ONAPInstance": "usecase-template",
+    "requestId": "unique-request-id-1",
+    "action": "guard",
+    "resource": {
+        "guard": {
+            "actor": "SO",
+            "recipe": "VF Module Create",
+            "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+            "target": "vLoadBalancer-00",
+            "vfCount": "1"
+        }
+    }
+  }
+
+.. code-block:: json
+  :caption: Decision Response - Guard
+  :linenos:
+
+  {"status":"Permit"}
+
+4.4.3 Policy Decision API - Optimize Decision API examples
+----------------------------------------------------------
+
+These resource fields are examples on how OOF project will make Decision API calls. NOTE: The OOF project
+has not yet upgraded to the API. This work is scheduled for Frankfurt.
+
+================= ======= ============== ==================================================================
+**Field**         **R/O** **Type**       **Description**
+================= ======= ============== ==================================================================
+scope             O       List of String   Optional scope for the policy.
+services          O       List of String   One or more services the policy applies to.
+resources         O       List of String   The unique ID for the Control Loop
+geography         O       List of String   The target VNF the actor is executing the recipe on
+
+================= ======= ============== ==================================================================
+
+This example below shows the JSON body of an Optimize Decision API call.
+
+.. code-block:: json
+  :caption: Decision API Call - Optimize vCPE service in US
+  :linenos:
 
+  {
+    "ONAPName": "OOF",
+    "ONAPComponent": "OOF-component",
+    "ONAPInstance": "OOF-component-instance",
+    "action": "optimize",
+    "resource": {
+        "scope": [],
+        "services": ["vCPE"],
+        "resources": [],
+        "geography": ["US"]
+    }
+  }
+
+.. code-block:: json
+  :caption: Decision Response - 
+  :linenos:
+
+  {
+    "policies:"  {
+        ### Omitted for brevity
+    }
+  }
+
+End of Document