5 Policy Design and API Flow for Model Driven Control Loop
6 ========================================================
8 This page shows how the Policy Design and API Flow to/from the PAP and
9 PDPs works to support Model Driven Control Loops in Dublin.
11 - `1 Policy Types <#PolicyDesignandAPIFlowforModelDrivenCon>`__
13 - `1.1 onap.policies.Monitoring Policy
14 Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
16 - `1.2 onap.policies.controlloop.Operational Policy
17 Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
19 - `1.2.1 Operational Policy Type Schema for
20 Drools <#PolicyDesignandAPIFlowforModelDrivenCon>`__
22 - `1.2.3 Operational Policy Type Schema for APEX (El Alto
23 proposal) <#PolicyDesignandAPIFlowforModelDrivenCon>`__
25 - `1.3 onap.policies.controlloop.Guard Policy
26 Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
28 - `1.3.1 onap.policies.controlloop.guard.FrequencyLimiter Policy
29 Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
31 - `1.3.2 onap.policies.controlloop.guard.Blacklist Policy
32 Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
34 - `1.3.3 onap.policies.controlloop.guard.MinMax Policy
35 Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
37 - `1.3.4 onap.policies.controlloop.Coordination Policy Type
38 (STRETCH) <#PolicyDesignandAPIFlowforModelDrivenCon>`__
40 - `2 PDP Deployment and Registration with
41 PAP <#PolicyDesignandAPIFlowforModelDrivenCon>`__
43 - `3. Public APIs <#PolicyDesignandAPIFlowforModelDrivenCon>`__
45 - `3.1 Policy Type Design API for TOSCA Policy
46 Types <#PolicyDesignandAPIFlowforModelDrivenCon>`__
49 query <#PolicyDesignandAPIFlowforModelDrivenCon>`__
52 Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
55 Delete <#PolicyDesignandAPIFlowforModelDrivenCon>`__
58 API <#PolicyDesignandAPIFlowforModelDrivenCon>`__
61 query <#PolicyDesignandAPIFlowforModelDrivenCon>`__
64 Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
66 - `3.2.2.1 Monitoring Policy
67 Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
69 - `3.2.2.2.1 Drools Operational Policy
70 Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
72 - `3.2.2.2.2 APEX Operational Policy
73 Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
75 - `3.2.2.3 Guard Policy
76 Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
78 - `3.2.2.4 Policy Lifecycle API - Creating Coordination
79 Policies <#PolicyDesignandAPIFlowforModelDrivenCon>`__
82 Delete <#PolicyDesignandAPIFlowforModelDrivenCon>`__
84 - `3.3 Policy Administration
85 API <#PolicyDesignandAPIFlowforModelDrivenCon>`__
88 Query <#PolicyDesignandAPIFlowforModelDrivenCon>`__
91 Deployment <#PolicyDesignandAPIFlowforModelDrivenCon>`__
93 - `Simple API for CLAMP to deploy one or more policy-id's with
95 policy-version. <#PolicyDesignandAPIFlowforModelDrivenCon>`__
97 - `Simple API for CLAMP to undeploy a policy-id with optional
98 policy-version. <#PolicyDesignandAPIFlowforModelDrivenCon>`__
101 Delete <#PolicyDesignandAPIFlowforModelDrivenCon>`__
103 - `3.3.4 PDP Group State
104 Management <#PolicyDesignandAPIFlowforModelDrivenCon>`__
107 Statistics <#PolicyDesignandAPIFlowforModelDrivenCon>`__
109 - `3.3.6 PDP Group Health
110 Check <#PolicyDesignandAPIFlowforModelDrivenCon>`__
112 - `3.4 Policy Decision API - Getting Policy
113 Decisions <#PolicyDesignandAPIFlowforModelDrivenCon>`__
115 - `3.4.1 Decision API
116 Schema <#PolicyDesignandAPIFlowforModelDrivenCon>`__
118 - `3.4.2 Decision API
119 Queries <#PolicyDesignandAPIFlowforModelDrivenCon>`__
121 - `4. Policy Framework Internal
122 APIs <#PolicyDesignandAPIFlowforModelDrivenCon>`__
124 - `4.1 PAP to PDP API <#PolicyDesignandAPIFlowforModelDrivenCon>`__
127 PDPs <#PolicyDesignandAPIFlowforModelDrivenCon>`__
130 PAPs <#PolicyDesignandAPIFlowforModelDrivenCon>`__
133 Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
136 Change <#PolicyDesignandAPIFlowforModelDrivenCon>`__
138 - `4.1.2.3 PDP Health
139 Check <#PolicyDesignandAPIFlowforModelDrivenCon>`__
141 - `4.2 Policy Type Implementations (Native
142 Policies) <#PolicyDesignandAPIFlowforModelDrivenCon>`__
144 - `4.2.1 Policy Type Implementation
145 Query <#PolicyDesignandAPIFlowforModelDrivenCon>`__
147 - `4.2.2 Policy Type Implementation
148 Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
150 - `4.2.3 Policy Type Implementation
151 Delete <#PolicyDesignandAPIFlowforModelDrivenCon>`__
153 The figure below shows the Artifacts (Blue) in the ONAP Policy
154 Framework, the Activities (Yellow) that manipulate them, and important
155 components (Pink) that interact with them.
157 Please see the :ref:`TOSCA Policy
158 Primer <tosca-policy>`__ page for an
159 introduction to TOSCA policy concepts.
161 TOSCA defines a *PolicyType*, the definition of a type of policy that
162 can be applied to a service. It also defines a *Policy*, the definition
163 of an instance of a *PolicyType*. In the Policy Framework, we must
164 handle and manage these TOSCA definitions and tie them to real
165 implementations of policies that can run on PDPs.
167 The diagram above outlines how this is achieved. Each TOSCA *PolicyType*
168 must have a corresponding *PolicyTypeImpl* in the Policy Framework. The
169 TOSCA \ *PolicyType* definition can be used to create a TOSCA *Policy*
170 definition, either directly by the Policy Framework, by CLAMP, or by
171 some other system. Once the \ *Policy* artifact exists, it can be used
172 together with the *PolicyTypeImpl* artifact to create a *PolicyImpl*
173 artifact. A *PolicyImpl* artifact is an executable policy implementation
174 that can run on a PDP.
176 The TOSCA *PolicyType* artifact defines the external characteristics of
177 the policy; defining its properties, the types of entities it acts on,
178 and its triggers. A *PolicyTypeImpl* artifact is an XACML, Drools, or
179 APEX implementation of that policy definition. *PolicyType* and
180 *PolicyTypeImpl* artifacts may be preloaded, may be loaded manually, or
181 may be created using the Lifecycle API. Alternatively, *PolicyType*
182 definitions may be loaded over the Lifecycle API for preloaded
183 *PolicyTypeImpl* artifacts. A TOSCA *PolicyType* artifact can be used by
184 clients (such as CLAMP or CLI tools) to create, parse, serialize, and/or
185 deserialize an actual Policy.
187 The TOSCA *Policy* artifact is used internally by the Policy Framework,
188 or is input by CLAMP or other systems. This artifact specifies the
189 values of the properties for the policy and specifies the specific
190 entities the policy acts on. Policy Design uses the TOSCA *Policy*
191 artifact and the *PolicyTypeImpl* artifact to create an executable
192 *PolicyImpl* artifact.
197 Policy Type Design manages TOSCA *PolicyType* artifacts and their
198 *PolicyTypeImpl* implementations\ *.*
200 *TOSCA PolicyType* may ultimately be defined by the modeling team but
201 for now are defined by the Policy Framework project. Various editors and
202 GUIs are available for creating *PolicyTypeImpl* implementations.
203 However, systematic integration of *PolicyTypeImpl* implementation is
204 outside the scope of the ONAP Dublin release.
206 The \ *PolicyType* definitions and implementations listed below are
207 preloaded and are always available for use in the Policy Framework.
209 ====================================== ==================================================================================================
210 **Policy Type** **Description**
211 ====================================== ==================================================================================================
212 onap.policies.Monitoring Overarching model that supports Policy driven DCAE microservice components used in a Control Loops
213 onap.policies.controlloop.Operational Used to support actor/action operational policies for control loops
214 onap.policies.controlloop.Guard Control Loop guard policies for policing control loops
215 onap.policies.controlloop.Coordination Control Loop Coordination policies to assist in coordinating multiple control loops at runtime
216 ====================================== ==================================================================================================
218 1.1 onap.policies.Monitoring Policy Type
219 ----------------------------------------
221 This is a base Policy Type that supports Policy driven DCAE microservice
222 components used in a Control Loops. The implementation of this Policy
223 Type is developed using the XACML PDP to support question/answer Policy
224 Decisions during runtime for the DCAE Policy Handler.
226 **Base Policy Type definition for onap.policies.Monitoring**
230 tosca_definitions_version: tosca_simple_yaml_1_0_0
233 - onap.policies.Monitoring:
234 derived_from: tosca.policies.Root
236 description: a base policy type for all policies that govern monitoring provision
238 The \ *PolicyTypeImpl* implementation of the *onap.policies.Montoring*
239 Policy Type is generic to support definition of TOSCA *PolicyType*
240 artifacts in the Policy Framework using the Policy Type Design API.
241 Therefore many TOSCA *PolicyType* artifacts will use the same
242 *PolicyTypeImpl* implementation with different property types and
243 towards different targets. This allows dynamically generated DCAE
244 microservice component Policy Types to be created at Design Time.
246 DCAE microservice components can generate their own TOSCA \ *PolicyType*
247 using TOSCA-Lab Control Loop guard policies in SDC (Stretch Goal) or can
248 do so manually. See `How to generate artefacts for SDC catalog using
250 Tool <file://localhost/display/DW/How+to+generate+artefacts+for+SDC+catalog+using+Tosca+Lab+Tool>`__
251 for details on TOSCA-LAB in SDC. For Dublin, the DCAE team is defining
252 the manual steps required to build policy models \ `Onboarding steps for
253 DCAE MS through SDC/Policy/CLAMP
254 (Dublin) <file://localhost/pages/viewpage.action%3fpageId=60883710>`__.
256 NOTE: For Dublin, mS Policy Types will be pre-loaded into the SDC
257 platform and be available as a Normative. The policy framework will
258 pre-load support for those mS Monitoring policy types.
260 **PolicyType onap.policies.monitoring.MyDCAEComponent derived from
261 onap.policies.Monitoring** Expand source
263 tosca_definitions_version: tosca_simple_yaml_1_0_0
267 - onap.policies.Monitoring:
269 derived_from: tosca.policies.Root
273 description: a base policy type for all policies that govern monitoring
276 - onap.policies.monitoring.MyDCAEComponent:
278 derived_from: onap.policies.Monitoring
284 mydcaecomponent_policy:
288 description: The Policy Body I need
292 type: onap.datatypes.monitoring.mydatatype
296 - onap.datatypes.monitoring.MyDataType:
298 derived_from: tosca.datatypes.Root
306 description: A description of this property
316 TCA Example - Please note that the official version of this will be
317 located in the SDC repository.
319 **Example TCA DCAE microservice** Expand source
321 tosca_definitions_version: tosca_simple_yaml_1_0_0
325 onap.policies.Monitoring:
327 derived_from: tosca.policies.Root
329 description: a base policy type for all policies that governs monitoring
332 onap.policy.monitoring.cdap.tca.hi.lo.app:
334 derived_from: onap.policies.Monitoring
344 description: TCA Policy JSON
348 type: onap.datatypes.monitoring.tca_policy
352 onap.datatypes.monitoring.metricsPerEventName:
354 derived_from: tosca.datatypes.Root
358 controlLoopSchemaType:
364 description: Specifies Control Loop Schema Type for the event Name e.g.
381 description: Event name to which thresholds need to be applied
389 description: TCA Policy Scope Name
397 description: TCA Policy Scope
405 description: TCA Policy Scope Version
413 description: Thresholds associated with eventName
417 type: onap.datatypes.monitoring.thresholds
419 onap.datatypes.monitoring.tca_policy:
421 derived_from: tosca.datatypes.Root
431 description: Domain name to which TCA needs to be applied
433 default: measurementsForVfScaling
437 - equal: measurementsForVfScaling
445 description: Contains eventName and threshold details that need to be
446 applied to given eventName
450 type: onap.datatypes.monitoring.metricsPerEventName
452 onap.datatypes.monitoring.thresholds:
454 derived_from: tosca.datatypes.Root
458 closedLoopControlName:
464 description: Closed Loop Control Name associated with the threshold
466 closedLoopEventStatus:
472 description: Closed Loop Event Status of the threshold
488 description: Direction of the threshold
510 description: Json field Path as per CEF message which needs to be
518 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta
521 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta
524 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta
527 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta
530 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta
533 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta
536 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta
539 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated
542 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated
545 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated
548 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated
551 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated
554 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated
557 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated
560 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta
563 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta
566 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta
569 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta
572 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta
575 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta
578 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta
581 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated
584 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated
587 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated
590 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated
593 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated
596 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated
599 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated
601 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle
604 $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt
606 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice
609 $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq
611 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal
613 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem
615 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait
617 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage
619 - $.event.measurementsForVfScalingFields.meanRequestLatency
622 $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered
625 $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached
628 $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured
630 - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree
632 - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed
635 $.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value
643 description: Threshold Event Severity
665 description: Threshold value for the field Path inside CEF message
673 description: Version number associated with the threshold
675 1.2 onap.policies.controlloop.Operational Policy Type
676 -----------------------------------------------------
678 This policy type is used to support actor/action operational policies
679 for control loops. There are two types of implementations for this
682 1. Existing Drools implementations that supports runtime Control Loop
683 actions taken on components such as SO/APPC/VFC/SDNC/SDNR
685 2. New implementations using APEX to support Control Loops.
687 For Dublin, this policy type will ONLY be used for the Policy Framework
688 to distinguish the policy type as operational. The contents are still
691 **Base Policy type definition for
692 onap.policies.controlloop.Operational** Expand source
694 tosca_definitions_version: tosca_simple_yaml_1_0_0
698 onap.policies.controlloop.Operational:
700 derived_from: tosca.policies.Root
704 description: Operational Policy for Control Loops
706 Applications should use the following Content-Type when creating
707 onap.policies.controlloop.Operational policies:
709 Content-Type: "application/yaml; vnd.onap.operational"
711 1.2.1 Operational Policy Type Schema for Drools
712 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
714 For Dublin Drools will still support the Casablanca YAML definition of
715 an Operational Policy for Control Loops.
717 Please use the Casablanca version of the YAML Operational Policy format
718 defined \ https://git.onap.org/policy/drools-applications/tree/controlloop/common/policy-yaml/README-v2.0.0.md.
720 1.2.3 Operational Policy Type Schema for APEX (El Alto proposal)
721 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
723 The operational Policy Type schema for for APEX will extend the base
724 operational Policy Type schema. This Policy Type allows parameters
725 specific to the APEX PDP to be specified as a TOSCA policy.
727 **Operational Policy Model Parameter Schema for APEX** Expand source
729 tosca_definitions_version: tosca_simple_yaml_1_0_0
731 # Note: The full APEX PolicyType definition will be developed during the
734 # timeframe of the ONAP project
738 onap.policies.controlloop.Operational:
740 derived_from: tosca.policies.Root
744 description: Operational Policy for Control Loops
746 onap.policies.controloop.operational.Apex:
748 derived_from: onap.policies.controlloop.Operational
752 description: Operational Policy for Control Loops using the APEX PDP
756 # Some of these properties may be redundant in a Kubernetes deployment
760 type: onap.datatypes.policies.controlloop.operational.apex.EngineService
762 description: APEX Engine Service Parameters
768 description: Inputs for handling events coming into the APEX engine
772 type: onap.datatypes.policies.controlloop.operational.apex.EventHandler
778 description: Outputs for handling events going out of the APEX engine
782 type: onap.datatypes.policies.controlloop.operational.apex.EventHandler
788 description: Envioronmental parameters for the APEX engine
792 type: onap.datatypes.policies.controlloop.operational.apex.Environment
796 onap.datatypes.policies.controlloop.operational.apex.EngineService:
798 derived_from: tosca.datatypes.Root
806 description: Specifies the engine name
810 default: "ApexEngineService"
816 description: Specifies the engine version in double dotted format
826 description: Specifies the engine id
834 description: Specifies the number of engine threads that should be run
842 description: Specifies the port to connect to for engine administration
848 policy_model_file_name:
852 description: The name of the file from which to read the APEX policy
863 description: The policy type implementation from which to read the APEX
870 periodic_event_period:
874 description: The time interval in milliseconds for the periodic scanning
876 event, 0 means "don't scan"
885 onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine
887 description: The parameters for all engines in the APEX engine service
891 onap.datatypes.policies.controlloop.operational.apex.EventHandler:
893 derived_from: tosca.datatypes.Root
901 description: Specifies the event handler name, if not specified this is
911 onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology
913 description: Specifies the carrier technology of the event handler (such
915 as REST/Web Socket/Kafka)
921 type: onap.datatypes.policies.controlloop.operational.apex.EventProtocol
923 description: Specifies the event protocol of events for the event
926 (such as Yaml/JSON/XML/POJO)
934 description: Specifies the event name for events on this event handler,
937 not specified, the event name is read from or written to the event being
947 description: Specifies a filter as a regular expression, events that do
949 not match the filter are dropped, the default is to let all events
959 description: Specifies the event handler is syncronous (receive event
972 description: The peer event handler (output for input or input for
975 of this event handler in synchronous mode, this parameter is mandatory
978 the event handler is in synchronous mode
988 description: The timeout in milliseconds for responses to be issued by
990 APEX torequests, this parameter is mandatory if the event handler is in
1002 description: Specifies the event handler is in requestor mode (send
1005 and wait for response mode)
1015 description: The peer event handler (output for input or input for
1018 of this event handler in requestor mode, this parameter is mandatory if
1020 the event handler is in requestor mode
1030 description: The timeout in milliseconds for wait for responses to
1032 requests, this parameter is mandatory if the event handler is in
1040 onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology:
1042 derived_from: tosca.datatypes.Root
1050 description: The label (name) of the carrier technology (such as REST,
1056 plugin_parameter_class_name:
1060 description: The class name of the class that overrides default handling
1062 of event input or output for this carrier technology, defaults to the
1065 input or output class
1069 onap.datatypes.policies.controlloop.operational.apex.EventProtocol:
1071 derived_from: tosca.datatypes.Root
1079 description: The label (name) of the event protocol (such as Yaml,
1085 event_protocol_plugin_class:
1089 description: The class name of the class that overrides default handling
1091 of the event protocol for this carrier technology, defaults to the
1093 supplied event protocol class
1097 onap.datatypes.policies.controlloop.operational.apex.Environmental:
1099 derived_from: tosca.datatypes.Root
1107 description: The name of the environment variable
1115 description: The value of the environment variable
1119 onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine:
1121 derived_from: tosca.datatypes.Root
1128 onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context
1130 description: The properties for handling context in APEX engines,
1132 defaults to using Java maps for context
1140 description: The plugins for policy executors used in engines such as
1142 javascript, MVEL, Jython
1148 description: The plugin class path for this policy executor
1152 onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context:
1154 derived_from: tosca.datatypes.Root
1160 type: onap.datatypes.policies.controlloop.operational.apex.Plugin
1162 description: The plugin to be used for distributing context between
1164 APEX PDPs at runtime
1172 description: The plugins for context schemas available in APEX PDPs
1174 such as Java and Avro
1180 type: onap.datatypes.policies.controlloop.operational.apex.Plugin
1184 type: onap.datatypes.policies.controlloop.operational.apex.plugin
1186 description: The plugin to be used for locking context in and
1188 between APEX PDPs at runtime
1194 type: onap.datatypes.policies.controlloop.operational.apex.Plugin
1196 description: The plugin to be used for persisting context for APEX PDPs
1202 onap.datatypes.policies.controlloop.operational.apex.Plugin:
1204 derived_from: tosca.datatypes.Root
1212 description: The name of the executor such as Javascript, Jython or MVEL
1220 description: The class path of the plugin class for this executor
1222 1.3 onap.policies.controlloop.Guard Policy Type
1223 -----------------------------------------------
1225 This policy type is the the type definition for Control Loop guard
1226 policies for frequency limiting, blacklisting and min/max guards to help
1227 protect runtime Control Loop Actions from doing harm to the network.
1228 This policy type is developed using the XACML PDP to support
1229 question/answer Policy Decisions during runtime for the Drools and APEX
1230 onap.controlloop.Operational policy type implementations.
1232 The base schema is defined as below:
1234 **Base Policy type definition for onap.policies.controlloop.Guard**
1237 tosca_definitions_version: tosca_simple_yaml_1_0_0
1241 - onap.policies.controlloop.Guard:
1243 derived_from: tosca.policies.Root
1247 description: Guard Policies for Control Loop Operational Policies
1249 As with *onap.policies.Monitoring* policy type, the *PolicyTypeImpl*
1250 implementation of the *onap.policies.controlloop.Guard* Policy Type is
1251 generic to support definition of TOSCA *PolicyType* artifacts in the
1252 Policy Framework using the Policy Type Design API.
1254 For Dublin, only the following derived Policy Type definitions below are
1255 preloaded in the Policy Framework. However, the creation of policies
1256 will still support the payload from Casablanca.
1258 **Casablanca Guard Payload** Expand source
1260 ContentType: "application/json; vnd.onap.guard"
1262 Accepts: "application/json"
1272 "policy-id" : "guard.frequency.scaleout",
1278 "recipe": "scaleOut",
1282 "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
1288 "timeUnits": "minute",
1290 "guardActiveStart": "00:00:01-05:00",
1292 "guardActiveEnd": "23:59:59-05:00"
1306 "guard.frequency.scaleout": {
1308 "type": "onap.policies.controlloop.guard.FrequencyLimiter",
1314 "policy-id": "guard.frequency.scaleout",
1324 1.3.1 onap.policies.controlloop.guard.FrequencyLimiter Policy Type
1325 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1327 This is WIP for El Alto for the proposed policy type.
1329 **Policy Typefor Frequency Limiter Guard Policy** Expand source
1331 tosca_definitions_version: tosca_simple_yaml_1_0_0
1335 - onap.policies.controlloop.Guard:
1337 derived_from: tosca.policies.Root
1341 description: Guard Policies for Control Loop Operational Policies
1343 - onap.policies.controlloop.guard.FrequencyLimiter:
1345 derived_from: onap.policies.controlloop.Guard
1349 description: Supports limiting the frequency of actions being taken by a
1362 type: onap.datatypes.guard.FrequencyLimiter
1366 - onap.datatypes.guard.FrequencyLimiter:
1368 derived_from: tosca.datatypes.Root
1376 description: Specifies the Actor
1384 description: Specified the Recipe
1390 type: scalar-unit.time
1392 description: The time window to count the actions against.
1400 description: The limit
1410 type: tosca.datatypes.TimeInterval
1412 description: An optional range of time during the day the frequency is
1421 description: An optional specific control loop to apply this guard to.
1429 description: An optional specific VNF to apply this guard to.
1433 1.3.2 onap.policies.controlloop.guard.Blacklist Policy Type
1434 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1436 **Policy Type for Blacklist Guard Policies** Expand source
1438 tosca_definitions_version: tosca_simple_yaml_1_0_0
1442 - onap.policies.controlloop.Guard:
1444 derived_from: tosca.policies.Root
1448 description: Guard Policies for Control Loop Operational Policies
1450 - onap.policies.controlloop.guard.Blacklist:
1452 derived_from: onap.policies.controlloop.Guard
1456 description: Supports blacklist of VNF's from performing control loop
1469 type: onap.datatypes.guard.Blacklist
1473 - onap.datatypes.guard.Blacklist:
1475 derived_from: tosca.datatypes.Root
1483 description: Specifies the Actor
1491 description: Specified the Recipe
1497 type: tosca.datatypes.TimeInterval
1499 description: An optional range of time during the day the blacklist is
1508 description: An optional specific control loop to apply this guard to.
1516 description: List of VNF's
1520 1.3.3 onap.policies.controlloop.guard.MinMax Policy Type
1521 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1523 **Policy Type for Min/Max VF Module Policies** Expand source
1527 - onap.policies.controlloop.Guard:
1529 derived_from: tosca.policies.Root
1533 description: Guard Policies for Control Loop Operational Policies
1535 - onap.policies.controlloop.guard.MinMax:
1537 derived_from: onap.policies.controlloop.Guard
1541 description: Supports Min/Max number of VF Modules
1553 type: onap.datatypes.guard.MinMax
1557 - onap.datatypes.guard.MinMax:
1559 derived_from: tosca.datatypes.Root
1567 description: Specifies the Actor
1575 description: Specified the Recipe
1581 type: tosca.datatypes.TimeInterval
1583 description: An optional range of time during the day the Min/Max limit
1592 description: An optional specific control loop to apply this guard to.
1596 min_vf_module_instances:
1602 description: The minimum instances of this VF-Module
1604 max_vf_module_instances:
1610 description: The maximum instances of this VF-Module
1612 1.3.4 onap.policies.controlloop.Coordination Policy Type (STRETCH)
1613 ------------------------------------------------------------------
1615 This policy type defines Control Loop Coordination policies to assist in
1616 coordinating multiple control loops during runtime. This policy type is
1617 developed using XACML PDP to support question/answer policy decisions at
1618 runtime for the onap.policies.controlloop.operational policy types.
1620 2 PDP Deployment and Registration with PAP
1621 ==========================================
1623 The unit of execution and scaling in the Policy Framework is a
1624 *PolicyImpl* entity. A *PolicyImpl* entity runs on a PDP. As is
1625 explained above a *PolicyImpl* entity is a *PolicyTypeImpl*
1626 implementation parameterized with a TOSCA *Policy*.
1628 In order to achieve horizontal scalability, we group the PDPs running
1629 instances of a given *PolicyImpl* entity logically together into a
1630 *PDPSubGroup*. The number of PDPs in a *PDPSubGroup* can then be scaled
1631 up and down using Kubernetes. In other words, all PDPs in a subgroup run
1632 the same \ *PolicyImpl*, that is the same policy template implementation
1633 (in XACML, Drools, or APEX) with the same parameters.
1635 The figure above shows the layout of *PDPGroup* and *PDPSubGroup*
1636 entities. The figure shows examples of PDP groups for Control Loop and
1637 Monitoring policies on the right.
1639 The health of PDPs is monitored by the PAP in order to alert operations
1640 teams managing policy. The PAP manages the life cycle of policies
1643 The table below shows the methods in which *PolicyImpl* entities can be
1644 deployed to PDP Subgroups
1646 =============== ================================================================================================================================================================================================================================================================================== ================================================================================================================================================================================ ========================================================================================================================================================================================================================
1647 **Method** **Description** **Advantages** **Disadvantages**
1648 =============== ================================================================================================================================================================================================================================================================================== ================================================================================================================================================================================ ========================================================================================================================================================================================================================
1649 Cold Deployment The *PolicyImpl (PolicyTypeImpl* and TOSCA *Policy)* are predeployed on the PDP. The PDP is fully configured and ready to execute when started. No run time configuration required and run time administration is simple. Very restrictive, no run time configuration of PDPs is possible.
1651 PDPs register with the PAP when they start, providing the *PolicyImpl* they have been predeployed with.
1652 Warm Deployment The *PolicyTypeImpl* entity is predeployed on the PDP. A TOSCA *Policy* may be loaded at startup. The PDP may be configured or reconfigured with a new or updated TOSCA *Policy* at run time. The configuration, parameters, and PDP group of PDPs may be changed at run time by loading or updating a TOSCA *Policy* into the PDP. Administration and management is required. The configuration and life cycle of the TOSCA policies can change at run time and must be administered and managed.
1654 PDPs register with the PAP when they start, providing the *PolicyImpl* they have been predeployed with if any. The PAP may update the TOSCA *Policy* on a PDP at any time after registration. Lifecycle management of TOSCA *Policy* entities is supported, allowing features such as *PolicyImpl* Safe Mode and \ *Policy*\ Impl retirement.
1655 Hot Deployment The *PolicyImpl (PolicyTypeImpl* and TOSCA *Policy)* are deployed at run time. The *PolicyImpl (PolicyTypeImpl* and TOSCA *Policy)* may be loaded at startup. The PDP may be configured or reconfigured with a new or updated *PolicyTypeImpl* and/or TOSCA *Policy* at run time. The policy logic, rules, configuration, parameters, and PDP group of PDPs may be changed at run time by loading or updating a TOSCA *Policy* and *PolicyTypeImpl* into the PDP. Administration and management is more complex. The *PolicyImpl* itself and its configuration and life cycle as well as the life cycle of the TOSCA policies can change at run time and must be administered and managed.
1657 PDPs register with the PAP when they start, providing the *PolicyImpl* they have been predeployed with if any. The PAP may update the TOSCA *Policy* and *PolicyTypeImpl* on a PDP at any time after registration. Lifecycle management of TOSCA *Policy* entities and *PolicyTypeImpl* entites is supported, allowing features such as *PolicyImpl* Safe Mode and \ *Policy*\ Impl retirement.
1658 =============== ================================================================================================================================================================================================================================================================================== ================================================================================================================================================================================ ========================================================================================================================================================================================================================
1663 The Policy Framework supports the APIs documented in the subsections
1664 below. The APIs in this section are supported for use by external
1667 3.1 Policy Type Design API for TOSCA Policy Types
1668 -------------------------------------------------
1670 The purpose of this API is to support CRUD of TOSCA *PolicyType*
1671 entities. This API is provided by the *PolicyDevelopment* component of
1672 the Policy Framework, see `The ONAP Policy
1673 Framework <file://localhost/display/DW/The+ONAP+Policy+Framework>`__
1676 The API allows applications to create, update, delete, and query
1677 *PolicyType* entities so that they become available for use in ONAP by
1678 applications such as CLAMP\ *.* Some Policy Type entities are preloaded
1679 in the Policy Framework. The TOSCA fields below are valid on API calls:
1681 ============ ======= ======== ========== ===============================================================================================================================
1682 **Field** **GET** **POST** **DELETE** **Comment**
1683 ============ ======= ======== ========== ===============================================================================================================================
1684 (name) M M M The definition of the reference to the Policy Type, GET allows ranges to be specified
1685 version O M C GET allows ranges to be specified, must be specified if more than one version of the Policy Type exists
1686 description R O N/A Desciption of the Policy Type
1687 derived_from R C N/A Must be specified when a Policy Type is derived from another Policy Type such as in the case of derived Monitoring Policy Types
1688 metadata R O N/A Metadata for the Policy Type
1689 properties R M N/A This field holds the specification of the specific Policy Type in ONAP
1690 targets R O N/A A list of node types and/or group types to which the Policy Type can be applied
1691 triggers R O N/A Specification of policy triggers, not currently supported in ONAP
1692 ============ ======= ======== ========== ===============================================================================================================================
1694 | Note: On this and subsequent tables, use the following legend:
1695 M-Mandatory, O-Optional, R-Read-only, C-Conditional. Conditional means
1696 the field is mandatory when some other field is present.
1697 | Note: Preloaded policy types may only be queried over this API,
1698 modification or deletion of preloaded policy type implementations is
1700 | Note: Policy types that are in use (referenced by defined Policies)
1702 | Note: The group types of targets in TOSCA are groups of TOSCA nodes,
1703 not PDP groups; the *target* concept in TOSCA is equivalent to the
1704 Policy Enforcement Point (PEP) concept
1706 3.1.1 Policy Type query
1707 ~~~~~~~~~~~~~~~~~~~~~~~
1709 The API allows applications (such as CLAMP and Integration) to query
1710 the \ *PolicyType* entities that are available for \ *Policy* creation
1711 using a GET operation.
1713 *https:{url}:{port}/policy/api/v1/policytypes GET*
1715 **Policy Type Query - When system comes up before any mS are onboarded**
1720 - onap.policies.Monitoring:
1724 description: A base policy type for all policies that govern monitoring
1727 derived_from: tosca.policies.Root
1731 # Omitted for brevity, see Section 1
1733 - onap.policies.controlloop.Operational:
1737 description: Operational Policy for Control Loops
1739 derived_from: tosca.policies.Root
1743 # Omitted for brevity, see Section 1
1745 - onap.policies.controloop.operational.Drools:
1749 description: Operational Policy for Control Loops using the Drools PDP
1751 derived_from: onap.policies.controlloop.Operational
1755 # Omitted for brevity, see Section 1
1757 - onap.policies.controloop.operational.Apex:
1761 description: Operational Policy for Control Loops using the APEX PDP
1763 derived_from: onap.policies.controlloop.Operational
1767 # Omitted for brevity, see Section 1
1769 - onap.policies.controlloop.Guard:
1773 description: Operational Policy for Control Loops
1775 derived_from: tosca.policies.Root
1779 # Omitted for brevity, see Section 1
1781 - onap.policies.controlloop.guard.FrequencyLimiter:
1785 description: Supports limiting the frequency of actions being taken by
1788 derived_from: onap.policies.controlloop.Guard
1792 # Omitted for brevity, see Section 1
1794 - onap.policies.controlloop.guard.Blacklist:
1798 description: Supports blacklist of VNF's from performing control loop
1801 derived_from: onap.policies.controlloop.Guard
1805 # Omitted for brevity, see Section 1
1807 - onap.policies.controlloop.guard.MinMax:
1811 description: Supports Min/Max number of VF Modules
1813 derived_from: onap.policies.controlloop.Guard
1817 # Omitted for brevity, see Section 1
1819 - onap.policies.controlloop.coordination.TBD: (STRETCH GOALS)
1823 description: Control Loop Coordination policy types
1825 derived_from: onap.policies.controlloop.Coordination
1829 # Omitted for brevity, see Section 1
1833 # Any bespoke data types referenced by policy type definitions
1835 The table below shows some more examples of GET operations
1837 ======================================================================================================== ================================================================
1838 **Example** **Description**
1839 ======================================================================================================== ================================================================
1840 *https:{url}:{port}/policy/api/v1/policytypes* Get all Policy Type entities in the system
1841 *https:{url}:{port}/policy/api/v1/policytypes/{policy type id}* Get a specific policy type and all the available versions.
1844 https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app*
1845 *https:{url}:{port}/policy/api/v1/policytypes/{policy type id}/versions/{version id}* Get the specific Policy Type with the specified name and version
1848 https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0*
1849 ======================================================================================================== ================================================================
1851 3.1.2 Policy Type Create/Update
1852 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1854 The API allows applications and users (such as a DCAE microservice
1855 component developer) to create or update a Policy Type using a POST
1856 operation. This API allows new Policy Types to be created or existing
1857 Policy Types to be modified. POST operations with a new Policy Type name
1858 or a new version of an existing Policy Type name are used to create a
1859 new Policy Type. POST operations with an existing Policy Type name and
1860 version are used to update an existing Policy Type. Many Policy Types
1861 can be created or updated in a single POST operation by specifying more
1862 than one Policy Type on the TOSCA *policy_types* list.
1864 For example, the POST operation below with the TOSCA body below is used
1865 to create a new Policy type for a DCAE microservice.
1867 *https:{url}:{port}/policy/api/v1/policytypes POST*
1869 **Create a new Policy Type for a DCAE microservice** Expand source
1873 - onap.policies.monitoring.cdap.tca.hi.lo.app:
1877 derived_from: onap.policies.Monitoring
1879 description: A DCAE TCA high/low policy type
1887 description: TCA Policy JSON
1889 default:'{<JSON omitted for brevity>}'
1893 type: onap.datatypes.monitoring.tca_policy
1897 <omitted for brevity>
1899 Following creation of a DCAE TCA policy type operation, the GET call for
1900 Monitoring policies will list the new policy type.
1902 *https:{url}:{port}/policy/api/v1/policytypes GET*
1904 **Policy Type Query after DCAE TCA mS Policy Type is created** Expand
1909 - onap.policies.Monitoring:
1913 derived_from: tosca.policies.Root
1915 description: A base policy type for all policies that govern monitoring
1918 - onap.policies.monitoring.cdap.tca.hi.lo.app:
1922 derived_from: onap.policies.Monitoring
1924 description: A DCAE TCA high/low policy type
1926 - onap.policies.controlloop.Operational:
1930 description: Operational Policy for Control Loops
1932 derived_from: tosca.policies.Root
1934 - onap.policies.controloop.operational.Drools:
1938 description: Operational Policy for Control Loops using the Drools PDP
1940 derived_from: onap.policies.controlloop.Operational
1942 - onap.policies.controloop.operational.Apex:
1946 description: Operational Policy for Control Loops using the APEX PDP
1948 derived_from: onap.policies.controlloop.Operational
1950 - onap.policies.controlloop.Guard:
1954 description: Operational Policy for Control Loops
1956 derived_from: tosca.policies.Root
1958 - onap.policies.controlloop.guard.FrequencyLimiter:
1962 description: Supports limiting the frequency of actions being taken by a
1965 derived_from: onap.policies.controlloop.Guard
1967 - onap.policies.controlloop.guard.Blacklist:
1971 description: Supports blacklist of VNF's from performing control loop
1974 derived_from: onap.policies.controlloop.Guard
1976 - onap.policies.controlloop.guard.MinMax:
1980 description: Supports Min/Max number of VF Modules
1982 derived_from: onap.policies.controlloop.Guard
1984 - onap.policies.controlloop.coordination.TBD: (STRETCH GOALS)
1988 description: Control Loop Coordination policy types
1990 derived_from: onap.policies.controlloop.Coordination
1992 Now the \ *onap.policies.Monitoring.cdap.tca.hi.lo.app* Policy Type is
1993 available to CLAMP for creating concrete policies. See the Yaml
1994 contribution on the \ `Model driven Control Loop
1995 Design <file://localhost/display/DW/Model+driven+Control+Loop+Design>`__ page
1996 for a full listing of the DCAE TCA policy type used in the example
1999 3.1.3 Policy Type Delete
2000 ~~~~~~~~~~~~~~~~~~~~~~~~
2002 The API also allows Policy Types to be deleted with a DELETE operation.
2003 The format of the delete operation is as below:
2005 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0
2008 | Note: Predefined policy types cannot be deleted
2009 | Note: Policy types that are in use (Parameterized by a TOSCA Policy)
2010 may not be deleted, the parameterizing TOSCA policies must be deleted
2012 | Note: The *version* parameter may be omitted on the DELETE operation
2013 if there is only one version of the policy type in the system
2015 3.2 Policy Design API
2016 ---------------------
2018 The purpose of this API is to support CRUD of TOSCA *Policy* entities
2019 from TOSCA compliant *PolicyType* definitions. TOSCA *Policy* entities
2020 become the parameters for \ *PolicyTypeImpl* entities, producing
2021 *PolicyImpl* entities that can run on PDPs. This API is provided by the
2022 *PolicyDevelopment* component of the Policy Framework, see `The ONAP
2024 Framework <file://localhost/display/DW/The+ONAP+Policy+Framework>`__
2027 This API allows applications (such as CLAMP and Integration) to create,
2028 update, delete, and query *Policy* entities\ *.* The TOSCA fields below
2029 are valid on API calls:
2031 =========== ======= ======== ========== ================================================================================
2032 **Field** **GET** **POST** **DELETE** **Comment**
2033 =========== ======= ======== ========== ================================================================================
2034 (name) M M M The definition of the reference to the Policy, GET allows ranges to be specified
2035 type O M O The Policy Type of the policy, see section 3.1
2038 properties R M N/A This field holds the specification of the specific Policy in ONAP
2039 targets R O N/A A list of nodes and/or groups to which the Policy can be applied
2040 =========== ======= ======== ========== ================================================================================
2042 | Note: Policies that are deployed (used on deployed *PolicyImpl*
2043 entities) may not be deleted
2044 | Note: This API is NOT used by DCAE for a decision on what policy the
2045 DCAE PolicyHandler should retrieve and enforce
2046 | Note: The groups of targets in TOSCA are groups of TOSCA nodes, not
2047 PDP groups; the *target* concept in TOSCA is equivalent to the Policy
2048 Enforcement Point (PEP) concept
2050 YAML is used for illustrative purposes in the examples in this section.
2051 JSON (application/json) will be used as the content type in the
2052 implementation of this API.
2057 The API allows applications (such as CLAMP and Integration) to query
2058 the \ *Policy* entities that are available for deployment using a GET
2061 Note: This operation simply returns TOSCA policies that are defined in
2062 the Policy Framework, it does NOT make a decision.
2064 The table below shows some more examples of GET operations
2066 ==================================================================================================================================================================================================== ===================================================================================
2067 **Example** **Description**
2068 ==================================================================================================================================================================================================== ===================================================================================
2069 *https:{url}:{port}/policy/api/v1/policytypes/{policy type id}/versions/{versions}/policies* Get all Policies for a specific Policy Type and version
2072 https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies*
2073 *https://{url}:{port}/policy/api/v1/policytypes/{policy type id}/versions/{version}/policies/{policy name}/versions/{version}* Gets a specific Policy version
2076 https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.scaleout.tca/versions/1.0.0 GET*
2077 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.scaleout.tca/versions/latest GET* Returns the latest version of a Policy
2078 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.scaleout.tca/deployed GET* Returns the version of the Policy that has been deployed on one or more PDP groups.
2079 *https://{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.2.3/policies/CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A/versions/1.0.2 GET* Returns a specific version of a monitoring policy
2080 ==================================================================================================================================================================================================== ===================================================================================
2082 3.2.2 Policy Create/Update
2083 ~~~~~~~~~~~~~~~~~~~~~~~~~~
2085 The API allows applications and users (such as CLAMP and Integration) to
2086 create or update a Policy using a POST operation. This API allows new
2087 Policies to be created or existing Policies to be modified. POST
2088 operations with a new Policy name are used to create a new Policy. POST
2089 operations with an existing Policy name are used to update an existing
2090 Policy. Many Policies can be created or updated in a single POST
2091 operation by specifying more than one Policy on the TOSCA *policies*
2094 3.2.2.1 Monitoring Policy Create/Update
2095 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2097 While designing a control loop using CLAMP, a Control Loop Designer uses
2098 the Policy Type for a specific DCAE mS component (See Section 3.1.1) to
2099 create a specific Policy. CLAMP then uses this API operation to submit
2100 the Policy to the Policy Framework.
2102 For example, the POST operation below with the TOSCA body below is used
2103 to create a new scaleout Policy for
2104 the \ *onap.policies.monitoring.cdap.tca.hi.lo.app* microservice. The
2105 name of the policy "onap.scaleout.tca" is up to the user to determine
2108 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.Monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies POST*
2110 **TOSCA Body of a new TCA High/Low Policy** Expand source
2112 https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies
2115 Content-Type: application/yaml
2117 Accept: application/yaml
2127 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2133 policy-id: onap.scaleout.tca # SHOULD MATCH THE TOSCA policy-name field
2134 above. DCAE needs this - convenience.
2136 description: The scaleout policy for vDNS # GOOD FOR CLAMP GUI
2140 domain: measurementsForVfScaling
2142 metricsPerEventName:
2146 eventName: vLoadBalancer
2148 controlLoopSchemaType: VNF
2150 policyScope: "type=configuration"
2152 policyName: "onap.scaleout.tca"
2154 policyVersion: "v0.0.1"
2158 - closedLoopControlName:
2159 "CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A"
2161 closedLoopEventStatus: ONSET
2166 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
2170 direction: LESS_OR_EQUAL
2176 closedLoopControlName:
2177 "CL-LBAL-LOW-TRAFFIC-SIG-0C5920A6-B564-8035-C878-0E814352BC2B"
2179 closedLoopEventStatus: ONSET
2184 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
2186 thresholdValue: 5000
2188 direction: GREATER_OR_EQUAL
2196 - onap.scaleout.tca:
2198 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2206 # version is managed by Policy Lifecycle and returned
2208 # back to the caller.
2216 # These were passed in, and should not be changed. Will
2222 policy-id: onap.scaleout.tca
2226 domain: measurementsForVfScaling
2228 metricsPerEventName:
2232 eventName: vLoadBalancer
2234 controlLoopSchemaType: VNF
2236 policyScope: "type=configuration"
2238 <OMITTED FOR BREVITY>
2240 Given a return code of success and a "metadata" section that indicates
2241 versioning information. The "metadata" section conforms exactly to how
2242 SDC implements lifecycle management versioning for first class
2243 normatives in the TOSCA Models. The policy platform will implement
2244 lifecycle identically to SDC to ensure conformity for policy creation.
2245 The new metadata fields return versioning details.
2247 The following new policy will be listed and will have a "metadata"
2248 section as shown below:
2250 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies
2253 **Policy with Metadata section for lifecycle management** Expand source
2257 - onap.scaleout.tca:
2259 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2265 policy-id: onap.scaleout.tca
2271 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2277 invariantUUID: 20ad46cc-6b16-4404-9895-93d2baaa8d25
2279 UUID: 4f715117-08b9-4221-9d63-f3fa86919742
2283 name: my.other.policy
2285 scope: foo=bar;field2=value2
2287 description: The policy for some other use case
2289 - yet.another.policy:
2291 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2297 invariantUUID: 20ad46cc-6b16-4404-9895-93d2baaa8d25
2299 UUID: 4f715117-08b9-4221-9d63-f3fa86919742
2303 name: yet.another.policy
2307 description: The policy for yet another use case
2309 The contents of the new policy can be retrieved using the ID:
2311 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.scaleout.tca
2314 **Query on a new TCA High/Low Policy** Expand source
2322 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2328 invariantUUID: 20ad46cc-6b16-4404-9895-93d2baaa8d25
2330 UUID: 4f715117-08b9-4221-9d63-f3fa86919742
2334 name: onap.scaleout.tca
2338 description: The scaleout policy for vDNS
2342 domain: measurementsForVfScaling
2344 <OMMITTED FOR BREVITY>
2346 **3.2.2.2 Operational Policy Create/Update**
2348 While designing an operational policy, the designer uses the Policy Type
2349 for the operational policy (See Section 3.1.1) to create a specific
2350 Policy and submits the Policy to the Policy Framework.
2352 This URL will be fixed for CLAMP in Dublin and the payload will match
2353 updated version of Casablanca YAML that supports VFModules.
2355 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.controloop.operational/versions/1.0.0/policies POST*
2357 *Content-Type: application/yaml; legacy-version*
2359 FUTURE: Content-Type: application/yaml; tosca
2361 NOTE: The controlLoopName will be assumed to be the policy-id
2363 **Create an Operational Policy** Expand source
2365 tosca_definitions_version: tosca_simple_yaml_1_0_0
2373 operational.scaleout:
2375 type: onap.policies.controlloop.Operational
2381 policy-id: operational.scaleout
2389 controlLoopName: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
2391 trigger_policy: unique-policy-id-1-scale-up
2399 - id: unique-policy-id-1-scale-up
2401 name: Create a new VF Module
2407 recipe: VF Module Create
2415 requestParameters: '{"usePreload":true,"userParams":[]}'
2417 configurationParameters:
2418 '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[9]","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[16]","enabled":"$.vf-module-topology.vf-module-parameters.param[23]"}]'
2424 success: final_success
2426 failure: final_failure
2428 failure_timeout: final_failure_timeout
2430 failure_retries: final_failure_retries
2432 failure_exception: final_failure_exception
2434 failure_guard: final_failure_guard
2436 **Response from creating Operational Policy** Expand source
2438 tosca_definitions_version: tosca_simple_yaml_1_0_0
2446 operational.scaleout:
2448 type: onap.policies.controlloop.Operational
2454 policy-id: operational.scaleout
2464 controlLoopName: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
2466 trigger_policy: unique-policy-id-1-scale-up
2474 - id: unique-policy-id-1-scale-up
2476 name: Create a new VF Module
2482 recipe: VF Module Create
2490 requestParameters: '{"usePreload":true,"userParams":[]}'
2492 configurationParameters:
2493 '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[9]","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[16]","enabled":"$.vf-module-topology.vf-module-parameters.param[23]"}]'
2499 success: final_success
2501 failure: final_failure
2503 failure_timeout: final_failure_timeout
2505 failure_retries: final_failure_retries
2507 failure_exception: final_failure_exception
2509 failure_guard: final_failure_guard
2511 3.2.2.2.1 Drools Operational Policy Create/Update
2512 '''''''''''''''''''''''''''''''''''''''''''''''''
2514 TBD `Jorge Hernandez <file://localhost/display/~jhh>`__
2516 3.2.2.2.2 APEX Operational Policy Create/Update
2517 '''''''''''''''''''''''''''''''''''''''''''''''
2519 The POST operation below with the TOSCA body below is used to create a
2520 new Sample Domain test polict for the APEX Sample Domain operational
2523 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.controloop.operational.apex/versions/1.0.0/policies POST*
2525 **Create an APEX Policy for a Sample Domain** Expand source
2529 - onap.policy.operational.apex.sampledomain.Test:
2531 type: onap.policies.controloop.operational.Apex
2537 name: "MyApexEngine"
2545 deployment_port: 12561
2548 "onap.policies.controlloop.operational.apex.sampledomain.Impl"
2555 "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
2563 label: "RESTCLIENT",
2565 plugin_parameter_class_name:
2566 "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
2570 url: "https://localhost:32801/EventGenerator/GetEvents"
2582 label: "RESTCLIENT",
2584 plugin_parameter_class_name:
2585 "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
2589 url: "https://localhost:32801/EventGenerator/PostEvent"
2595 3.2.2.3 Guard Policy Create/Update
2596 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2598 TBD `Pamela Dragosh <file://localhost/display/~pdragosh>`__ Similar to
2599 Operational Policies
2601 3.2.2.4 Policy Lifecycle API - Creating Coordination Policies
2602 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2604 TBD Similar to Operational Policies, stretch for Dublin
2609 The API also allows Policies to be deleted with a DELETE operation. The
2610 format of the delete operation is as below:
2612 =========================================================================================================================================== =========================================================================================================================================
2613 **Example** **Description**
2614 =========================================================================================================================================== =========================================================================================================================================
2615 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.scaleout.tca DELETE* Deletes a Policy - all versions will be deleted.
2617 NOTE: The API call will fail if the policy has been deployed in one or more PDP Group. They must be undeployed first from all PDP Groups.
2618 =========================================================================================================================================== =========================================================================================================================================
2620 3.3 Policy Administration API
2621 -----------------------------
2623 The purpose of this API is to support CRUD of PDP groups and subgroups
2624 and to support the deployment and life cycles of *PolicyImpl* entities
2625 (TOSCA *Policy* and *PolicyTypeImpl* entities) on PDP sub groups and
2626 PDPs. See Section 2 for details on policy deployment on PDP groups and
2627 subgroups. This API is provided by the *PolicyAdministration* component
2628 (PAP) of the Policy Framework, see `The ONAP Policy
2629 Framework <file://localhost/display/DW/The+ONAP+Policy+Framework>`__
2632 PDP groups and subgroups may be prefedined in the system. Predefined
2633 groups and subgroups may not be modified or deleted over this API.
2634 However, the policies running on predefined groups or subgroups as well
2635 as the instance counts and properties may be modified.
2637 A PDP may be preconfigured with its PDP group, PDP subgroup, and
2638 policies. The PDP sends this information to the PAP when it starts. If
2639 the PDP group, subgroup, or any policy is unknown to the PAP, the PAP
2640 locks the PDP in state PASSIVE.
2642 The fields below are valid on API calls:
2644 ============= ====================== ======================== ========== ========================================================================= ===================================================================== ==============================================================================================
2645 **Field** **GET** **POST** **DELETE** **Comment**
2646 ============= ====================== ======================== ========== ========================================================================= ===================================================================== ==============================================================================================
2647 name M M M The name of the PDP group
2648 version O M C The version of the PDP group
2649 state R N/A N/A The administrative state of the PDP group: PASSIVE, SAFE, TEST, or ACTIVE
2650 description R O N/A The PDP group description
2651 properties R O N/A Specific properties for a PDP group
2652 pdp_subgroups R M N/A A list of PDP subgroups for a PDP group
2653 \ pdp_type R M N/A The PDP type of this PDP subgroup, currently xacml, drools, or apex
2654 \ supported_policy_types R N/A N/A A list of the policy types supported by the PDPs in this PDP subgroup
2655 \ policies R M N/A The list of policies running on the PDPs in this PDP subgroup
2656 \ (name) R M N/A The name of a TOSCA policy running in this PDP subgroup
2657 \ policy_type R N/A N/A The TOSCA policy type of the policy
2658 \ policy_type_version R N/A N/A The version of the TOSCA policy type of the policy
2659 \ policy_type_impl R C N/A The policy type implementation (XACML, Drools Rules, or APEX Model) that implements the policy
2660 \ instance_count R N/A N/A The number of PDP instances running in a PDP subgroup
2661 \ min_instance_count O N/A N/A The minumum number of PDP instances to run in a PDP subgroup
2662 \ properties O N/A N/A Deployment configuration or other properties for the PDP subgroup
2663 \ deployment_info R N/A N/A Information on the deployment for a PDP subgroup
2664 \ instances R N/A N/A A list of PDP instances running in a PDP subgroup
2665 \ instance R N/A N/A The instance ID of a PDP running in a Kuberenetes Pod
2666 \ state R N/A N/A The administrative state of the PDP: PASSIVE, SAFE, TEST, or ACTIVE
2667 \ healthy R N/A N/A The result of the latest health check on the PDP: HEALTHY/NOT_HEALTHY/TEST_IN_PROGRESS
2668 \ message O N/A N/A A status message for the PDP if any
2669 \ deployment_instance_info R N/A N/A Information on the node running the PDP
2670 ============= ====================== ======================== ========== ========================================================================= ===================================================================== ==============================================================================================
2672 Note: In the Dublin release, the *policy_type_impl* of all policy types
2673 in a PDP subgroup must be the same.
2675 YAML is used for illustrative purposes in the examples in this section.
2676 JSON (application/json) will be used as the content type in the
2677 implementation of this API.
2679 3.3.1 PDP Group Query
2680 ~~~~~~~~~~~~~~~~~~~~~
2682 This operation allows the PDP groups and subgroups to be listed together
2683 with the policies that are deployed on each PDP group and subgroup.
2685 *https:{url}:{port}/policy/pap/v1/pdps GET*
2687 **PDP Group query for all PDP groups and Subgroups** Expand source
2691 - name: onap.pdpgroup.controlloop.Operational
2697 description: ONAP Control Loop Operational and Guard policies
2701 # PDP group level properties if any
2707 supported_policy_types:
2709 - onap.controllloop.operational.drools.vCPE
2711 - onap.controllloop.operational.drools.vFW
2715 - onap.controllloop.operational.drools.vCPE.eastRegion:
2717 policy_type: onap.controllloop.operational.drools.vCPE
2719 policy_type_version: 1.0.0
2721 policy_type_impl: onap.controllloop.operational.drools.impl
2723 - onap.controllloop.operational.drools.vFW.eastRegion:
2725 policy_type: onap.controllloop.operational.drools.vFW
2727 policy_type_version: 1.0.0
2729 policy_type_impl: onap.controllloop.operational.drools.impl
2731 min_instance_count: 3
2737 # The properties below are for illustration only
2739 instance_spawn_load_threshold: 70%
2741 instance_kill_load_threshold: 50%
2743 instance_geo_redundancy: true
2747 service_endpoint: https://<the drools service endpoint for this PDP
2750 deployment: A deployment identifier
2752 # Other deployment info
2756 - instance: drools_1
2762 deployment_instance_info:
2764 node_address: drools_1_pod
2766 # Other deployment instance info
2768 - instance: drools_2
2774 deployment_instance_info:
2776 node_address: drools_2_pod
2778 # Other deployment instance info
2780 - instance: drools_3
2786 deployment_instance_info:
2788 node_address: drools_3_pod
2790 # Other deployment instance info
2794 supported_policy_types:
2796 - onap.controllloop.operational.apex.BBS
2798 - onap.controllloop.operational.apex.SampleDomain
2802 - onap.controllloop.operational.apex.BBS.eastRegion:
2804 policy_type: onap.controllloop.operational.apex.BBS
2806 policy_type_version: 1.0.0
2808 policy_type_impl: onap.controllloop.operational.apex.impl
2810 - onap.controllloop.operational.apex.sampledomain.eastRegion:
2812 policy_type: onap.controllloop.operational.apex.SampleDomain
2814 policy_type_version: 1.0.0
2816 policy_type_impl: onap.controllloop.operational.apex.impl
2818 min_instance_count: 2
2824 # The properties below are for illustration only
2826 instance_spawn_load_threshold: 80%
2828 instance_kill_load_threshold: 60%
2830 instance_geo_redundancy: true
2834 service_endpoint: https://<the apex service endpoint for this PDP group>
2836 deployment: A deployment identifier
2838 # Other deployment info
2848 deployment_instance_info:
2850 node_address: apex_1_podgroup
2852 # Other deployment instance info
2856 deployment_instance_info:
2858 node_address: apex_2_pod
2860 # Other deployment instance infoCreation
2868 deployment_instance_info:
2870 node_address: apex_3_pod
2872 # Other deployment instance info
2876 supported_policy_types:
2878 - onap.policies.controlloop.guard.FrequencyLimiter
2880 - onap.policies.controlloop.guard.BlackList
2882 - onap.policies.controlloop.guard.MinMax
2886 - onap.policies.controlloop.guard.frequencylimiter.EastRegion:
2888 policy_type: onap.policies.controlloop.guard.FrequencyLimiter
2890 policy_type_version: 1.0.0
2892 policy_type_impl: onap.controllloop.guard.impl
2894 - onap.policies.controlloop.guard.blackList.EastRegion:
2896 policy_type: onap.policies.controlloop.guard.BlackList
2898 policy_type_version: 1.0.0
2900 policy_type_impl: onap.controllloop.guard.impl
2902 - onap.policies.controlloop.Guard.MinMax.EastRegion:
2904 policy_type: onap.policies.controlloop.guard.MinMax
2906 policy_type_version: 1.0.0
2908 policy_type_impl: onap.controllloop.guard.impl
2910 min_instance_count: 2
2916 # The properties below are for illustration only
2918 instance_geo_redundancy: true
2922 service_endpoint: https://<the XACML service endpoint for this PDP
2925 deployment: A deployment identifier
2927 # Other deployment info
2937 deployment_instance_info:
2939 node_address: xacml_1_pod
2941 # Other deployment instance info
2949 deployment_instance_info:
2951 node_address: xacml_2_pod
2953 # Other deployment instance info
2955 - name: onap.pdpgroup.monitoring
2961 description: DCAE mS Configuration Policies
2965 # PDP group level properties if any
2971 supported_policy_types:
2973 - onap.policies.monitoring.cdap.tca.hi.lo.app
2977 - onap.scaleout.tca:
2979 policy_type: onap.policies.monitoring.cdap.tca.hi.lo.app
2981 policy_type_version: 1.0.0
2983 policy_type_impl: onap.policies.monitoring.impl
2985 min_instance_count: 2
2991 # The properties below are for illustration only
2993 instance_geo_redundancy: true
2997 service_endpoint: https://<the XACML service endpoint for this PDP
3000 deployment: A deployment identifier
3002 # Other deployment info
3012 deployment_instance_info:
3014 node_address: xacml_1_pod
3016 # Other deployment instance info
3024 deployment_instance_info:
3026 node_address: xacml_2_pod
3028 # Other deployment instance info
3030 The table below shows some more examples of GET operations
3032 ======================================================================================= ================================================================
3033 **Example** **Description**
3034 ======================================================================================= ================================================================
3035 *https:{url}:{port}/policy/pap/v1/pdps* Get all PDP Groups and subgroups in the system
3036 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.controlloop* Get PDP Groups and subgroups that match the supplied name filter
3037 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.monitoring/subgroups/xacml* Get the PDP subgroup informtation for the specified subgroup
3039 ======================================================================================= ================================================================
3041 3.3.2 PDP Group Deployment
3042 ~~~~~~~~~~~~~~~~~~~~~~~~~~
3044 This operation allows the PDP groups and subgroups to be created. A POST
3045 operation is used to create a new PDP group name. A POST operation is
3046 also used to update an existing PDP group. Many PDP groups can be
3047 created or updated in a single POST operation by specifying more than
3048 one PDP group in the POST operation body.
3050 *https:{url}:{port}/policy/pap/v1/pdps POST*
3052 **POST body to deploy or update PDP groups** Expand source
3056 - name: onap.pdpgroup.controlloop.operational
3058 description: ONAP Control Loop Operational and Guard policies
3064 supportedPolicyTypes:
3066 - onap.controllloop.operational.drools.vcpe.EastRegion
3070 - onap.controllloop.operational.drools.vfw.EastRegion
3074 min_instance_count: 3group
3078 # The properties below are for illustration only
3080 instance_spawn_load_threshold: 70%
3082 instance_kill_load_threshold: 50%
3084 instance_geo_redundancy: true
3090 - onap.controllloop.operational.apex.bbs.EastRegion
3094 - onap.controllloop.operational.apex.sampledomain.EastRegion
3098 min_instance_count: 2
3102 # The properties below are for illustration only
3104 instance_spawn_load_threshold: 80%
3106 instance_kill_load_threshold: 60%
3108 instance_geo_redundancy: true
3114 - onap.policies.controlloop.guard.frequencylimiter.EastRegion
3118 - onap.policies.controlloop.guard.blacklist.EastRegion
3122 - onap.policies.controlloop.guard.minmax.EastRegion
3126 min_instance_count: 2
3130 # The properties below are for illustration only
3132 instance_geo_redundancy: true
3134 - name: onap.pdpgroup.monitoring
3136 description: DCAE mS Configuration Policies
3140 # PDP group level properties if any
3152 min_instance_count: 2
3156 # The properties below are for illustration only
3158 instance_geo_redundancy: true
3160 Other systems such as CLAMP can use this API to deploy policies using a
3161 POST operation with the body below where only mandatory fields are
3164 *https:{url}:{port}/policy/pap/v1/pdps POST*
3166 **POST body to deploy or update PDP groups** Expand source
3170 - name: onap.pdpgroup.Monitoring
3172 description: DCAE mS Configuration Policies
3182 Simple API for CLAMP to deploy one or more policy-id's with optional policy-version.
3183 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3185 *https:{url}:{port}/policy/pap/v1/pdps/policies POST*
3187 Content-Type: application/json
3195 "policy-id": "onap.scaleout.tca",
3203 "policy-id": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
3210 "guard.frequency.ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
3217 "guard.minmax.ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
3225 HTTP status code indicates success or failure.{
3227 "errorDetails": "some error message"
3231 Simple API for CLAMP to undeploy a policy-id with optional policy-version.
3232 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3234 *https:{url}:{port}/policy/pap/v1/pdps/policies{policy-id} DELETE*
3236 *https:{url}:{port}/policy/pap/v1/pdps/policies{policy-id}/versions/{policy-version}
3239 HTTP status code indicates success or failure.
3243 "errorDetails": "some error message"
3247 3.3.3 PDP Group Delete
3248 ~~~~~~~~~~~~~~~~~~~~~~
3250 The API also allows PDP groups to be deleted with a DELETE operation.
3251 DELETE operations are only permitted on PDP groups in PASSIVE state. The
3252 format of the delete operation is as below:
3254 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.monitoring
3257 3.3.4 PDP Group State Management
3258 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3260 The state of PDP groups is managed by the API. PDP groups can be in
3261 states PASSIVE, TEST, SAFE, or ACTIVE. For a full description of PDP
3262 group states, see `The ONAP Policy
3263 Framework <file://localhost/display/DW/The+ONAP+Policy+Framework>`__
3264 architecture page. The state of a PDP group is changed with a PUT
3267 The following PUT operation changes a PDP group to ACTIVE:
3269 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.monitoring/state=active*
3271 There are a number of rules for state management:
3273 1. Only one version of a PDP group may be ACTIVE at any time
3275 2. If a PDP group with a certain version is ACTIVE and a later version
3276 of the same PDP group is activated, then the system upgrades the PDP
3279 3. If a PDP group with a certain version is ACTIVE and an earlier
3280 version of the same PDP group is activated, then the system
3281 downgrades the PDP group
3283 4. There is no restriction on the number of PASSIVE versions of a PDP
3284 group that can exist in the system
3286 5. <Rules on SAFE/TEST> ? `Pamela
3287 Dragosh <file://localhost/display/~pdragosh>`__
3289 3.3.5 PDP Group Statistics
3290 ~~~~~~~~~~~~~~~~~~~~~~~~~~
3292 This operation allows statistics for PDP groups, PDP subgroups, and
3293 individual PDPs to be retrieved.
3295 *https:{url}:{port}/policy/pap/v1/pdps/statistics GET*
3297 **Draft Example statistics returned for a PDP Group** Expand source
3299 report_timestamp: 2019-02-11T15:23:50+00:00
3305 - name: onap.pdpgroup.controlloop.Operational
3309 create_timestamp: 2019-02-11T15:23:50+00:00
3311 update_timestamp: 2019-02-12T15:23:50+00:00
3313 state_change_timestamp: 2019-02-13T15:23:50+00:00
3321 deployed_policy_count: 2
3323 policy_execution_count: 123
3325 policy_execution_ok_count: 121
3327 policy_execution_fail_count: 2
3331 - instance: drools_1
3333 start_timestamp: 2019-02-13T15:23:50+00:00
3335 policy_execution_count: 50
3337 policy_execution_ok_count: 49
3339 policy_execution_fail_count: 1
3341 - instance: drools_2
3343 start_timestamp: 2019-02-13T15:30:50+00:00
3345 policy_execution_count: 50
3347 policy_execution_ok_count: 49
3349 policy_execution_fail_count: 1
3351 - instance: drools_3
3353 start_timestamp: 2019-02-13T15:33:50+00:00
3355 policy_execution_count: 23
3357 policy_execution_ok_count: 23
3359 policy_execution_fail_count: 0
3361 The table below shows some more examples of GET operations for
3364 ================================================================================================== ===================================================================================
3365 **Example** **Description**
3366 ================================================================================================== ===================================================================================
3367 *https:{url}:{port}/policy/pap/v1/pdps/statistics* Get statistics for all PDP Groups and subgroups in the system
3368 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.controlloop/statistics* Get statistics for all PDP Groups and subgroups that match the supplied name filter
3369 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.monitoring/subgroups/xacml/statistics* Get statistics for the specified subgroup
3371 ================================================================================================== ===================================================================================
3373 3.3.6 PDP Group Health Check
3374 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3376 A PDP group health check allows ordering of health checks on PDP groups
3377 and on individual PDPs. As health checks may be long lived operations,
3378 Health checks are scheduled for execution by this operation. Users check
3379 the result of a health check test by issuing a PDP Group Query operation
3380 (see Section 3.3.1) and checking the *healthy* field of PDPs.
3382 *https:{url}:{port}/policy/pap/v1/pdps/healthcheck PUT*
3384 The operation returns a HTTP status code of 202: Accepted if the health
3385 check request has been accepted by the PAP. The PAP then orders
3386 execution of the health check on the PDPs. The health check result is
3387 retrieved with a subsequent GET operation.
3389 The table below shows some more examples of PUT operations for ordering
3392 ======================================================================================================= ========================================================================================
3393 **Example** **Description**
3394 ======================================================================================================= ========================================================================================
3395 *https:{url}:{port}/policy/pap/v1/pdps/healthcheck PUT* Order a health check on all PDP Groups and subgroups in the system
3396 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.controlloop/healthcheck PUT* Order a health check on all PDP Groups and subgroups that match the supplied name filter
3397 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.monitoring/subgroups/xacml/healthcheck PUT* Order a health check on the specified subgroup
3399 ======================================================================================================= ========================================================================================
3401 3.4 Policy Decision API - Getting Policy Decisions
3402 --------------------------------------------------
3404 Policy decisions are required by ONAP components to support the
3405 policy-driven ONAP architecture. Policy Decisions are implemented using
3406 the XACML PDP. The calling application must provide attributes in order
3407 for the XACML PDP to return a correct decision.
3409 3.4.1 Decision API Schema
3410 ~~~~~~~~~~~~~~~~~~~~~~~~~
3412 The schema for the decision API is defined below.
3414 3.4.2 Decision API Queries
3415 ~~~~~~~~~~~~~~~~~~~~~~~~~~
3417 Decision API queries are implemented with a POST operation with a JSON
3418 body that specifies the filter for the policies to be returned. The JSON
3419 body must comply with the schema sepcified in Section 3.4.1.
3421 *https:{url}:{port}/decision/v1/ POST*
3424 *\ Description of the JSON Payload for the decision API Call
3426 ================================================================================================================ ======= ======== ==========================================================================
3427 **Field** **R/O** **Type** **Description**
3428 ================================================================================================================ ======= ======== ==========================================================================
3429 ONAPName R String Name of the ONAP Project that is making the request.
3430 ONAPComponent O String Name of the ONAP Project component that is making the request.
3431 ONAPInstance O String Optional instance identification for that ONAP component.
3432 action R String The action that the ONAP component is performing on a resource.
3434 eg. "configure" → DCAE uS onap.Monitoring policy Decisions to configure uS
3441 These sub metadata structures are used to refine which resource the ONAP component is performing an action upon.
3443 At least one is required in order for Policy to return a Decision.
3445 Multiple structures may be utilized to help refine a Decision.
3446 policy-type-name String The policy type name. This may be a regular expression.
3447 policy-id String The policy id. This may be a regular expression or an exact value.
3451 ================================================================================================================ ======= ======== ==========================================================================
3453 This example below shows the JSON body of a query for a specify
3456 **Decision API Call - Policy ID**
3462 "ONAPComponent": "PolicyHandler",
3464 "ONAPInstance": "622431a4-9dea-4eae-b443-3b2164639c64",
3466 "action": "configure",
3470 "policy-id": "onap.scaleout.tca"
3476 **Decision Response - Single Policy ID query**
3482 "onap.scaleout.tca": {
3484 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3490 "policy-id": "onap.scaleout.tca",
3500 "domain": "measurementsForVfScaling",
3502 "metricsPerEventName": [
3506 "eventName": "vLoadBalancer",
3508 "controlLoopSchemaType": "VNF",
3510 "policyScope": "type=configuration",
3512 "policyName": "onap.scaleout.tca",
3514 "policyVersion": "v0.0.1",
3520 "closedLoopControlName":
3521 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3523 "closedLoopEventStatus": "ONSET",
3528 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3530 "thresholdValue": 500,
3532 "direction": "LESS_OR_EQUAL",
3540 "closedLoopControlName":
3541 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3543 "closedLoopEventStatus": "ONSET",
3548 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3550 "thresholdValue": 5000,
3552 "direction": "GREATER_OR_EQUAL",
3554 "severity": "CRITICAL"
3577 This example below shows the JSON body of a query for a multiple
3580 **Decision API Call - Policy ID**
3586 "ONAPComponent": "PolicyHandler",
3588 "ONAPInstance": "622431a4-9dea-4eae-b443-3b2164639c64",
3590 "action": "configure",
3596 "onap.scaleout.tca",
3606 The following is the response object:
3608 **Decision Response - Single Policy ID query**
3614 "onap.scaleout.tca": {
3616 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3622 "policy-id": "onap.scaleout.tca"
3630 "domain": "measurementsForVfScaling",
3632 "metricsPerEventName": [
3636 "eventName": "vLoadBalancer",
3638 "controlLoopSchemaType": "VNF",
3640 "policyScope": "type=configuration",
3642 "policyName": "onap.scaleout.tca",
3644 "policyVersion": "v0.0.1",
3650 "closedLoopControlName":
3651 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3653 "closedLoopEventStatus": "ONSET",
3658 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3660 "thresholdValue": 500,
3662 "direction": "LESS_OR_EQUAL",
3670 "closedLoopControlName":
3671 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3673 "closedLoopEventStatus": "ONSET",
3678 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3680 "thresholdValue": 5000,
3682 "direction": "GREATER_OR_EQUAL",
3684 "severity": "CRITICAL"
3700 "onap.restart.tca": {
3702 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3708 "policy-id": "onap.restart.tca",
3718 "domain": "measurementsForVfScaling",
3720 "metricsPerEventName": [
3724 "eventName": "Measurement_vGMUX",
3726 "controlLoopSchemaType": "VNF",
3728 "policyScope": "DCAE",
3730 "policyName": "DCAE.Config_tca-hi-lo",
3732 "policyVersion": "v0.0.1",
3738 "closedLoopControlName":
3739 "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
3744 "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
3746 "thresholdValue": 0,
3748 "direction": "EQUAL",
3750 "severity": "MAJOR",
3752 "closedLoopEventStatus": "ABATED"
3758 "closedLoopControlName":
3759 "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
3764 "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
3766 "thresholdValue": 0,
3768 "direction": "GREATER",
3770 "severity": "CRITICAL",
3772 "closedLoopEventStatus": "ONSET"
3795 The simple draft example below shows the JSON body of a query in which
3796 all the deployed policies for a specific policy type are returned.
3802 "ONAPComponent": "PolicyHandler",
3804 "ONAPInstance": "622431a4-9dea-4eae-b443-3b2164639c64",
3806 "action": "configure",
3810 "policy-type": "onap.policies.monitoring.cdap.tca.hi.lo.app"
3816 The query above gives a response similar to the example shown below.
3822 "onap.scaleout.tca": {
3824 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3830 "policy-id": "onap.scaleout.tca",
3832 "policy-version": 1,
3840 "domain": "measurementsForVfScaling",
3842 "metricsPerEventName": [
3846 "eventName": "vLoadBalancer",
3848 "controlLoopSchemaType": "VNF",
3850 "policyScope": "type=configuration",
3852 "policyName": "onap.scaleout.tca",
3854 "policyVersion": "v0.0.1",
3860 "closedLoopControlName":
3861 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3863 "closedLoopEventStatus": "ONSET",
3868 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3870 "thresholdValue": 500,
3872 "direction": "LESS_OR_EQUAL",
3880 "closedLoopControlName":
3881 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3883 "closedLoopEventStatus": "ONSET",
3888 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3890 "thresholdValue": 5000,
3892 "direction": "GREATER_OR_EQUAL",
3894 "severity": "CRITICAL"
3910 "onap.restart.tca": {
3912 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3918 "policy-id": "onap.restart.tca",
3928 "domain": "measurementsForVfScaling",
3930 "metricsPerEventName": [
3934 "eventName": "Measurement_vGMUX",
3936 "controlLoopSchemaType": "VNF",
3938 "policyScope": "DCAE",
3940 "policyName": "DCAE.Config_tca-hi-lo",
3942 "policyVersion": "v0.0.1",
3948 "closedLoopControlName":
3949 "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
3954 "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
3956 "thresholdValue": 0,
3958 "direction": "EQUAL",
3960 "severity": "MAJOR",
3962 "closedLoopEventStatus": "ABATED"
3968 "closedLoopControlName":
3969 "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
3974 "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
3976 "thresholdValue": 0,
3978 "direction": "GREATER",
3980 "severity": "CRITICAL",
3982 "closedLoopEventStatus": "ONSET"
3998 "onap.vfirewall.tca": {
4000 "type": "onap.policy.monitoring.cdap.tca.hi.lo.app",
4006 "policy-id": "onap.vfirewall.tca",
4016 "domain": "measurementsForVfScaling",
4018 "metricsPerEventName": [
4022 "eventName": "vLoadBalancer",
4024 "controlLoopSchemaType": "VNF",
4026 "policyScope": "resource=vLoadBalancer;type=configuration",
4028 "policyName": "onap.vfirewall.tca",
4030 "policyVersion": "v0.0.1",
4036 "closedLoopControlName":
4037 "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
4039 "closedLoopEventStatus": "ONSET",
4044 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
4046 "thresholdValue": 500,
4048 "direction": "LESS_OR_EQUAL",
4056 "closedLoopControlName":
4057 "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
4059 "closedLoopEventStatus": "ONSET",
4064 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
4066 "thresholdValue": 5000,
4068 "direction": "GREATER_OR_EQUAL",
4070 "severity": "CRITICAL"
4090 4. Policy Framework Internal APIs
4091 =================================
4093 The Policy Framework uses the internal APIs documented in the
4094 subsections below. The APIs in this section are used for internal
4095 communication in the Policy Framework. The APIs are NOT supported for
4096 use by components outside the Policy Framework and are subject to
4097 revision and change at any time.
4102 This section describes the API between the PAP and PDPs. The APIs in
4103 this section are implemented using `DMaaP
4104 API <file://localhost/display/DW/DMaaP+API>`__ messaging. There are four
4105 messages on the API:
4107 1. PDP_STATUS: PDP→PAP, used by PDPs to report to the PAP
4109 2. PDP_UPDATE: PAP→PDP, used by the PAP to update the policies running
4110 on PDPs, triggers a PDP_STATUS message with the result of the
4111 PDP_UPDATE operation
4113 3. PDP_STATE_CHANGE: PAP→PDP, used by the PAP to change the state of
4114 PDPs, triggers a PDP_STATUS message with the result of the
4115 PDP_STATE_CHANGE operation
4117 4. PDP_HEALTH_CHECK: PAP→PDP, used by the PAP to order a heakth check on
4118 PDPs, triggers a PDP_STATUS message with the result of the
4119 PDP_HEALTH_CHECK operation
4121 The fields below are valid on API calls:
4123 ======================== ============================= ======== ======== ======= ====================================================================================================================================== ==================================================================================================================================================================================================
4124 **Field** **PDP **PDP **PDP **PDP **Comment**
4125 STATUS** UPDATE** STATE HEALTH
4127 ======================== ============================= ======== ======== ======= ====================================================================================================================================== ==================================================================================================================================================================================================
4128 (message_name) M M M M pdp_status, pdp_update, pdp_state_change, or pdp_health_check
4129 name M M C C The name of the PDP, for state changes and health checks, the PDP group and subgroup can be used to specify the scope of the operation
4130 version M N/A N/A N/A The version of the PDP
4131 pdp_type M M N/A N/A The type of the PDP, currently xacml, drools, or apex
4132 state M N/A M N/A The administrative state of the PDP group: PASSIVE, SAFE, TEST, ACTIVE, or TERMINATED
4133 healthy M N/A N/A N/A The result of the latest health check on the PDP: HEALTHY/NOT_HEALTHY/TEST_IN_PROGRESS
4134 description O O N/A N/A The description of the PDP
4135 pdp_group O M C C The PDP group to which the PDP belongs, the PDP group and subgroup can be used to specify the scope of the operation
4136 pdp_subgroup O M C C The PDP subgroup to which the PDP belongs, the PDP group and subgroup can be used to specify the scope of the operation
4137 supported_policy_types M N/A N/A N/A A list of the policy types supported by the PDP
4138 policies O M N/A N/A The list of policies running on the PDP
4139 \ (name) O M N/A N/A The name of a TOSCA policy running on the PDP
4140 \ policy_type O M N/A N/A The TOSCA policy type of the policyWhen a PDP starts, it commences periodic sending of *PDP_STATUS* messages on DMaaP. The PAP receives these messages and acts in whatever manner is appropriate.
4141 \ policy_type_version O M N/A N/A The version of the TOSCA policy type of the policy
4142 \ properties O M N/A N/A The properties of the policy for the XACML, Drools, or APEX PDP, see section 3.2 for details
4143 instance M N/A N/A N/A The instance ID of the PDP running in a Kuberenetes Pod
4144 deployment_instance_info M N/A N/A N/A Information on the node running the PDP
4145 properties O O N/A N/A Other properties specific to the PDP
4146 statistics M N/A N/A N/A Statistics on policy execution in the PDP
4147 \ policy_download_count M N/A N/A N/A The number of policies downloaded into the PDP
4148 \ policy_download_success_count M N/A N/A N/A The number of policies successfully downloaded into the PDP
4149 \ policy_download_fail_count M N/A N/A N/A The number of policies downloaded into the PDP where the download failed
4150 \ policy_executed_count M N/A N/A N/A The number of policy executions on the PDP
4151 \ policy_executed_success_count M N/A N/A N/A The number of policy executions on the PDP that completed successfully
4152 \ policy_executed_fail_count M N/A N/A N/A The number of policy executions on the PDP that failed
4153 response O N/A N/A N/A The response to the last operation that the PAP executed on the PDP
4154 \ response_to M N/A N/A N/A The PAP to PDP message to which this is a response
4155 \ response_status M N/A N/A N/A SUCCESS or FAIL
4156 \ response_message O N/A N/A N/A Message giving further information on the successful or failed operation
4157 ======================== ============================= ======== ======== ======= ====================================================================================================================================== ==================================================================================================================================================================================================
4159 YAML is used for illustrative purposes in the examples in this section.
4160 JSON (application/json) is used as the content type in the
4161 implementation of this API.
4163 | Note: The PAP checks that the set of policy types supported in all
4164 PDPs in a PDP subgroup are identical and will not add a PDP to a PDP
4165 subgroup that has a different set of supported policy types
4166 | Note: The PA checks that the set of policy loaded on all PDPs in a PDP
4167 subgroup are are identical and will not add a PDP to a PDP subgroup
4168 that has a different set of loaded policies
4170 4.1.1 PAP API for PDPs
4171 ~~~~~~~~~~~~~~~~~~~~~~
4173 The purpose of this API is for PDPs to provide heartbeat, status.
4174 health, and statistical information to Policy Administration. There is a
4175 single *PDP_STATUS* message on this API. PDPs send this message to the
4176 PAP using the *POLICY_PDP_PAP* DMaaP topic. The PAP listens on this
4179 When a PDP starts, it commences periodic sending of *PDP_STATUS*
4180 messages on DMaaP. The PAP receives these messages and acts in whatever
4181 manner is appropriate. *PDP_UPDATE*, *PDP_STATE_CHANGE*, and
4182 *PDP_HEALTH_CHECK* operations trigger a *PDP_STATUS* message as a
4185 The *PDP_STATUS* message is used for PDP heartbeat monitoring. A PDP
4186 sends a *PDP_STATUS* message with a state of \ *TERMINATED* when it
4187 terminates normally. If a \ *PDP_STATUS* message is not received from a
4188 PDP in a certain configurable time, then the PAP assumes the PDP has
4191 A PDP may be preconfigured with its PDP group, PDP subgroup, and
4192 policies. If the PDP group, subgroup, or any policy sent to the PAP in a
4193 *PDP_STATUS* message is unknown to the PAP, the PAP locks the PDP in
4196 **PDP_STATUS message from an XACML PDP running control loop policies**
4211 description: XACML PDP running control loop policies
4213 pdp_group: onap.pdpgroup.controlloop.operational
4217 supported_policy_types:
4219 - onap.policies.controlloop.guard.FrequencyLimiter
4221 - onap.policies.controlloop.guard.BlackList
4223 - onap.policies.controlloop.guard.MinMax
4227 - onap.policies.controlloop.guard.frequencylimiter.EastRegion:
4229 policy_type: onap.policies.controlloop.guard.FrequencyLimiter
4231 policy_type_version: 1.0.0
4235 # Omitted for brevity, see Section 3.2
4237 - onap.policies.controlloop.guard.blacklist.eastRegion:
4239 policy_type: onap.policies.controlloop.guard.BlackList
4241 policy_type_version: 1.0.0
4245 # Omitted for brevity, see Section 3.2
4247 - onap.policies.controlloop.guard.minmax.eastRegion:
4249 policy_type: onap.policies.controlloop.guard.MinMax
4251 policy_type_version: 1.0.0
4255 # Omitted for brevity, see Section 3.2
4259 deployment_instance_info:
4261 node_address: xacml_1_pod
4263 # Other deployment instance info
4267 policy_download_count: 0
4269 policy_download_success_count: 0
4271 policy_download_fail_count: 0
4273 policy_executed_count: 123
4275 policy_executed_success_count: 122
4277 policy_executed_fail_count: 1
4279 **PDP_STATUS message from a Drools PDP running control loop policies**
4294 description: Drools PDP running control loop policies
4296 pdp_group: onap.pdpgroup.controlloop.operational
4298 pdp_subgroup: drools
4300 supported_policy_types:
4302 - onap.controllloop.operational.drools.vCPE
4304 - onap.controllloop.operational.drools.vFW
4308 - onap.controllloop.operational.drools.vcpe.EastRegion:
4310 policy_type: onap.controllloop.operational.drools.vCPE
4312 policy_type_version: 1.0.0
4316 # Omitted for brevity, see Section 3.2
4318 - onap.controllloop.operational.drools.vfw.EastRegion:
4320 policy_type: onap.controllloop.operational.drools.vFW
4322 policy_type_version: 1.0.0
4326 # Omitted for brevity, see Section 3.2
4330 deployment_instance_info:
4332 node_address: drools_2_pod
4334 # Other deployment instance info
4338 policy_download_count: 3
4340 policy_download_success_count: 3
4342 policy_download_fail_count: 0
4344 policy_executed_count: 123
4346 policy_executed_success_count: 122
4348 policy_executed_fail_count: 1
4352 response_to: PDP_HEALTH_CHECK
4354 response_status: SUCCESS
4356 **PDP_STATUS message from an APEX PDP running control loop policies**
4371 description: APEX PDP running control loop policies
4373 pdp_group: onap.pdpgroup.controlloop.operational
4377 supported_policy_types:
4379 - onap.controllloop.operational.apex.BBS
4381 - onap.controllloop.operational.apex.SampleDomain
4385 - onap.controllloop.operational.apex.bbs.EastRegion:
4387 policy_type: onap.controllloop.operational.apex.BBS
4389 policy_type_version: 1.0.0
4393 # Omitted for brevity, see Section 3.2
4395 - onap.controllloop.operational.apex.sampledomain.EastRegion:
4397 policy_type: onap.controllloop.operational.apex.SampleDomain
4399 policy_type_version: 1.0.0
4403 # Omitted for brevity, see Section 3.2
4407 deployment_instance_info:node_address
4409 node_address: apex_3_pod
4411 # Other deployment instance info
4415 policy_download_count: 2
4417 policy_download_success_count: 2
4419 policy_download_fail_count: 0
4421 policy_executed_count: 123
4423 policy_executed_success_count: 122
4425 policy_executed_fail_count: 1
4429 response_to: PDP_UPDATE
4431 response_status: FAIL
4433 response_message: policies specified in update message incompatible with
4434 running policy state
4436 **PDP_STATUS message from an XACML PDP running monitoring policies**
4451 description: XACML PDP running monitoring policies
4453 pdp_group: onap.pdpgroup.Monitoring
4457 supported_policy_types:
4459 - onap.monitoring.cdap.tca.hi.lo.app
4463 - onap.scaleout.tca:message
4465 policy_type: onap.policies.monitoring.cdap.tca.hi.lo.app
4467 policy_type_version: 1.0.0
4471 # Omitted for brevity, see Section 3.2
4475 deployment_instance_info:
4477 node_address: xacml_1_pod
4479 # Other deployment instance info
4483 policy_download_count: 0
4485 policy_download_success_count: 0
4487 policy_download_fail_count: 0
4489 policy_executed_count: 123
4491 policy_executed_success_count: 122
4493 policy_executed_fail_count: 1
4495 4.1.2 PDP API for PAPs
4496 ~~~~~~~~~~~~~~~~~~~~~~
4498 The purpose of this API is for the PAP to load and update policies on
4499 PDPs and to change the state of PDPs. It also allows the PAP to order
4500 health checks to run on PDPs. The PAP sends \ *PDP_UPDATE*, \ *PDP\_*
4501 STATE_CHANGE, and *PDP_HEALTH_CHECK* messages to PDPs using the
4502 *POLICY_PAP_PDP* DMaaP topic. PDPs listens on this topic for messages.
4504 The PAP can set the scope of STATE_CHANGE, and *PDP_HEALTH_CHECK*
4507 - PDP Group: If a PDP group is specified in a message, then the PDPs in
4508 that PDP group respond to the message and all other PDPs ignore it.
4510 - PDP Group and subgroup: If a PDP group and subgroup are specified in
4511 a message, then only the PDPs of that subgroup in the PDP group
4512 respond to the message and all other PDPs ignore it.
4514 - Single PDP: If the name of a PDP is specified in a message, then only
4515 that PDP responds to the message and all other PDPs ignore it.
4517 Note: *PDP_UPDATE* messages must be issued individually to PDPs because
4518 the *PDP_UPDATE* operation can change the PDP group to which a PDP
4524 The *PDP_UPDATE* operation allows the PAP to modify the PDP group to
4525 which a PDP belongs and the policies in a PDP. Only PDPs in state
4526 PASSIVE accept this operation. The PAP must change the state of PDPs in
4527 state ACTIVE, TEST, or SAFE to state PASSIVE before issuing a
4528 *PDP_UPDATE* operation on a PDP.
4530 The following examples illustrate how the operation is used.
4532 **PDP_UPDATE message to upgrade XACML PDP control loop policies to
4533 versino 1.0.1** Expand source
4541 description: XACML PDP running control loop policies, Upgraded
4543 pdp_group: onap.pdpgroup.controlloop.operational
4549 - onap.policies.controlloop.guard.frequencylimiter.EastRegion:
4551 policy_type: onap.policies.controlloop.guard.FrequencyLimiter
4553 policy_type_version: 1.0.1
4557 # Omitted for brevity, see Section 3.2
4559 - onap.policies.controlloop.guard.blackList.EastRegion:
4561 policy_type: onap.policies.controlloop.guard.BlackList
4563 policy_type_version: 1.0.1
4567 # Omitted for brevity, see Section 3.2
4569 - onap.policies.controlloop.guard.minmax.EastRegion:
4571 policy_type: onap.policies.controlloop.guard.MinMax
4573 policy_type_version: 1.0.1
4577 # Omitted for brevity, see Section 3.2
4579 **PDP_UPDATE message to a Drools PDP to add an extra control loop
4580 policy** Expand source
4588 description: Drools PDP running control loop policies, extra policy
4591 pdp_group: onap.pdpgroup.controlloop.operational
4593 pdp_subgroup: drools
4597 - onap.controllloop.operational.drools.vcpe.EastRegion:
4599 policy_type: onap.controllloop.operational.drools.vCPE
4601 policy_type_version: 1.0.0
4605 # Omitted for brevity, see Section 3.2
4607 - onap.controllloop.operational.drools.vfw.EastRegion:
4609 policy_type: onap.controllloop.operational.drools.vFW
4611 policy_type_version: 1.0.0
4615 # Omitted for brevity, see Section 3.2
4617 - onap.controllloop.operational.drools.vfw.WestRegion:
4619 policy_type: onap.controllloop.operational.drools.vFW
4621 policy_type_version: 1.0.0
4625 # Omitted for brevity, see Section 3.2
4627 **PDP_UPDATE message to an APEX PDP to remove a control loop policy**
4636 description: APEX PDP updated to remove a control loop policy
4638 pdp_group: onap.pdpgroup.controlloop.operational
4644 - onap.controllloop.operational.apex.bbs.EastRegion:
4646 policy_type: onap.controllloop.operational.apex.BBS
4648 policy_type_version: 1.0.0
4652 # Omitted for brevity, see Section 3.2
4654 4.1.2.2 PDP State Change
4655 ^^^^^^^^^^^^^^^^^^^^^^^^
4657 The *PDP_STATE_CHANGE* operation allows the PAP to order state changes
4658 on PDPs in PDP groups and subgroups. The following examples illustrate
4659 how the operation is used.
4661 **Change the state of all control loop Drools PDPs to ACTIVE** Expand
4668 pdp_group: onap.pdpgroup.controlloop.Operational
4670 pdp_subgroup: drools
4672 **Change the state of all monitoring PDPs to SAFE** Expand source
4678 pdp_group: onap.pdpgroup.Monitoring
4680 **Change the state of a single APEX PDP to TEST** Expand source
4688 4.1.2.3 PDP Health Check
4689 ^^^^^^^^^^^^^^^^^^^^^^^^
4691 The *PDP_HEALTH_CHECK* operation allows the PAP to order health checks
4692 on PDPs in PDP groups and subgroups. The following examples illustrate
4693 how the operation is used.
4695 **Perform a health check on all control loop Drools PDPs** Expand
4700 pdp_group: onap.pdpgroup.controlloop.Operational
4702 pdp_subgroup: drools
4704 **perform a health check on all monitoring PDPs** Expand source
4708 pdp_group: onap.pdpgroup.Monitoring
4710 **Perform a health check on a single APEX PDP** Expand source
4716 4.2 Policy Type Implementations (Native Policies)
4717 -------------------------------------------------
4719 The policy Framework must have implementations for all Policy Type
4720 entities that may be specified in TOSCA. Policy type implementations are
4721 native policies for the various PDPs supported in the Policy Framework.
4722 They may be predefined and preloaded into the Policy Framework. In
4723 addition, they may also be added, modified, queried, or deleted using
4724 this API during runtime.
4726 The API supports CRUD of *PolicyTypeImpl* policy type implementations,
4727 where the XACML, Drools, and APEX policy type implementations are
4728 supplied as strings. This API is provided by the *PolicyDevelopment*
4729 component of the Policy Framework, see `The ONAP Policy
4730 Framework <file://localhost/display/DW/The+ONAP+Policy+Framework>`__
4733 | Note that client-side editing support for TOSCA *PolicyType*
4734 definitions or for *PolicyTypeImpl* implementations in XACML, Drools,
4735 or APEX is outside the current scope of the API.
4736 | Note: Preloaded policy type implementations may only be queried over
4737 this API, modification or deletion of preloaded policy type
4738 implementations is disabled.
4739 | Note: Policy type implementations that are in use (referenced by
4740 defined Policies) may not be deleted.
4742 The fields below are valid on API calls:
4744 =========== ======= ======== ========== ==========================================================================================================================
4745 **Field** **GET** **POST** **DELETE** **Comment**
4746 =========== ======= ======== ========== ==========================================================================================================================
4747 name M M M The name of the Policy Type implementation
4748 version O M C The version of the Policy Type implementation
4749 policy_type R M N/A The TOSCA policy type that this policy type implementation implements
4750 pdp_type R M N/A The PDP type of this policy type implementation, currently xacml, drools, or apex
4751 description R O N/A The description of the policy type implementation
4752 writable R N/A N/A Writable flag, false for predefined policy type implementations, true for policy type implementations defined over the API
4753 policy_body R M N/A The body (source) of the policy type implementation
4754 properties R O N/A Specific properties for the policy type implementation
4755 =========== ======= ======== ========== ==========================================================================================================================
4757 4.2.1 Policy Type Implementation Query
4758 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4760 This operation allows the PDP groups and subgroups to be listed together
4761 with the policies that are deployed on each PDP group and subgroup.
4763 *https:{url}:{port}/policy/api/v1/native/onap.policies.controlloop.operational/impls
4766 **Policy Type Implementation Query Result** Expand source
4770 - name: onap.policies.controlloop.operational.drools.Impl
4774 policy_type: onap.policies.controlloop.Operational
4778 description: Implementation of the drools control loop policies
4782 - name: onap.policies.controlloop.operational.apex.bbs.Impl
4786 policy_type: onap.policies.controlloop.operational.Apex
4790 description: Implementation of the APEX BBS control loop policy
4794 policy_body: "<policy body>"
4796 - name: onap.policies.controlloop.operational.apex.sampledomain.Impl
4800 policy_type: onap.policies.controlloop.operational.Apex
4804 description: Implementation of the SampleDomain test APEX policy
4808 policy_body: "<policy body>"
4810 The table below shows some more examples of GET operations
4812 ========================================================================================================================================================================= ==========================================================================================================================================================
4813 **Example** **Description**
4814 ========================================================================================================================================================================= ==========================================================================================================================================================
4815 *https:{url}:{port}/policy/api/v1/native/{policy type id}/impls* Get all Policy Type implementations for the given policy type
4818 | *https:{url}:{port}/policy/api/v1/native/onap.policies.monitoring/impls*
4819 | *https:{url}:{port}/policy/api/v1/native/onap.policies.controlloop.operational.apex/impls*
4820 *https:{url}:{port}/policy/api/v1/native/{policy type id}/impls/{policy type impl id}* Get all Policy Type implementation versions that match the policy type and policy type implementation IDs specified
4823 | *https:{url}:{port}/policy/api/v1/native/onap.policies.controlloop.operational/impls/onap.policies.controlloop.operational.drools.impl*
4824 | *https:{url}:{port}/policy/api/v1/native/onap.policies.controlloop.operational.apex/impls/onap.policies.controlloop.operational.apex.sampledomain.impl*
4825 *https:{url}:{port}/policy/api/v1/native/{policy type id}/impls/{policy type impl id}/versions/{version id}* Get the specific Policy Type implementation with the specified name and version, if the version ID is specified a *latest*, the latest version is returned
4828 | *https:{url}:{port}/policy/api/v1/native/onap.policies.controlloop.operational/impls/onap.policies.controlloop.operational.drools.impl/versions/1.2.3*
4829 | *https:{url}:{port}/policy/api/v1/native/onap.policies.controlloop.operational.apex/impls/onap.policies.controlloop.operational.apex.sampledomain.impl/versions/latest*
4830 ========================================================================================================================================================================= ==========================================================================================================================================================
4832 4.2.2 Policy Type Implementation Create/Update
4833 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4835 The API allows users (such as a policy editor or DevOps system) to
4836 create or update a Policy Type implementation using a POST operation.
4837 This API allows new Policy Type implementations to be created or
4838 existing Policy Type implementations to be modified. POST operations
4839 with a new name or a new version of an existing name are used to create
4840 a new Policy Type implementation. POST operations with an existing name
4841 and version are used to update an existing Policy Type implementations.
4842 Many implementations can be created or updated in a single POST
4843 operation by specifying more than one Policy Type implementation on the
4844 *policy_type_impls* list.
4846 For example, the POST operation below with the YAML body below is used
4847 to create a new APEX Policy type implementation.
4849 *https:{url}:{port}/policy/api/v1/native/onap.policies.controlloop.operational.apex/impls
4852 **Create a new Policy Type Implementation** Expand source
4856 - onap.policies.controlloop.operational.apex.bbs.Impl:
4860 policy_type: onap.policies.controlloop.operational.Apex
4864 description: Implementation of the APEX BBS control loop policy
4866 policy_body: "<policy body>"
4868 - onap.policies.controlloop.operational.apex.sampledomain.Impl:
4872 policy_type: onap.policies.controlloop.operational.Apex
4876 description: Implementation of the APEX SampleDomain control loop policy
4878 policy_body: "<policy body>
4880 Once this call is made, the Policy Type query in Section 3.1.2.1 returns
4881 a result with the new Policy Type implementation defined.
4883 4.2.3 Policy Type Implementation Delete
4884 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4886 The API also allows Policy Type implementations to be deleted with a
4887 DELETE operation. The format of the delete operation is as below:
4889 *https:{url}:{port}/api/v1/native/onap.policies.controlloop.operational.apex/impls/onap.policies.apex.bbs.impl/versions/1.0.0
4892 | Note: Predefined policy type implementations cannot be deleted
4893 | Note: Policy type implementations that are in use (Parameterized by a
4894 TOSCA Policy) may not be deleted, the parameterizing TOSCA policies
4895 must be deleted first
4896 | Note: The *version* parameter may be omitted on the DELETE operation
4897 if there is only one version of the policy type implementation in the