Initial set of documentation
[policy/parent.git] / docs / design / foo.rst
1 .. contents::
2    :depth: 3
3 ..
4
5 Policy Design and API Flow for Model Driven Control Loop
6 ========================================================
7
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.
10
11 -  `1 Policy Types <#PolicyDesignandAPIFlowforModelDrivenCon>`__
12
13    -  `1.1 onap.policies.Monitoring Policy
14       Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
15
16    -  `1.2 onap.policies.controlloop.Operational Policy
17       Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
18
19       -  `1.2.1 Operational Policy Type Schema for
20          Drools <#PolicyDesignandAPIFlowforModelDrivenCon>`__
21
22       -  `1.2.3 Operational Policy Type Schema for APEX (El Alto
23          proposal) <#PolicyDesignandAPIFlowforModelDrivenCon>`__
24
25    -  `1.3 onap.policies.controlloop.Guard Policy
26       Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
27
28       -  `1.3.1 onap.policies.controlloop.guard.FrequencyLimiter Policy
29          Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
30
31       -  `1.3.2 onap.policies.controlloop.guard.Blacklist Policy
32          Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
33
34       -  `1.3.3 onap.policies.controlloop.guard.MinMax Policy
35          Type <#PolicyDesignandAPIFlowforModelDrivenCon>`__
36
37    -  `1.3.4 onap.policies.controlloop.Coordination Policy Type
38       (STRETCH) <#PolicyDesignandAPIFlowforModelDrivenCon>`__
39
40 -  `2 PDP Deployment and Registration with
41    PAP <#PolicyDesignandAPIFlowforModelDrivenCon>`__
42
43 -  `3. Public APIs <#PolicyDesignandAPIFlowforModelDrivenCon>`__
44
45    -  `3.1 Policy Type Design API for TOSCA Policy
46       Types <#PolicyDesignandAPIFlowforModelDrivenCon>`__
47
48       -  `3.1.1 Policy Type
49          query <#PolicyDesignandAPIFlowforModelDrivenCon>`__
50
51       -  `3.1.2 Policy Type
52          Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
53
54       -  `3.1.3 Policy Type
55          Delete <#PolicyDesignandAPIFlowforModelDrivenCon>`__
56
57    -  `3.2 Policy Design
58       API <#PolicyDesignandAPIFlowforModelDrivenCon>`__
59
60       -  `3.2.1 Policy
61          query <#PolicyDesignandAPIFlowforModelDrivenCon>`__
62
63       -  `3.2.2 Policy
64          Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
65
66          -  `3.2.2.1 Monitoring Policy
67             Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
68
69             -  `3.2.2.2.1 Drools Operational Policy
70                Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
71
72             -  `3.2.2.2.2 APEX Operational Policy
73                Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
74
75          -  `3.2.2.3 Guard Policy
76             Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
77
78          -  `3.2.2.4 Policy Lifecycle API - Creating Coordination
79             Policies <#PolicyDesignandAPIFlowforModelDrivenCon>`__
80
81       -  `3.2.3 Policy
82          Delete <#PolicyDesignandAPIFlowforModelDrivenCon>`__
83
84    -  `3.3 Policy Administration
85       API <#PolicyDesignandAPIFlowforModelDrivenCon>`__
86
87       -  `3.3.1 PDP Group
88          Query <#PolicyDesignandAPIFlowforModelDrivenCon>`__
89
90       -  `3.3.2 PDP Group
91          Deployment <#PolicyDesignandAPIFlowforModelDrivenCon>`__
92
93       -  `Simple API for CLAMP to deploy one or more policy-id's with
94          optional
95          policy-version. <#PolicyDesignandAPIFlowforModelDrivenCon>`__
96
97       -  `Simple API for CLAMP to undeploy a policy-id with optional
98          policy-version. <#PolicyDesignandAPIFlowforModelDrivenCon>`__
99
100       -  `3.3.3 PDP Group
101          Delete <#PolicyDesignandAPIFlowforModelDrivenCon>`__
102
103       -  `3.3.4 PDP Group State
104          Management <#PolicyDesignandAPIFlowforModelDrivenCon>`__
105
106       -  `3.3.5 PDP Group
107          Statistics <#PolicyDesignandAPIFlowforModelDrivenCon>`__
108
109       -  `3.3.6 PDP Group Health
110          Check <#PolicyDesignandAPIFlowforModelDrivenCon>`__
111
112    -  `3.4 Policy Decision API - Getting Policy
113       Decisions <#PolicyDesignandAPIFlowforModelDrivenCon>`__
114
115       -  `3.4.1 Decision API
116          Schema <#PolicyDesignandAPIFlowforModelDrivenCon>`__
117
118       -  `3.4.2 Decision API
119          Queries <#PolicyDesignandAPIFlowforModelDrivenCon>`__
120
121 -  `4. Policy Framework Internal
122    APIs <#PolicyDesignandAPIFlowforModelDrivenCon>`__
123
124    -  `4.1 PAP to PDP API <#PolicyDesignandAPIFlowforModelDrivenCon>`__
125
126       -  `4.1.1 PAP API for
127          PDPs <#PolicyDesignandAPIFlowforModelDrivenCon>`__
128
129       -  `4.1.2 PDP API for
130          PAPs <#PolicyDesignandAPIFlowforModelDrivenCon>`__
131
132          -  `4.1.2.1 PDP
133             Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
134
135          -  `4.1.2.2 PDP State
136             Change <#PolicyDesignandAPIFlowforModelDrivenCon>`__
137
138          -  `4.1.2.3 PDP Health
139             Check <#PolicyDesignandAPIFlowforModelDrivenCon>`__
140
141    -  `4.2 Policy Type Implementations (Native
142       Policies) <#PolicyDesignandAPIFlowforModelDrivenCon>`__
143
144       -  `4.2.1 Policy Type Implementation
145          Query <#PolicyDesignandAPIFlowforModelDrivenCon>`__
146
147       -  `4.2.2 Policy Type Implementation
148          Create/Update <#PolicyDesignandAPIFlowforModelDrivenCon>`__
149
150       -  `4.2.3 Policy Type Implementation
151          Delete <#PolicyDesignandAPIFlowforModelDrivenCon>`__
152
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.
156
157 Please see the :ref:`TOSCA Policy
158 Primer <tosca-policy>`__ page for an
159 introduction to TOSCA policy concepts.
160
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.
166
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.
175
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.
186
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. 
193
194 1 Policy Types
195 ==============
196
197 Policy Type Design manages TOSCA *PolicyType* artifacts and their
198 *PolicyTypeImpl* implementations\ *.*
199
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.
205
206 The \ *PolicyType* definitions and implementations listed below are
207 preloaded and are always available for use in the Policy Framework.
208
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 ====================================== ==================================================================================================
217
218 1.1 onap.policies.Monitoring Policy Type
219 ----------------------------------------
220
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.
225
226 **Base Policy Type definition for onap.policies.Monitoring**  
227
228 .. codeblock:: yaml
229
230     tosca_definitions_version: tosca_simple_yaml_1_0_0
231     topology_template:
232         policy_types:
233             - onap.policies.Monitoring:
234                 derived_from: tosca.policies.Root
235                 version: 1.0.0
236                 description: a base policy type for all policies that govern monitoring provision
237
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.
245
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
249 Tosca Lab
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>`__.
255
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.
259
260 **PolicyType onap.policies.monitoring.MyDCAEComponent derived from
261 onap.policies.Monitoring**  Expand source
262
263 tosca_definitions_version: tosca_simple_yaml_1_0_0
264
265 policy_types:
266
267 - onap.policies.Monitoring:
268
269 derived_from: tosca.policies.Root
270
271 version: 1.0.0
272
273 description: a base policy type for all policies that govern monitoring
274 provision
275
276 - onap.policies.monitoring.MyDCAEComponent:
277
278 derived_from: onap.policies.Monitoring
279
280 version: 1.0.0
281
282 properties:
283
284 mydcaecomponent_policy:
285
286 type: map
287
288 description: The Policy Body I need
289
290 entry_schema:
291
292 type: onap.datatypes.monitoring.mydatatype
293
294 data_types:
295
296 - onap.datatypes.monitoring.MyDataType:
297
298 derived_from: tosca.datatypes.Root
299
300 properties:
301
302 my_property_1:
303
304 type: string
305
306 description: A description of this property
307
308 constraints:
309
310 - valid_values:
311
312 - value example 1
313
314 - value example 2
315
316 TCA Example - Please note that the official version of this will be
317 located in the SDC repository.
318
319 **Example TCA DCAE microservice**  Expand source
320
321 tosca_definitions_version: tosca_simple_yaml_1_0_0
322
323 policy_types:
324
325 onap.policies.Monitoring:
326
327 derived_from: tosca.policies.Root
328
329 description: a base policy type for all policies that governs monitoring
330 provisioning
331
332 onap.policy.monitoring.cdap.tca.hi.lo.app:
333
334 derived_from: onap.policies.Monitoring
335
336 version: 1.0.0
337
338 properties:
339
340 tca_policy:
341
342 type: map
343
344 description: TCA Policy JSON
345
346 entry_schema:
347
348 type: onap.datatypes.monitoring.tca_policy
349
350 data_types:
351
352 onap.datatypes.monitoring.metricsPerEventName:
353
354 derived_from: tosca.datatypes.Root
355
356 properties:
357
358 controlLoopSchemaType:
359
360 type: string
361
362 required: true
363
364 description: Specifies Control Loop Schema Type for the event Name e.g.
365 VNF, VM
366
367 constraints:
368
369 - valid_values:
370
371 - VM
372
373 - VNF
374
375 eventName:
376
377 type: string
378
379 required: true
380
381 description: Event name to which thresholds need to be applied
382
383 policyName:
384
385 type: string
386
387 required: true
388
389 description: TCA Policy Scope Name
390
391 policyScope:
392
393 type: string
394
395 required: true
396
397 description: TCA Policy Scope
398
399 policyVersion:
400
401 type: string
402
403 required: true
404
405 description: TCA Policy Scope Version
406
407 thresholds:
408
409 type: list
410
411 required: true
412
413 description: Thresholds associated with eventName
414
415 entry_schema:
416
417 type: onap.datatypes.monitoring.thresholds
418
419 onap.datatypes.monitoring.tca_policy:
420
421 derived_from: tosca.datatypes.Root
422
423 properties:
424
425 domain:
426
427 type: string
428
429 required: true
430
431 description: Domain name to which TCA needs to be applied
432
433 default: measurementsForVfScaling
434
435 constraints:
436
437 - equal: measurementsForVfScaling
438
439 metricsPerEventName:
440
441 type: list
442
443 required: true
444
445 description: Contains eventName and threshold details that need to be
446 applied to given eventName
447
448 entry_schema:
449
450 type: onap.datatypes.monitoring.metricsPerEventName
451
452 onap.datatypes.monitoring.thresholds:
453
454 derived_from: tosca.datatypes.Root
455
456 properties:
457
458 closedLoopControlName:
459
460 type: string
461
462 required: true
463
464 description: Closed Loop Control Name associated with the threshold
465
466 closedLoopEventStatus:
467
468 type: string
469
470 required: true
471
472 description: Closed Loop Event Status of the threshold
473
474 constraints:
475
476 - valid_values:
477
478 - ONSET
479
480 - ABATED
481
482 direction:
483
484 type: string
485
486 required: true
487
488 description: Direction of the threshold
489
490 constraints:
491
492 - valid_values:
493
494 - LESS
495
496 - LESS_OR_EQUAL
497
498 - GREATER
499
500 - GREATER_OR_EQUAL
501
502 - EQUAL
503
504 fieldPath:
505
506 type: string
507
508 required: true
509
510 description: Json field Path as per CEF message which needs to be
511 analyzed for TCA
512
513 constraints:
514
515 - valid_values:
516
517 -
518 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta
519
520 -
521 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta
522
523 -
524 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta
525
526 -
527 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta
528
529 -
530 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta
531
532 -
533 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta
534
535 -
536 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta
537
538 -
539 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated
540
541 -
542 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated
543
544 -
545 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated
546
547 -
548 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated
549
550 -
551 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated
552
553 -
554 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated
555
556 -
557 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated
558
559 -
560 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta
561
562 -
563 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta
564
565 -
566 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta
567
568 -
569 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta
570
571 -
572 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta
573
574 -
575 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta
576
577 -
578 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta
579
580 -
581 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated
582
583 -
584 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated
585
586 -
587 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated
588
589 -
590 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated
591
592 -
593 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated
594
595 -
596 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated
597
598 -
599 $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated
600
601 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle
602
603 -
604 $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt
605
606 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice
607
608 -
609 $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq
610
611 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal
612
613 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem
614
615 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait
616
617 - $.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage
618
619 - $.event.measurementsForVfScalingFields.meanRequestLatency
620
621 -
622 $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered
623
624 -
625 $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached
626
627 -
628 $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured
629
630 - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree
631
632 - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed
633
634 -
635 $.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value
636
637 severity:
638
639 type: string
640
641 required: true
642
643 description: Threshold Event Severity
644
645 constraints:
646
647 - valid_values:
648
649 - CRITICAL
650
651 - MAJOR
652
653 - MINOR
654
655 - WARNING
656
657 - NORMAL
658
659 thresholdValue:
660
661 type: integer
662
663 required: true
664
665 description: Threshold value for the field Path inside CEF message
666
667 version:
668
669 type: string
670
671 required: true
672
673 description: Version number associated with the threshold
674
675 1.2 onap.policies.controlloop.Operational Policy Type
676 -----------------------------------------------------
677
678 This policy type is used to support actor/action operational policies
679 for control loops. There are two types of implementations for this
680 policy type
681
682 1. Existing Drools implementations that supports runtime Control Loop
683    actions taken on components such as SO/APPC/VFC/SDNC/SDNR
684
685 2. New implementations using APEX to support Control Loops.
686
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
689 TBD for El Alto.
690
691 **Base Policy type definition for
692 onap.policies.controlloop.Operational**  Expand source
693
694 tosca_definitions_version: tosca_simple_yaml_1_0_0
695
696 policy_types:
697
698 onap.policies.controlloop.Operational:
699
700 derived_from: tosca.policies.Root
701
702 version: 1.0.0
703
704 description: Operational Policy for Control Loops
705
706 Applications should use the following Content-Type when creating
707 onap.policies.controlloop.Operational policies:
708
709 Content-Type: "application/yaml; vnd.onap.operational"
710
711 1.2.1 Operational Policy Type Schema for Drools
712 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
713
714 For Dublin Drools will still support the Casablanca YAML definition of
715 an Operational Policy for Control Loops.
716
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.
719
720 1.2.3 Operational Policy Type Schema for APEX (El Alto proposal)
721 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
722
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.
726
727 **Operational Policy Model Parameter Schema for APEX**  Expand source
728
729 tosca_definitions_version: tosca_simple_yaml_1_0_0
730
731 # Note: The full APEX PolicyType definition will be developed during the
732 Dublin
733
734 # timeframe of the ONAP project
735
736 policy_types:
737
738 onap.policies.controlloop.Operational:
739
740 derived_from: tosca.policies.Root
741
742 version: 1.0.0
743
744 description: Operational Policy for Control Loops
745
746  onap.policies.controloop.operational.Apex:
747
748 derived_from: onap.policies.controlloop.Operational
749
750 version: 1.0.0
751
752 description: Operational Policy for Control Loops using the APEX PDP
753
754  properties:
755
756 # Some of these properties may be redundant in a Kubernetes deployment
757
758 engine_service:
759
760 type: onap.datatypes.policies.controlloop.operational.apex.EngineService
761
762 description: APEX Engine Service Parameters
763
764 inputs:
765
766 type: map
767
768 description: Inputs for handling events coming into the APEX engine
769
770 entry_schema:
771
772 type: onap.datatypes.policies.controlloop.operational.apex.EventHandler
773
774 outputs:
775
776 type: map
777
778 description: Outputs for handling events going out of the APEX engine
779
780 entry_schema:
781
782 type: onap.datatypes.policies.controlloop.operational.apex.EventHandler
783
784 environment:
785
786 type: list
787
788 description: Envioronmental parameters for the APEX engine
789
790 entry_schema:
791
792 type: onap.datatypes.policies.controlloop.operational.apex.Environment
793
794 data_types:
795
796 onap.datatypes.policies.controlloop.operational.apex.EngineService:
797
798 derived_from: tosca.datatypes.Root
799
800 properties:
801
802 name:
803
804 type: string
805
806 description: Specifies the engine name
807
808 required: false
809
810 default: "ApexEngineService"
811
812 version:
813
814 type: string
815
816 description: Specifies the engine version in double dotted format
817
818 required: false
819
820 default: "1.0.0"
821
822 id:
823
824 type: int
825
826 description: Specifies the engine id
827
828 required: true
829
830 instance_count:
831
832 type: int
833
834 description: Specifies the number of engine threads that should be run
835
836 required: true
837
838 deployment_port:
839
840 type: int
841
842 description: Specifies the port to connect to for engine administration
843
844 required: false
845
846 default: 1
847
848 policy_model_file_name:
849
850 type: string
851
852 description: The name of the file from which to read the APEX policy
853 model
854
855 required: false
856
857 default: ""
858
859   policy_type_impl:
860
861 type: string
862
863 description: The policy type implementation from which to read the APEX
864 policy model
865
866 required: false
867
868 default: ""
869
870 periodic_event_period:
871
872 type: string
873
874 description: The time interval in milliseconds for the periodic scanning
875
876 event, 0 means "don't scan"
877
878 required: false
879
880 default: 0
881
882 engine:
883
884 type:
885 onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine
886
887 description: The parameters for all engines in the APEX engine service
888
889 required: true
890
891 onap.datatypes.policies.controlloop.operational.apex.EventHandler:
892
893 derived_from: tosca.datatypes.Root
894
895 properties:
896
897 name:
898
899 type: string
900
901 description: Specifies the event handler name, if not specified this is
902 set to
903
904 the key name
905
906  required: false
907
908 carrier_technology:
909
910 type:
911 onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology
912
913 description: Specifies the carrier technology of the event handler (such
914
915 as REST/Web Socket/Kafka)
916
917 required: true
918
919 event_protocol:
920
921 type: onap.datatypes.policies.controlloop.operational.apex.EventProtocol
922
923 description: Specifies the event protocol of events for the event
924 handler
925
926 (such as Yaml/JSON/XML/POJO)
927
928 required: true
929
930 event_name:
931
932 type: string
933
934 description: Specifies the event name for events on this event handler,
935 if
936
937 not specified, the event name is read from or written to the event being
938
939 received or sent
940
941 required: false
942
943 event_name_filter:
944
945 type: string
946
947 description: Specifies a filter as a regular expression, events that do
948
949 not match the filter are dropped, the default is to let all events
950
951 through
952
953 required: false
954
955 synchronous_mode:
956
957 type: bool
958
959 description: Specifies the event handler is syncronous (receive event
960 and
961
962 send response)
963
964 required: false
965
966 default: false
967
968 synchronous_peer:
969
970 type: string
971
972 description: The peer event handler (output for input or input for
973 output)
974
975 of this event handler in synchronous mode, this parameter is mandatory
976 if
977
978 the event handler is in synchronous mode
979
980 required: false
981
982 default: ""
983
984 synchronous_timeout:
985
986 type: int
987
988 description: The timeout in milliseconds for responses to be issued by
989
990 APEX torequests, this parameter is mandatory if the event handler is in
991
992 synchronous mode
993
994 required: false
995
996 default: ""
997
998 requestor_mode:
999
1000 type: bool
1001
1002 description: Specifies the event handler is in requestor mode (send
1003 event
1004
1005 and wait for response mode)
1006
1007 required: false
1008
1009 default: false
1010
1011 requestor_peer:
1012
1013 type: string
1014
1015 description: The peer event handler (output for input or input for
1016 output)
1017
1018 of this event handler in requestor mode, this parameter is mandatory if
1019
1020 the event handler is in requestor mode
1021
1022 required: false
1023
1024 default: ""
1025
1026 requestor_timeout:
1027
1028 type: int
1029
1030 description: The timeout in milliseconds for wait for responses to
1031
1032 requests, this parameter is mandatory if the event handler is in
1033
1034 requestor mode
1035
1036 required: false
1037
1038 default: ""
1039
1040 onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology:
1041
1042 derived_from: tosca.datatypes.Root
1043
1044 properties:
1045
1046 label:
1047
1048 type: string
1049
1050 description: The label (name) of the carrier technology (such as REST,
1051
1052 Kafka, WebSocket)
1053
1054 required: true
1055
1056 plugin_parameter_class_name:
1057
1058 type: string
1059
1060 description: The class name of the class that overrides default handling
1061
1062 of event input or output for this carrier technology, defaults to the
1063 supplied
1064
1065 input or output class
1066
1067 required: false
1068
1069 onap.datatypes.policies.controlloop.operational.apex.EventProtocol:
1070
1071 derived_from: tosca.datatypes.Root
1072
1073 properties:
1074
1075 label:
1076
1077 type: string
1078
1079 description: The label (name) of the event protocol (such as Yaml,
1080
1081 JSON, XML, or POJO)
1082
1083 required: true
1084
1085 event_protocol_plugin_class:
1086
1087 type: string
1088
1089 description: The class name of the class that overrides default handling
1090
1091 of the event protocol for this carrier technology, defaults to the
1092
1093 supplied event protocol class
1094
1095 required: false
1096
1097 onap.datatypes.policies.controlloop.operational.apex.Environmental:
1098
1099 derived_from: tosca.datatypes.Root
1100
1101 properties:
1102
1103 name:
1104
1105 type: string
1106
1107 description: The name of the environment variable
1108
1109 required: true
1110
1111 value:
1112
1113 type: string
1114
1115 description: The value of the environment variable
1116
1117 required: true
1118
1119 onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine:
1120
1121 derived_from: tosca.datatypes.Root
1122
1123 properties:
1124
1125 context:
1126
1127 type:
1128 onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context
1129
1130 description: The properties for handling context in APEX engines,
1131
1132 defaults to using Java maps for context
1133
1134 required: false
1135
1136 executors:
1137
1138 type: map
1139
1140 description: The plugins for policy executors used in engines such as
1141
1142 javascript, MVEL, Jython
1143
1144 required: true
1145
1146 entry_schema:
1147
1148 description: The plugin class path for this policy executor
1149
1150 type: string
1151
1152 onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context:
1153
1154 derived_from: tosca.datatypes.Root
1155
1156 properties:
1157
1158 distributor:
1159
1160 type: onap.datatypes.policies.controlloop.operational.apex.Plugin
1161
1162 description: The plugin to be used for distributing context between
1163
1164 APEX PDPs at runtime
1165
1166 required: false
1167
1168 schemas:
1169
1170 type: map
1171
1172 description: The plugins for context schemas available in APEX PDPs
1173
1174 such as Java and Avro
1175
1176 required: false
1177
1178 entry_schema:
1179
1180 type: onap.datatypes.policies.controlloop.operational.apex.Plugin
1181
1182 locking:
1183
1184 type: onap.datatypes.policies.controlloop.operational.apex.plugin
1185
1186 description: The plugin to be used for locking context in and
1187
1188 between APEX PDPs at runtime
1189
1190 required: false
1191
1192 persistence:
1193
1194 type: onap.datatypes.policies.controlloop.operational.apex.Plugin
1195
1196 description: The plugin to be used for persisting context for APEX PDPs
1197
1198 at runtime
1199
1200 required: false
1201
1202 onap.datatypes.policies.controlloop.operational.apex.Plugin:
1203
1204 derived_from: tosca.datatypes.Root
1205
1206 properties:
1207
1208 name:
1209
1210 type: string
1211
1212 description: The name of the executor such as Javascript, Jython or MVEL
1213
1214 required: true
1215
1216 plugin_class_name:
1217
1218 type: string
1219
1220 description: The class path of the plugin class for this executor
1221
1222 1.3 onap.policies.controlloop.Guard Policy Type
1223 -----------------------------------------------
1224
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.
1231
1232 The base schema is defined as below:
1233
1234 **Base Policy type definition for onap.policies.controlloop.Guard**
1235  Expand source
1236
1237 tosca_definitions_version: tosca_simple_yaml_1_0_0
1238
1239 policy_types:
1240
1241 - onap.policies.controlloop.Guard:
1242
1243 derived_from: tosca.policies.Root
1244
1245 version: 1.0.0
1246
1247 description: Guard Policies for Control Loop Operational Policies
1248
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.
1253
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.
1257
1258 **Casablanca Guard Payload**  Expand source
1259
1260 ContentType: "application/json; vnd.onap.guard"
1261
1262 Accepts: "application/json"
1263
1264 #
1265
1266 # Request BODY
1267
1268 #
1269
1270 {
1271
1272 "policy-id" : "guard.frequency.scaleout",
1273
1274 "contents" : {
1275
1276 "actor": "SO",
1277
1278 "recipe": "scaleOut",
1279
1280 "targets": ".*",
1281
1282 "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
1283
1284 "limit": "1",
1285
1286 "timeWindow": "10",
1287
1288 "timeUnits": "minute",
1289
1290 "guardActiveStart": "00:00:01-05:00",
1291
1292 "guardActiveEnd": "23:59:59-05:00"
1293
1294 }
1295
1296 }
1297
1298 #
1299
1300 # Request RESPONSE
1301
1302 #
1303
1304 {
1305
1306 "guard.frequency.scaleout": {
1307
1308 "type": "onap.policies.controlloop.guard.FrequencyLimiter",
1309
1310 "version": "1.0.0",
1311
1312 "metadata": {
1313
1314 "policy-id": "guard.frequency.scaleout",
1315
1316 "policy-version": 1
1317
1318 }
1319
1320 }
1321
1322 }
1323
1324 1.3.1 onap.policies.controlloop.guard.FrequencyLimiter Policy Type
1325 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1326
1327 This is WIP for El Alto for the proposed policy type.
1328
1329 **Policy Typefor Frequency Limiter Guard Policy**  Expand source
1330
1331 tosca_definitions_version: tosca_simple_yaml_1_0_0
1332
1333 policy_types:
1334
1335 - onap.policies.controlloop.Guard:
1336
1337 derived_from: tosca.policies.Root
1338
1339 version: 1.0.0
1340
1341 description: Guard Policies for Control Loop Operational Policies
1342
1343 - onap.policies.controlloop.guard.FrequencyLimiter:
1344
1345 derived_from: onap.policies.controlloop.Guard
1346
1347 version: 1.0.0
1348
1349 description: Supports limiting the frequency of actions being taken by a
1350 Actor.
1351
1352 properties:
1353
1354 frequency_policy:
1355
1356 type: map
1357
1358 description:
1359
1360 entry_schema:
1361
1362 type: onap.datatypes.guard.FrequencyLimiter
1363
1364 data_types:
1365
1366 - onap.datatypes.guard.FrequencyLimiter:
1367
1368 derived_from: tosca.datatypes.Root
1369
1370 properties:
1371
1372 actor:
1373
1374 type: string
1375
1376 description: Specifies the Actor
1377
1378 required: true
1379
1380 recipe:
1381
1382 type: string
1383
1384 description: Specified the Recipe
1385
1386 required: true
1387
1388 time_window:
1389
1390 type: scalar-unit.time
1391
1392 description: The time window to count the actions against.
1393
1394 required: true
1395
1396 limit:
1397
1398 type: integer
1399
1400 description: The limit
1401
1402 required: true
1403
1404 constraints:
1405
1406 - greater_than: 0
1407
1408 time_range:
1409
1410 type: tosca.datatypes.TimeInterval
1411
1412 description: An optional range of time during the day the frequency is
1413 valid for.
1414
1415 required: false
1416
1417 controlLoopName:
1418
1419 type: string
1420
1421 description: An optional specific control loop to apply this guard to.
1422
1423 required: false
1424
1425 target:
1426
1427 type: string
1428
1429 description: An optional specific VNF to apply this guard to.
1430
1431 required: false
1432
1433 1.3.2 onap.policies.controlloop.guard.Blacklist Policy Type
1434 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1435
1436 **Policy Type for Blacklist Guard Policies**  Expand source
1437
1438 tosca_definitions_version: tosca_simple_yaml_1_0_0
1439
1440 policy_types:
1441
1442 - onap.policies.controlloop.Guard:
1443
1444 derived_from: tosca.policies.Root
1445
1446 version: 1.0.0
1447
1448 description: Guard Policies for Control Loop Operational Policies
1449
1450 - onap.policies.controlloop.guard.Blacklist:
1451
1452 derived_from: onap.policies.controlloop.Guard
1453
1454 version: 1.0.0
1455
1456 description: Supports blacklist of VNF's from performing control loop
1457 actions on.
1458
1459 properties:
1460
1461 blacklist_policy:
1462
1463 type: map
1464
1465 description:
1466
1467 entry_schema:
1468
1469 type: onap.datatypes.guard.Blacklist
1470
1471 data_types:
1472
1473 - onap.datatypes.guard.Blacklist:
1474
1475 derived_from: tosca.datatypes.Root
1476
1477 properties:
1478
1479 actor:
1480
1481 type: string
1482
1483 description: Specifies the Actor
1484
1485 required: true
1486
1487 recipe:
1488
1489 type: string
1490
1491 description: Specified the Recipe
1492
1493 required: true
1494
1495 time_range:
1496
1497 type: tosca.datatypes.TimeInterval
1498
1499 description: An optional range of time during the day the blacklist is
1500 valid for.
1501
1502 required: false
1503
1504 controlLoopName:
1505
1506 type: string
1507
1508 description: An optional specific control loop to apply this guard to.
1509
1510 required: false
1511
1512 blacklist:
1513
1514 type: list
1515
1516 description: List of VNF's
1517
1518 required: true
1519
1520 1.3.3 onap.policies.controlloop.guard.MinMax Policy Type
1521 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1522
1523 **Policy Type for Min/Max VF Module Policies**  Expand source
1524
1525 policy_types:
1526
1527 - onap.policies.controlloop.Guard:
1528
1529 derived_from: tosca.policies.Root
1530
1531 version: 1.0.0
1532
1533 description: Guard Policies for Control Loop Operational Policies
1534
1535 - onap.policies.controlloop.guard.MinMax:
1536
1537 derived_from: onap.policies.controlloop.Guard
1538
1539 version: 1.0.0
1540
1541 description: Supports Min/Max number of VF Modules
1542
1543 properties:
1544
1545 minmax_policy:
1546
1547 type: map
1548
1549 description:
1550
1551 entry_schema:
1552
1553 type: onap.datatypes.guard.MinMax
1554
1555 data_types:
1556
1557 - onap.datatypes.guard.MinMax:
1558
1559 derived_from: tosca.datatypes.Root
1560
1561 properties:
1562
1563 actor:
1564
1565 type: string
1566
1567 description: Specifies the Actor
1568
1569 required: true
1570
1571 recipe:
1572
1573 type: string
1574
1575 description: Specified the Recipe
1576
1577 required: true
1578
1579 time_range:
1580
1581 type: tosca.datatypes.TimeInterval
1582
1583 description: An optional range of time during the day the Min/Max limit
1584 is valid for.
1585
1586 required: false
1587
1588 controlLoopName:
1589
1590 type: string
1591
1592 description: An optional specific control loop to apply this guard to.
1593
1594 required: false
1595
1596 min_vf_module_instances:
1597
1598 type: integer
1599
1600 required: true
1601
1602 description: The minimum instances of this VF-Module
1603
1604 max_vf_module_instances:
1605
1606 type: integer
1607
1608 required: false
1609
1610 description: The maximum instances of this VF-Module
1611
1612 1.3.4 onap.policies.controlloop.Coordination Policy Type (STRETCH)
1613 ------------------------------------------------------------------
1614
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.
1619
1620 2 PDP Deployment and Registration with PAP
1621 ==========================================
1622
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*.
1627
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.
1634
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.
1638
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
1641 running on PDPs.
1642
1643 The table below shows the methods in which *PolicyImpl* entities can be
1644 deployed to PDP Subgroups
1645
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.
1650                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
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.
1653                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
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.
1656                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
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 =============== ================================================================================================================================================================================================================================================================================== ================================================================================================================================================================================ ========================================================================================================================================================================================================================
1659
1660 3. Public APIs
1661 ==============
1662
1663 The Policy Framework supports the APIs documented in the subsections
1664 below. The APIs in this section are supported for use by external
1665 components.
1666
1667 3.1 Policy Type Design API for TOSCA Policy Types
1668 -------------------------------------------------
1669
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>`__
1674 architecture.
1675
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:
1680
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 ============ ======= ======== ========== ===============================================================================================================================
1693
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
1699   disabled.
1700 | Note: Policy types  that are in use (referenced by defined Policies)
1701   may not be deleted
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
1705
1706 3.1.1 Policy Type query
1707 ~~~~~~~~~~~~~~~~~~~~~~~
1708
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.
1712
1713 *https:{url}:{port}/policy/api/v1/policytypes GET*
1714
1715 **Policy Type Query - When system comes up before any mS are onboarded**
1716  Expand source
1717
1718 policy_types:
1719
1720 - onap.policies.Monitoring:
1721
1722 version: 1.0.0
1723
1724 description: A base policy type for all policies that govern monitoring
1725 provision
1726
1727 derived_from: tosca.policies.Root
1728
1729 properties:
1730
1731 # Omitted for brevity, see Section 1
1732
1733  - onap.policies.controlloop.Operational:
1734
1735 version: 1.0.0
1736
1737   description: Operational Policy for Control Loops
1738
1739 derived_from: tosca.policies.Root
1740
1741 properties:
1742
1743 # Omitted for brevity, see Section 1
1744
1745 - onap.policies.controloop.operational.Drools:
1746
1747 version: 1.0.0
1748
1749 description: Operational Policy for Control Loops using the Drools PDP
1750
1751 derived_from: onap.policies.controlloop.Operational
1752
1753 properties:
1754
1755 # Omitted for brevity, see Section 1
1756
1757 - onap.policies.controloop.operational.Apex:
1758
1759 version: 1.0.0
1760
1761 description: Operational Policy for Control Loops using the APEX PDP
1762
1763 derived_from: onap.policies.controlloop.Operational
1764
1765 properties:
1766
1767 # Omitted for brevity, see Section 1
1768
1769  - onap.policies.controlloop.Guard:
1770
1771 version: 1.0.0
1772
1773 description: Operational Policy for Control Loops
1774
1775 derived_from: tosca.policies.Root
1776
1777 properties:
1778
1779 # Omitted for brevity, see Section 1
1780
1781 - onap.policies.controlloop.guard.FrequencyLimiter:
1782
1783 version: 1.0.0
1784
1785   description: Supports limiting the frequency of actions being taken by
1786 a Actor.
1787
1788 derived_from: onap.policies.controlloop.Guard
1789
1790 properties:
1791
1792 # Omitted for brevity, see Section 1
1793
1794 - onap.policies.controlloop.guard.Blacklist:
1795
1796 version: 1.0.0
1797
1798 description: Supports blacklist of VNF's from performing control loop
1799 actions on.
1800
1801 derived_from: onap.policies.controlloop.Guard
1802
1803 properties:
1804
1805 # Omitted for brevity, see Section 1
1806
1807 - onap.policies.controlloop.guard.MinMax:
1808
1809 version: 1.0.0
1810
1811 description: Supports Min/Max number of VF Modules
1812
1813 derived_from: onap.policies.controlloop.Guard
1814
1815 properties:
1816
1817 # Omitted for brevity, see Section 1
1818
1819 - onap.policies.controlloop.coordination.TBD: (STRETCH GOALS)
1820
1821 version: 1.0.0
1822
1823 description: Control Loop Coordination policy types
1824
1825 derived_from: onap.policies.controlloop.Coordination
1826
1827 properties:
1828
1829 # Omitted for brevity, see Section 1
1830
1831 data_types:
1832
1833 # Any bespoke data types referenced by policy type definitions
1834
1835 The table below shows some more examples of GET operations
1836
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.
1842                                                                                                         
1843 *eg.                                                                                                    
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
1846                                                                                                         
1847 *eg.                                                                                                    
1848 https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0*
1849 ======================================================================================================== ================================================================
1850
1851 3.1.2 Policy Type Create/Update
1852 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1853
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.
1863
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.
1866
1867 *https:{url}:{port}/policy/api/v1/policytypes POST*
1868
1869 **Create a new Policy Type for a DCAE microservice**  Expand source
1870
1871 policy_types:
1872
1873 - onap.policies.monitoring.cdap.tca.hi.lo.app:
1874
1875 version: 1.0.0
1876
1877   derived_from: onap.policies.Monitoring
1878
1879 description: A DCAE TCA high/low policy type
1880
1881 properties:
1882
1883 tca_policy:
1884
1885 type: map
1886
1887 description: TCA Policy JSON
1888
1889 default:'{<JSON omitted for brevity>}'
1890
1891 entry_schema:
1892
1893 type: onap.datatypes.monitoring.tca_policy
1894
1895 data_types:
1896
1897 <omitted for brevity>
1898
1899 Following creation of a DCAE TCA policy type operation, the GET call for
1900 Monitoring policies will list the new policy type. 
1901
1902 *https:{url}:{port}/policy/api/v1/policytypes GET*
1903
1904 **Policy Type Query after DCAE TCA mS Policy Type is created**  Expand
1905 source
1906
1907 policy_types:
1908
1909 - onap.policies.Monitoring:
1910
1911 version: 1.0.0
1912
1913 derived_from: tosca.policies.Root
1914
1915 description: A base policy type for all policies that govern monitoring
1916 provision
1917
1918 - onap.policies.monitoring.cdap.tca.hi.lo.app:
1919
1920 version: 1.0.0
1921
1922   derived_from: onap.policies.Monitoring
1923
1924 description: A DCAE TCA high/low policy type
1925
1926 - onap.policies.controlloop.Operational:
1927
1928 version: 1.0.0
1929
1930 description: Operational Policy for Control Loops
1931
1932 derived_from: tosca.policies.Root
1933
1934 - onap.policies.controloop.operational.Drools:
1935
1936 version: 1.0.0
1937
1938 description: Operational Policy for Control Loops using the Drools PDP
1939
1940 derived_from: onap.policies.controlloop.Operational
1941
1942 - onap.policies.controloop.operational.Apex:
1943
1944 version: 1.0.0
1945
1946 description: Operational Policy for Control Loops using the APEX PDP
1947
1948 derived_from: onap.policies.controlloop.Operational
1949
1950 - onap.policies.controlloop.Guard:
1951
1952 version: 1.0.0
1953
1954 description: Operational Policy for Control Loops
1955
1956 derived_from: tosca.policies.Root
1957
1958 - onap.policies.controlloop.guard.FrequencyLimiter:
1959
1960 version: 1.0.0
1961
1962 description: Supports limiting the frequency of actions being taken by a
1963 Actor.
1964
1965 derived_from: onap.policies.controlloop.Guard
1966
1967 - onap.policies.controlloop.guard.Blacklist:
1968
1969 version: 1.0.0
1970
1971 description: Supports blacklist of VNF's from performing control loop
1972 actions on.
1973
1974 derived_from: onap.policies.controlloop.Guard
1975
1976 - onap.policies.controlloop.guard.MinMax:
1977
1978 version: 1.0.0
1979
1980 description: Supports Min/Max number of VF Modules
1981
1982 derived_from: onap.policies.controlloop.Guard
1983
1984 - onap.policies.controlloop.coordination.TBD: (STRETCH GOALS)
1985
1986 version: 1.0.0
1987
1988 description: Control Loop Coordination policy types
1989
1990 derived_from: onap.policies.controlloop.Coordination
1991
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
1997 above.
1998
1999 3.1.3 Policy Type Delete
2000 ~~~~~~~~~~~~~~~~~~~~~~~~
2001
2002 The API also allows Policy Types to be deleted with a DELETE operation.
2003 The format of the delete operation is as below:
2004
2005 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0
2006 DELETE*
2007
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
2011   first
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
2014
2015 3.2 Policy Design API
2016 ---------------------
2017
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
2023 Policy
2024 Framework <file://localhost/display/DW/The+ONAP+Policy+Framework>`__
2025 architecture.
2026
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:
2030
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
2036 description R       O        O         
2037 metadata    R       O        N/A       
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 =========== ======= ======== ========== ================================================================================
2041
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
2049
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.
2053
2054 3.2.1 Policy query
2055 ~~~~~~~~~~~~~~~~~~
2056
2057 The API allows applications (such as CLAMP and Integration) to query
2058 the \ *Policy* entities that are available for deployment using a GET
2059 operation.
2060
2061 Note: This operation simply returns TOSCA policies that are defined in
2062 the Policy Framework, it does NOT make a decision.
2063
2064 The table below shows some more examples of GET operations
2065
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
2070                                                                                                                                                                                                     
2071 *eg.                                                                                                                                                                                                
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
2074                                                                                                                                                                                                     
2075 *eg.                                                                                                                                                                                                
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 ==================================================================================================================================================================================================== ===================================================================================
2081
2082 3.2.2 Policy Create/Update
2083 ~~~~~~~~~~~~~~~~~~~~~~~~~~
2084
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*
2092 list.
2093
2094 3.2.2.1 Monitoring Policy Create/Update
2095 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2096
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.
2101
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
2106 themselves.
2107
2108 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.Monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies POST*
2109
2110 **TOSCA Body of a new TCA High/Low Policy**  Expand source
2111
2112 https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies
2113 POST
2114
2115 Content-Type: application/yaml
2116
2117 Accept: application/yaml
2118
2119 #Request Body
2120
2121 policies:
2122
2123 -
2124
2125 onap.scaleout.tca:
2126
2127   type: onap.policies.monitoring.cdap.tca.hi.lo.app
2128
2129 version: 1.0.0
2130
2131 metadata:
2132
2133 policy-id: onap.scaleout.tca # SHOULD MATCH THE TOSCA policy-name field
2134 above. DCAE needs this - convenience.
2135
2136 description: The scaleout policy for vDNS # GOOD FOR CLAMP GUI
2137
2138 properties:
2139
2140 domain: measurementsForVfScaling
2141
2142 metricsPerEventName:
2143
2144 -
2145
2146 eventName: vLoadBalancer
2147
2148 controlLoopSchemaType: VNF
2149
2150 policyScope: "type=configuration"
2151
2152 policyName: "onap.scaleout.tca"
2153
2154 policyVersion: "v0.0.1"
2155
2156 thresholds:
2157
2158 - closedLoopControlName:
2159 "CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A"
2160
2161 closedLoopEventStatus: ONSET
2162
2163 version: "1.0.2"
2164
2165 fieldPath:
2166 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
2167
2168 thresholdValue: 500
2169
2170 direction: LESS_OR_EQUAL
2171
2172 severity: MAJOR
2173
2174 -
2175
2176 closedLoopControlName:
2177 "CL-LBAL-LOW-TRAFFIC-SIG-0C5920A6-B564-8035-C878-0E814352BC2B"
2178
2179 closedLoopEventStatus: ONSET
2180
2181 version: "1.0.2"
2182
2183 fieldPath:
2184 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
2185
2186 thresholdValue: 5000
2187
2188 direction: GREATER_OR_EQUAL
2189
2190 severity: CRITICAL
2191
2192 #Response Body
2193
2194 policies:
2195
2196 - onap.scaleout.tca:
2197
2198 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2199
2200 version: 1.0.0
2201
2202 metadata:
2203
2204 #
2205
2206 # version is managed by Policy Lifecycle and returned
2207
2208 # back to the caller.
2209
2210 #
2211
2212 policy-version: 1
2213
2214 #
2215
2216 # These were passed in, and should not be changed. Will
2217
2218 # be passed back.
2219
2220 #
2221
2222 policy-id: onap.scaleout.tca
2223
2224 properties:
2225
2226 domain: measurementsForVfScaling
2227
2228 metricsPerEventName:
2229
2230 -
2231
2232 eventName: vLoadBalancer
2233
2234 controlLoopSchemaType: VNF
2235
2236 policyScope: "type=configuration"
2237
2238 <OMITTED FOR BREVITY>
2239
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.
2246
2247 The following new policy will be listed and will have a "metadata"
2248 section as shown below:
2249
2250 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies
2251 GET*
2252
2253 **Policy with Metadata section for lifecycle management**  Expand source
2254
2255 policies:
2256
2257 - onap.scaleout.tca:
2258
2259 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2260
2261 version: 1.0.0
2262
2263 metadata:
2264
2265 policy-id: onap.scaleout.tca
2266
2267 policy-version: 1
2268
2269 - my.other.policy:
2270
2271 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2272
2273 version: 1.0.0
2274
2275 metadata:
2276
2277 invariantUUID: 20ad46cc-6b16-4404-9895-93d2baaa8d25
2278
2279 UUID: 4f715117-08b9-4221-9d63-f3fa86919742
2280
2281 version: 5
2282
2283 name: my.other.policy
2284
2285 scope: foo=bar;field2=value2
2286
2287 description: The policy for some other use case
2288
2289 - yet.another.policy:
2290
2291 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2292
2293 version: 1.0.0
2294
2295 metadata:
2296
2297 invariantUUID: 20ad46cc-6b16-4404-9895-93d2baaa8d25
2298
2299 UUID: 4f715117-08b9-4221-9d63-f3fa86919742
2300
2301 version: 3
2302
2303 name: yet.another.policy
2304
2305 scope: foo=bar;
2306
2307 description: The policy for yet another use case
2308
2309 The contents of the new policy can be retrieved using the ID:
2310
2311 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.scaleout.tca
2312 GET*
2313
2314 **Query on a new TCA High/Low Policy**  Expand source
2315
2316 policies:
2317
2318 -
2319
2320 onap.scaleout.tca:
2321
2322 type: onap.policies.monitoring.cdap.tca.hi.lo.app
2323
2324 version: 1.0.0
2325
2326 metadata:
2327
2328 invariantUUID: 20ad46cc-6b16-4404-9895-93d2baaa8d25
2329
2330 UUID: 4f715117-08b9-4221-9d63-f3fa86919742
2331
2332 version: 1
2333
2334 name: onap.scaleout.tca
2335
2336 scope: foo=bar;
2337
2338 description: The scaleout policy for vDNS
2339
2340 properties:
2341
2342 domain: measurementsForVfScaling
2343
2344 <OMMITTED FOR BREVITY>
2345
2346 **3.2.2.2 Operational Policy Create/Update**
2347
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.
2351
2352 This URL will be fixed for CLAMP in Dublin and the payload will match
2353 updated version of Casablanca YAML that supports VFModules.
2354
2355 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.controloop.operational/versions/1.0.0/policies POST*
2356
2357 *Content-Type: application/yaml; legacy-version*
2358
2359 FUTURE: Content-Type: application/yaml; tosca
2360
2361 NOTE: The controlLoopName will be assumed to be the policy-id
2362
2363 **Create an Operational Policy**  Expand source
2364
2365 tosca_definitions_version: tosca_simple_yaml_1_0_0
2366
2367 topology_template:
2368
2369 policies:
2370
2371 -
2372
2373 operational.scaleout:
2374
2375 type: onap.policies.controlloop.Operational
2376
2377 version: 1.0.0
2378
2379 metadata:
2380
2381 policy-id: operational.scaleout
2382
2383 properties:
2384
2385 controlLoop:
2386
2387 version: 2.0.0
2388
2389 controlLoopName: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
2390
2391 trigger_policy: unique-policy-id-1-scale-up
2392
2393 timeout: 1200
2394
2395 abatement: false
2396
2397 policies:
2398
2399 - id: unique-policy-id-1-scale-up
2400
2401 name: Create a new VF Module
2402
2403 description:
2404
2405 actor: SO
2406
2407 recipe: VF Module Create
2408
2409 target:
2410
2411 type: VNF
2412
2413 payload:
2414
2415 requestParameters: '{"usePreload":true,"userParams":[]}'
2416
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]"}]'
2419
2420 retry: 0
2421
2422 timeout: 1200
2423
2424 success: final_success
2425
2426 failure: final_failure
2427
2428 failure_timeout: final_failure_timeout
2429
2430 failure_retries: final_failure_retries
2431
2432 failure_exception: final_failure_exception
2433
2434 failure_guard: final_failure_guard
2435
2436 **Response from creating Operational Policy**  Expand source
2437
2438 tosca_definitions_version: tosca_simple_yaml_1_0_0
2439
2440 topology_template:
2441
2442 policies:
2443
2444 -
2445
2446 operational.scaleout:
2447
2448 type: onap.policies.controlloop.Operational
2449
2450 version: 1.0.0
2451
2452 metadata:
2453
2454 policy-id: operational.scaleout
2455
2456 policy-version: 1
2457
2458 properties:
2459
2460 controlLoop:
2461
2462 version: 2.0.0
2463
2464 controlLoopName: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
2465
2466 trigger_policy: unique-policy-id-1-scale-up
2467
2468 timeout: 1200
2469
2470 abatement: false
2471
2472 policies:
2473
2474 - id: unique-policy-id-1-scale-up
2475
2476 name: Create a new VF Module
2477
2478 description:
2479
2480 actor: SO
2481
2482 recipe: VF Module Create
2483
2484 target:
2485
2486 type: VNF
2487
2488 payload:
2489
2490 requestParameters: '{"usePreload":true,"userParams":[]}'
2491
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]"}]'
2494
2495 retry: 0
2496
2497 timeout: 1200
2498
2499 success: final_success
2500
2501 failure: final_failure
2502
2503 failure_timeout: final_failure_timeout
2504
2505 failure_retries: final_failure_retries
2506
2507 failure_exception: final_failure_exception
2508
2509 failure_guard: final_failure_guard
2510
2511 3.2.2.2.1 Drools Operational Policy Create/Update
2512 '''''''''''''''''''''''''''''''''''''''''''''''''
2513
2514 TBD `Jorge Hernandez <file://localhost/display/~jhh>`__
2515
2516 3.2.2.2.2 APEX Operational Policy Create/Update
2517 '''''''''''''''''''''''''''''''''''''''''''''''
2518
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
2521 policy type.
2522
2523 *https:{url}:{port}/policy/api/v1/policytypes/onap.policies.controloop.operational.apex/versions/1.0.0/policies POST*
2524
2525 **Create an APEX Policy for a Sample Domain**  Expand source
2526
2527 policies:
2528
2529 - onap.policy.operational.apex.sampledomain.Test:
2530
2531 type: onap.policies.controloop.operational.Apex
2532
2533 properties:
2534
2535 engine_service:
2536
2537 name: "MyApexEngine"
2538
2539 version: "0.0.1"
2540
2541 id: 45
2542
2543 instance_count: 4
2544
2545 deployment_port: 12561
2546
2547 policy_type_impl:
2548 "onap.policies.controlloop.operational.apex.sampledomain.Impl"
2549
2550 engine:
2551
2552 executors:
2553
2554 JAVASCRIPT:
2555 "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
2556
2557 inputs:
2558
2559 first_consumer:
2560
2561 carrier_technology:
2562
2563 label: "RESTCLIENT",
2564
2565 plugin_parameter_class_name:
2566 "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
2567
2568 parameters:
2569
2570 url: "https://localhost:32801/EventGenerator/GetEvents"
2571
2572 event_protocol:
2573
2574 label: "JSON"
2575
2576 outputs:
2577
2578 first_producer:
2579
2580 carrier_technology:
2581
2582 label: "RESTCLIENT",
2583
2584 plugin_parameter_class_name:
2585 "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
2586
2587 parameters:
2588
2589 url: "https://localhost:32801/EventGenerator/PostEvent"
2590
2591 event_protocol:
2592
2593 label: "JSON"
2594
2595 3.2.2.3 Guard Policy Create/Update
2596 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2597
2598 TBD `Pamela Dragosh <file://localhost/display/~pdragosh>`__ Similar to
2599 Operational Policies
2600
2601 3.2.2.4 Policy Lifecycle API - Creating Coordination Policies
2602 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2603
2604 TBD Similar to Operational Policies, stretch for Dublin
2605
2606 3.2.3 Policy Delete
2607 ~~~~~~~~~~~~~~~~~~~
2608
2609 The API also allows Policies to be deleted with a DELETE operation. The
2610 format of the delete operation is as below:
2611
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.
2616                                                                                                                                            
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 =========================================================================================================================================== =========================================================================================================================================
2619
2620 3.3 Policy Administration API
2621 -----------------------------
2622
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>`__
2630 architecture.
2631
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.
2636
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.
2641
2642 The fields below are valid on API calls:
2643
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 ============= ====================== ======================== ========== ========================================================================= ===================================================================== ==============================================================================================
2671
2672 Note: In the Dublin release, the *policy_type_impl* of all policy types
2673 in a PDP subgroup must be the same.
2674
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.
2678
2679 3.3.1 PDP Group Query
2680 ~~~~~~~~~~~~~~~~~~~~~
2681
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.
2684
2685 *https:{url}:{port}/policy/pap/v1/pdps GET*
2686
2687 **PDP Group query for all PDP groups and Subgroups**  Expand source
2688
2689 pdp_groups:
2690
2691 - name: onap.pdpgroup.controlloop.Operational
2692
2693 version: 1.0.0
2694
2695 state: active
2696
2697 description: ONAP Control Loop Operational and Guard policies
2698
2699   properties:
2700
2701 # PDP group level properties if any
2702
2703 pdp_subgroups:
2704
2705 pdp_type: drools
2706
2707 supported_policy_types:
2708
2709 - onap.controllloop.operational.drools.vCPE
2710
2711 - onap.controllloop.operational.drools.vFW
2712
2713   policies:
2714
2715 - onap.controllloop.operational.drools.vCPE.eastRegion:
2716
2717 policy_type: onap.controllloop.operational.drools.vCPE
2718
2719 policy_type_version: 1.0.0
2720
2721 policy_type_impl: onap.controllloop.operational.drools.impl
2722
2723 - onap.controllloop.operational.drools.vFW.eastRegion:
2724
2725 policy_type: onap.controllloop.operational.drools.vFW
2726
2727 policy_type_version: 1.0.0
2728
2729 policy_type_impl: onap.controllloop.operational.drools.impl
2730
2731 min_instance_count: 3
2732
2733  instance_count: 3
2734
2735 properties:
2736
2737 # The properties below are for illustration only
2738
2739 instance_spawn_load_threshold: 70%
2740
2741 instance_kill_load_threshold: 50%
2742
2743 instance_geo_redundancy: true
2744
2745 deployment_info:
2746
2747 service_endpoint: https://<the drools service endpoint for this PDP
2748 group>
2749
2750 deployment: A deployment identifier
2751
2752 # Other deployment info
2753
2754 instances:
2755
2756 - instance: drools_1
2757
2758 state: active
2759
2760 healthy: yes
2761
2762 deployment_instance_info:
2763
2764 node_address: drools_1_pod
2765
2766 # Other deployment instance info
2767
2768 - instance: drools_2
2769
2770 state: active
2771
2772 healthy: yes
2773
2774  deployment_instance_info:
2775
2776 node_address: drools_2_pod
2777
2778 # Other deployment instance info
2779
2780 - instance: drools_3
2781
2782 state: active
2783
2784 healthy: yes
2785
2786  deployment_instance_info:
2787
2788 node_address: drools_3_pod
2789
2790 # Other deployment instance info
2791
2792 - pdp_type: apex
2793
2794 supported_policy_types:
2795
2796 - onap.controllloop.operational.apex.BBS
2797
2798 - onap.controllloop.operational.apex.SampleDomain
2799
2800 policies:
2801
2802 - onap.controllloop.operational.apex.BBS.eastRegion:
2803
2804 policy_type: onap.controllloop.operational.apex.BBS
2805
2806 policy_type_version: 1.0.0
2807
2808 policy_type_impl: onap.controllloop.operational.apex.impl
2809
2810 - onap.controllloop.operational.apex.sampledomain.eastRegion:
2811
2812 policy_type: onap.controllloop.operational.apex.SampleDomain
2813
2814 policy_type_version: 1.0.0
2815
2816 policy_type_impl: onap.controllloop.operational.apex.impl
2817
2818 min_instance_count: 2
2819
2820  instance_count: 3
2821
2822 properties:
2823
2824 # The properties below are for illustration only
2825
2826 instance_spawn_load_threshold: 80%
2827
2828 instance_kill_load_threshold: 60%
2829
2830 instance_geo_redundancy: true
2831
2832 deployment_info:
2833
2834 service_endpoint: https://<the apex service endpoint for this PDP group>
2835
2836 deployment: A deployment identifier
2837
2838 # Other deployment info
2839
2840 instances:
2841
2842 - instance: apex_1
2843
2844 state: active
2845
2846 healthy: yes
2847
2848   deployment_instance_info:
2849
2850 node_address: apex_1_podgroup
2851
2852 # Other deployment instance info
2853
2854 - instance: apex_2
2855
2856 deployment_instance_info:
2857
2858 node_address: apex_2_pod
2859
2860 # Other deployment instance infoCreation
2861
2862 - instance: apex_3
2863
2864 state: active
2865
2866 healthy: yes
2867
2868   deployment_instance_info:
2869
2870 node_address: apex_3_pod
2871
2872 # Other deployment instance info
2873
2874 - pdp_type: xacml
2875
2876 supported_policy_types:
2877
2878 - onap.policies.controlloop.guard.FrequencyLimiter
2879
2880   - onap.policies.controlloop.guard.BlackList
2881
2882 - onap.policies.controlloop.guard.MinMax
2883
2884 policies:
2885
2886 - onap.policies.controlloop.guard.frequencylimiter.EastRegion:
2887
2888 policy_type: onap.policies.controlloop.guard.FrequencyLimiter
2889
2890 policy_type_version: 1.0.0
2891
2892 policy_type_impl: onap.controllloop.guard.impl
2893
2894 - onap.policies.controlloop.guard.blackList.EastRegion:
2895
2896 policy_type: onap.policies.controlloop.guard.BlackList
2897
2898 policy_type_version: 1.0.0
2899
2900 policy_type_impl: onap.controllloop.guard.impl
2901
2902 - onap.policies.controlloop.Guard.MinMax.EastRegion:
2903
2904 policy_type: onap.policies.controlloop.guard.MinMax
2905
2906 policy_type_version: 1.0.0
2907
2908 policy_type_impl: onap.controllloop.guard.impl
2909
2910 min_instance_count: 2
2911
2912   instance_count: 2
2913
2914 properties:
2915
2916 # The properties below are for illustration only
2917
2918 instance_geo_redundancy: true
2919
2920 deployment_info:
2921
2922 service_endpoint: https://<the XACML service endpoint for this PDP
2923 group>
2924
2925 deployment: A deployment identifier
2926
2927 # Other deployment info
2928
2929 instances:
2930
2931 - instance: xacml_1
2932
2933 state: active
2934
2935 healthy: yes
2936
2937  deployment_instance_info:
2938
2939 node_address: xacml_1_pod
2940
2941 # Other deployment instance info
2942
2943 - instance: xacml_2
2944
2945 state: active
2946
2947 healthy: yes
2948
2949  deployment_instance_info:
2950
2951 node_address: xacml_2_pod
2952
2953 # Other deployment instance info
2954
2955 - name: onap.pdpgroup.monitoring
2956
2957 version: 2.1.3
2958
2959 state: active
2960
2961 description: DCAE mS Configuration Policies
2962
2963 properties:
2964
2965 # PDP group level properties if any
2966
2967 pdp_subgroups:
2968
2969 - pdp_type: xacml
2970
2971 supported_policy_types:
2972
2973 - onap.policies.monitoring.cdap.tca.hi.lo.app
2974
2975 policies:
2976
2977 - onap.scaleout.tca:
2978
2979 policy_type: onap.policies.monitoring.cdap.tca.hi.lo.app
2980
2981 policy_type_version: 1.0.0
2982
2983 policy_type_impl: onap.policies.monitoring.impl
2984
2985 min_instance_count: 2
2986
2987  instance_count: 2
2988
2989 properties:
2990
2991 # The properties below are for illustration only
2992
2993 instance_geo_redundancy: true
2994
2995 deployment_info:
2996
2997 service_endpoint: https://<the XACML service endpoint for this PDP
2998 group>
2999
3000 deployment: A deployment identifier
3001
3002 # Other deployment info
3003
3004 instances:
3005
3006 - instance: xacml_1
3007
3008 state: active
3009
3010 healthy: yes
3011
3012  deployment_instance_info:
3013
3014 node_address: xacml_1_pod
3015
3016 # Other deployment instance info
3017
3018 - instance: xacml_2
3019
3020 state: active
3021
3022 healthy: yes
3023
3024  deployment_instance_info:
3025
3026 node_address: xacml_2_pod
3027
3028 # Other deployment instance info
3029
3030 The table below shows some more examples of GET operations
3031
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
3038 \                                                                                      
3039 ======================================================================================= ================================================================
3040
3041 3.3.2 PDP Group Deployment
3042 ~~~~~~~~~~~~~~~~~~~~~~~~~~
3043
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.
3049
3050 *https:{url}:{port}/policy/pap/v1/pdps POST*
3051
3052 **POST body to deploy or update PDP groups**  Expand source
3053
3054 pdp_groups:
3055
3056 - name: onap.pdpgroup.controlloop.operational
3057
3058 description: ONAP Control Loop Operational and Guard policies
3059
3060 pdp_subgroups:
3061
3062 - pdp_type: drools
3063
3064 supportedPolicyTypes:
3065
3066 - onap.controllloop.operational.drools.vcpe.EastRegion
3067
3068 version: 1.2.3
3069
3070 - onap.controllloop.operational.drools.vfw.EastRegion
3071
3072 version: 1.2.3
3073
3074 min_instance_count: 3group
3075
3076 properties:
3077
3078 # The properties below are for illustration only
3079
3080 instance_spawn_load_threshold: 70%
3081
3082 instance_kill_load_threshold: 50%
3083
3084 instance_geo_redundancy: true
3085
3086 - pdp_type: apex
3087
3088 policies:
3089
3090 - onap.controllloop.operational.apex.bbs.EastRegion
3091
3092 version: 1.2.3
3093
3094 - onap.controllloop.operational.apex.sampledomain.EastRegion
3095
3096 version: 1.2.3
3097
3098 min_instance_count: 2
3099
3100 properties:
3101
3102 # The properties below are for illustration only
3103
3104 instance_spawn_load_threshold: 80%
3105
3106 instance_kill_load_threshold: 60%
3107
3108 instance_geo_redundancy: true
3109
3110 - pdp_type: xacml
3111
3112 policies:
3113
3114 - onap.policies.controlloop.guard.frequencylimiter.EastRegion
3115
3116 version: 1.2.3
3117
3118 - onap.policies.controlloop.guard.blacklist.EastRegion
3119
3120 version: 1.2.3
3121
3122 - onap.policies.controlloop.guard.minmax.EastRegion
3123
3124 version: 1.2.3
3125
3126 min_instance_count: 2
3127
3128 properties:
3129
3130 # The properties below are for illustration only
3131
3132 instance_geo_redundancy: true
3133
3134 - name: onap.pdpgroup.monitoring
3135
3136 description: DCAE mS Configuration Policies
3137
3138 properties:
3139
3140 # PDP group level properties if any
3141
3142 pdp_subgroups:
3143
3144 - pdp_type: xacml
3145
3146 policies:
3147
3148 - onap.scaleout.tca
3149
3150 version: 1.2.3
3151
3152 min_instance_count: 2
3153
3154 properties:
3155
3156 # The properties below are for illustration only
3157
3158 instance_geo_redundancy: true
3159
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
3162 specified.
3163
3164 *https:{url}:{port}/policy/pap/v1/pdps POST*
3165
3166 **POST body to deploy or update PDP groups**  Expand source
3167
3168 pdp_groups:
3169
3170 - name: onap.pdpgroup.Monitoring
3171
3172 description: DCAE mS Configuration Policies
3173
3174 pdp_subgroups:
3175
3176 - pdp_type: xacml
3177
3178 policies:
3179
3180 - onap.scaleout.tca
3181
3182 Simple API for CLAMP to deploy one or more policy-id's with optional policy-version.
3183 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3184
3185 *https:{url}:{port}/policy/pap/v1/pdps/policies POST*
3186
3187 Content-Type: application/json
3188
3189 {
3190
3191 "policies" : [
3192
3193 {
3194
3195 "policy-id": "onap.scaleout.tca",
3196
3197 "policy-version": 1
3198
3199 },
3200
3201 {
3202
3203 "policy-id": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
3204
3205 },
3206
3207 {
3208
3209 "policy-id":
3210 "guard.frequency.ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
3211
3212 },
3213
3214 {
3215
3216 "policy-id":
3217 "guard.minmax.ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
3218
3219 }
3220
3221 ]
3222
3223 }
3224
3225 HTTP status code indicates success or failure.{
3226
3227 "errorDetails": "some error message"
3228
3229 }
3230
3231 Simple API for CLAMP to undeploy a policy-id with optional policy-version.
3232 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3233
3234 *https:{url}:{port}/policy/pap/v1/pdps/policies{policy-id} DELETE*
3235
3236 *https:{url}:{port}/policy/pap/v1/pdps/policies{policy-id}/versions/{policy-version}
3237 DELETE*
3238
3239 HTTP status code indicates success or failure.
3240
3241 {
3242
3243 "errorDetails": "some error message"
3244
3245 }
3246
3247 3.3.3 PDP Group Delete
3248 ~~~~~~~~~~~~~~~~~~~~~~
3249
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:
3253
3254 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.monitoring
3255 DELETE*
3256
3257 3.3.4 PDP Group State Management
3258 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3259
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
3265 operation.
3266
3267 The following PUT operation changes a PDP group to ACTIVE:
3268
3269 *https:{url}:{port}/policy/pap/v1/pdps/groups/onap.pdpgroup.monitoring/state=active*
3270
3271 There are a number of rules for state management:
3272
3273 1. Only one version of a PDP group may be ACTIVE at any time
3274
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
3277    group
3278
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
3282
3283 4. There is no restriction on the number of PASSIVE versions of a PDP
3284    group that can exist in the system
3285
3286 5. <Rules on SAFE/TEST> ? `Pamela
3287    Dragosh <file://localhost/display/~pdragosh>`__
3288
3289 3.3.5 PDP Group Statistics
3290 ~~~~~~~~~~~~~~~~~~~~~~~~~~
3291
3292 This operation allows statistics for PDP groups, PDP subgroups, and
3293 individual PDPs to be retrieved.
3294
3295 *https:{url}:{port}/policy/pap/v1/pdps/statistics GET*
3296
3297 **Draft Example statistics returned for a PDP Group**  Expand source
3298
3299 report_timestamp: 2019-02-11T15:23:50+00:00
3300
3301 pdp_group_count: 2
3302
3303 pdp_groups:
3304
3305 - name: onap.pdpgroup.controlloop.Operational
3306
3307 state: active
3308
3309 create_timestamp: 2019-02-11T15:23:50+00:00
3310
3311 update_timestamp: 2019-02-12T15:23:50+00:00
3312
3313 state_change_timestamp: 2019-02-13T15:23:50+00:00
3314
3315 pdp_subgroups:
3316
3317 - pdp_type: drools
3318
3319 instance_count: 3
3320
3321 deployed_policy_count: 2
3322
3323 policy_execution_count: 123
3324
3325 policy_execution_ok_count: 121
3326
3327 policy_execution_fail_count: 2
3328
3329 instances:
3330
3331 - instance: drools_1
3332
3333 start_timestamp: 2019-02-13T15:23:50+00:00
3334
3335 policy_execution_count: 50
3336
3337 policy_execution_ok_count: 49
3338
3339 policy_execution_fail_count: 1
3340
3341 - instance: drools_2
3342
3343 start_timestamp: 2019-02-13T15:30:50+00:00
3344
3345 policy_execution_count: 50
3346
3347 policy_execution_ok_count: 49
3348
3349 policy_execution_fail_count: 1
3350
3351 - instance: drools_3
3352
3353 start_timestamp: 2019-02-13T15:33:50+00:00
3354
3355 policy_execution_count: 23
3356
3357 policy_execution_ok_count: 23
3358
3359 policy_execution_fail_count: 0
3360
3361 The table below shows some more examples of GET operations for
3362 statistics
3363
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
3370 \                                                                                                 
3371 ================================================================================================== ===================================================================================
3372
3373 3.3.6 PDP Group Health Check
3374 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3375
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.
3381
3382 *https:{url}:{port}/policy/pap/v1/pdps/healthcheck PUT*
3383
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.
3388
3389 The table below shows some more examples of PUT operations for ordering
3390 health checks
3391
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
3398 \                                                                                                      
3399 ======================================================================================================= ========================================================================================
3400
3401 3.4 Policy Decision API - Getting Policy Decisions
3402 --------------------------------------------------
3403
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.
3408
3409 3.4.1 Decision API Schema
3410 ~~~~~~~~~~~~~~~~~~~~~~~~~
3411
3412 The schema for the decision API is defined below.
3413
3414 3.4.2 Decision API Queries
3415 ~~~~~~~~~~~~~~~~~~~~~~~~~~
3416
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.
3420
3421 *https:{url}:{port}/decision/v1/ POST*
3422
3423 *
3424 *\ Description of the JSON Payload for the decision API Call
3425
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.
3433                                                                                                                                  
3434                                                                                                                                   eg. "configure" → DCAE uS onap.Monitoring policy Decisions to configure uS
3435                                                                                                                                  
3436                                                                                                                                   "naming"
3437                                                                                                                                  
3438                                                                                                                                   "placement"
3439                                                                                                                                  
3440                                                                                                                                   "guard"
3441 These sub metadata structures are used to refine which resource the ONAP component is performing an action upon.                 
3442                                                                                                                                  
3443 At least one is required in order for Policy to return a Decision.                                                               
3444                                                                                                                                  
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.
3448 \                                                                                                                                
3449 \                                                                                                                                
3450 \                                                                                                                                
3451 ================================================================================================================ ======= ======== ==========================================================================
3452
3453 This example below shows the JSON body of a query for a specify
3454 policy-id
3455
3456 **Decision API Call - Policy ID**
3457
3458 {
3459
3460 "ONAPName": "DCAE",
3461
3462 "ONAPComponent": "PolicyHandler",
3463
3464 "ONAPInstance": "622431a4-9dea-4eae-b443-3b2164639c64",
3465
3466 "action": "configure",
3467
3468 "resource": {
3469
3470 "policy-id": "onap.scaleout.tca"
3471
3472 }
3473
3474 }
3475
3476 **Decision Response - Single Policy ID query**
3477
3478 {
3479
3480 "policies": {
3481
3482 "onap.scaleout.tca": {
3483
3484 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3485
3486 "version": "1.0.0",
3487
3488 "metadata": {
3489
3490 "policy-id": "onap.scaleout.tca",
3491
3492 "policy-version": 1
3493
3494 },
3495
3496 "properties": {
3497
3498 "tca_policy": {
3499
3500 "domain": "measurementsForVfScaling",
3501
3502 "metricsPerEventName": [
3503
3504 {
3505
3506 "eventName": "vLoadBalancer",
3507
3508 "controlLoopSchemaType": "VNF",
3509
3510 "policyScope": "type=configuration",
3511
3512 "policyName": "onap.scaleout.tca",
3513
3514 "policyVersion": "v0.0.1",
3515
3516 "thresholds": [
3517
3518 {
3519
3520 "closedLoopControlName":
3521 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3522
3523 "closedLoopEventStatus": "ONSET",
3524
3525 "version": "1.0.2",
3526
3527 "fieldPath":
3528 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3529
3530 "thresholdValue": 500,
3531
3532 "direction": "LESS_OR_EQUAL",
3533
3534 "severity": "MAJOR"
3535
3536 },
3537
3538 {
3539
3540 "closedLoopControlName":
3541 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3542
3543 "closedLoopEventStatus": "ONSET",
3544
3545 "version": "1.0.2",
3546
3547 "fieldPath":
3548 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3549
3550 "thresholdValue": 5000,
3551
3552 "direction": "GREATER_OR_EQUAL",
3553
3554 "severity": "CRITICAL"
3555
3556 }
3557
3558 ]
3559
3560 }
3561
3562 ]
3563
3564 }
3565
3566 }
3567
3568 }
3569
3570 }
3571
3572 }
3573
3574 *
3575 *
3576
3577 This example below shows the JSON body of a query for a multiple
3578 policy-id's
3579
3580 **Decision API Call - Policy ID**
3581
3582 {
3583
3584 "ONAPName": "DCAE",
3585
3586 "ONAPComponent": "PolicyHandler",
3587
3588 "ONAPInstance": "622431a4-9dea-4eae-b443-3b2164639c64",
3589
3590 "action": "configure",
3591
3592 "resource": {
3593
3594 "policy-id": [
3595
3596 "onap.scaleout.tca",
3597
3598 "onap.restart.tca"
3599
3600 ]
3601
3602 }
3603
3604 }
3605
3606 The following is the response object:
3607
3608 **Decision Response - Single Policy ID query**
3609
3610 {
3611
3612 "policies": {
3613
3614 "onap.scaleout.tca": {
3615
3616 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3617
3618 "version": "1.0.0",
3619
3620 "metadata": {
3621
3622 "policy-id": "onap.scaleout.tca"
3623
3624 },
3625
3626 "properties": {
3627
3628 "tca_policy": {
3629
3630 "domain": "measurementsForVfScaling",
3631
3632 "metricsPerEventName": [
3633
3634 {
3635
3636 "eventName": "vLoadBalancer",
3637
3638 "controlLoopSchemaType": "VNF",
3639
3640 "policyScope": "type=configuration",
3641
3642 "policyName": "onap.scaleout.tca",
3643
3644 "policyVersion": "v0.0.1",
3645
3646 "thresholds": [
3647
3648 {
3649
3650 "closedLoopControlName":
3651 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3652
3653 "closedLoopEventStatus": "ONSET",
3654
3655 "version": "1.0.2",
3656
3657 "fieldPath":
3658 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3659
3660 "thresholdValue": 500,
3661
3662 "direction": "LESS_OR_EQUAL",
3663
3664 "severity": "MAJOR"
3665
3666 },
3667
3668 {
3669
3670 "closedLoopControlName":
3671 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3672
3673 "closedLoopEventStatus": "ONSET",
3674
3675 "version": "1.0.2",
3676
3677 "fieldPath":
3678 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3679
3680 "thresholdValue": 5000,
3681
3682 "direction": "GREATER_OR_EQUAL",
3683
3684 "severity": "CRITICAL"
3685
3686 }
3687
3688 ]
3689
3690 }
3691
3692 ]
3693
3694 }
3695
3696 }
3697
3698 },
3699
3700 "onap.restart.tca": {
3701
3702 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3703
3704 "version": "1.0.0",
3705
3706 "metadata": {
3707
3708 "policy-id": "onap.restart.tca",
3709
3710 "policy-version": 1
3711
3712 },
3713
3714 "properties": {
3715
3716 "tca_policy": {
3717
3718 "domain": "measurementsForVfScaling",
3719
3720 "metricsPerEventName": [
3721
3722 {
3723
3724 "eventName": "Measurement_vGMUX",
3725
3726 "controlLoopSchemaType": "VNF",
3727
3728 "policyScope": "DCAE",
3729
3730 "policyName": "DCAE.Config_tca-hi-lo",
3731
3732 "policyVersion": "v0.0.1",
3733
3734 "thresholds": [
3735
3736 {
3737
3738 "closedLoopControlName":
3739 "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
3740
3741 "version": "1.0.2",
3742
3743 "fieldPath":
3744 "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
3745
3746 "thresholdValue": 0,
3747
3748 "direction": "EQUAL",
3749
3750 "severity": "MAJOR",
3751
3752 "closedLoopEventStatus": "ABATED"
3753
3754 },
3755
3756 {
3757
3758 "closedLoopControlName":
3759 "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
3760
3761 "version": "1.0.2",
3762
3763 "fieldPath":
3764 "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
3765
3766 "thresholdValue": 0,
3767
3768 "direction": "GREATER",
3769
3770 "severity": "CRITICAL",
3771
3772 "closedLoopEventStatus": "ONSET"
3773
3774 }
3775
3776 ]
3777
3778 }
3779
3780 ]
3781
3782 }
3783
3784 }
3785
3786 }
3787
3788 }
3789
3790 }
3791
3792 *
3793 *
3794
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.
3797
3798 {
3799
3800 "ONAPName": "DCAE",
3801
3802 "ONAPComponent": "PolicyHandler",
3803
3804 "ONAPInstance": "622431a4-9dea-4eae-b443-3b2164639c64",
3805
3806 "action": "configure",
3807
3808 "resource": {
3809
3810 "policy-type": "onap.policies.monitoring.cdap.tca.hi.lo.app"
3811
3812 }
3813
3814 }
3815
3816 The query above gives a response similar to the example shown below.
3817
3818 {
3819
3820 "policies": {
3821
3822 "onap.scaleout.tca": {
3823
3824 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3825
3826 "version": "1.0.0",
3827
3828 "metadata": {
3829
3830 "policy-id": "onap.scaleout.tca",
3831
3832 "policy-version": 1,
3833
3834 },
3835
3836 "properties": {
3837
3838 "tca_policy": {
3839
3840 "domain": "measurementsForVfScaling",
3841
3842 "metricsPerEventName": [
3843
3844 {
3845
3846 "eventName": "vLoadBalancer",
3847
3848 "controlLoopSchemaType": "VNF",
3849
3850 "policyScope": "type=configuration",
3851
3852 "policyName": "onap.scaleout.tca",
3853
3854 "policyVersion": "v0.0.1",
3855
3856 "thresholds": [
3857
3858 {
3859
3860 "closedLoopControlName":
3861 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3862
3863 "closedLoopEventStatus": "ONSET",
3864
3865 "version": "1.0.2",
3866
3867 "fieldPath":
3868 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3869
3870 "thresholdValue": 500,
3871
3872 "direction": "LESS_OR_EQUAL",
3873
3874 "severity": "MAJOR"
3875
3876 },
3877
3878 {
3879
3880 "closedLoopControlName":
3881 "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
3882
3883 "closedLoopEventStatus": "ONSET",
3884
3885 "version": "1.0.2",
3886
3887 "fieldPath":
3888 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
3889
3890 "thresholdValue": 5000,
3891
3892 "direction": "GREATER_OR_EQUAL",
3893
3894 "severity": "CRITICAL"
3895
3896 }
3897
3898 ]
3899
3900 }
3901
3902 ]
3903
3904 }
3905
3906 }
3907
3908 },
3909
3910 "onap.restart.tca": {
3911
3912 "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
3913
3914 "version": "1.0.0",
3915
3916 "metadata": {
3917
3918 "policy-id": "onap.restart.tca",
3919
3920 "policy-version": 1
3921
3922 },
3923
3924 "properties": {
3925
3926 "tca_policy": {
3927
3928 "domain": "measurementsForVfScaling",
3929
3930 "metricsPerEventName": [
3931
3932 {
3933
3934 "eventName": "Measurement_vGMUX",
3935
3936 "controlLoopSchemaType": "VNF",
3937
3938 "policyScope": "DCAE",
3939
3940 "policyName": "DCAE.Config_tca-hi-lo",
3941
3942 "policyVersion": "v0.0.1",
3943
3944 "thresholds": [
3945
3946 {
3947
3948 "closedLoopControlName":
3949 "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
3950
3951 "version": "1.0.2",
3952
3953 "fieldPath":
3954 "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
3955
3956 "thresholdValue": 0,
3957
3958 "direction": "EQUAL",
3959
3960 "severity": "MAJOR",
3961
3962 "closedLoopEventStatus": "ABATED"
3963
3964 },
3965
3966 {
3967
3968 "closedLoopControlName":
3969 "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
3970
3971 "version": "1.0.2",
3972
3973 "fieldPath":
3974 "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
3975
3976 "thresholdValue": 0,
3977
3978 "direction": "GREATER",
3979
3980 "severity": "CRITICAL",
3981
3982 "closedLoopEventStatus": "ONSET"
3983
3984 }
3985
3986 ]
3987
3988 }
3989
3990 ]
3991
3992 }
3993
3994 }
3995
3996 },
3997
3998 "onap.vfirewall.tca": {
3999
4000 "type": "onap.policy.monitoring.cdap.tca.hi.lo.app",
4001
4002 "version": "1.0.0",
4003
4004 "metadata": {
4005
4006 "policy-id": "onap.vfirewall.tca",
4007
4008 "policy-version": 1
4009
4010 },
4011
4012 "properties": {
4013
4014 "tca_policy": {
4015
4016 "domain": "measurementsForVfScaling",
4017
4018 "metricsPerEventName": [
4019
4020 {
4021
4022 "eventName": "vLoadBalancer",
4023
4024 "controlLoopSchemaType": "VNF",
4025
4026 "policyScope": "resource=vLoadBalancer;type=configuration",
4027
4028 "policyName": "onap.vfirewall.tca",
4029
4030 "policyVersion": "v0.0.1",
4031
4032 "thresholds": [
4033
4034 {
4035
4036 "closedLoopControlName":
4037 "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
4038
4039 "closedLoopEventStatus": "ONSET",
4040
4041 "version": "1.0.2",
4042
4043 "fieldPath":
4044 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
4045
4046 "thresholdValue": 500,
4047
4048 "direction": "LESS_OR_EQUAL",
4049
4050 "severity": "MAJOR"
4051
4052 },
4053
4054 {
4055
4056 "closedLoopControlName":
4057 "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
4058
4059 "closedLoopEventStatus": "ONSET",
4060
4061 "version": "1.0.2",
4062
4063 "fieldPath":
4064 "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
4065
4066 "thresholdValue": 5000,
4067
4068 "direction": "GREATER_OR_EQUAL",
4069
4070 "severity": "CRITICAL"
4071
4072 }
4073
4074 ]
4075
4076 }
4077
4078 ]
4079
4080 }
4081
4082 }
4083
4084 }
4085
4086 }
4087
4088 }
4089
4090 4. Policy Framework Internal APIs
4091 =================================
4092
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.
4098
4099 4.1 PAP to PDP API
4100 ------------------
4101
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:
4106
4107 1. PDP_STATUS: PDP→PAP, used by PDPs to report to the PAP
4108
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
4112
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
4116
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
4120
4121 The fields below are valid on API calls:
4122
4123 ======================== ============================= ======== ======== ======= ====================================================================================================================================== ==================================================================================================================================================================================================
4124 **Field**                **PDP                         **PDP    **PDP    **PDP   **Comment**                                                                                                                           
4125                          STATUS**                      UPDATE** STATE    HEALTH                                                                                                                                        
4126                                                                 CHANGE** CHECK**                                                                                                                                       
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 ======================== ============================= ======== ======== ======= ====================================================================================================================================== ==================================================================================================================================================================================================
4158
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.
4162
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
4169
4170 4.1.1 PAP API for PDPs
4171 ~~~~~~~~~~~~~~~~~~~~~~
4172
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
4177 topic for messages.
4178
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
4183 response.
4184
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
4189 failed.
4190
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
4194 state PASSIVE.
4195
4196 **PDP_STATUS message from an XACML PDP running control loop policies**
4197  Expand source
4198
4199 pdp_status:
4200
4201 name: xacml_1
4202
4203 version: 1.2.3
4204
4205 pdp_type: xacml
4206
4207 state: active
4208
4209 healthy: true
4210
4211  description: XACML PDP running control loop policies
4212
4213 pdp_group: onap.pdpgroup.controlloop.operational
4214
4215 pdp_subgroup: xacml
4216
4217 supported_policy_types:
4218
4219 - onap.policies.controlloop.guard.FrequencyLimiter
4220
4221 - onap.policies.controlloop.guard.BlackList
4222
4223 - onap.policies.controlloop.guard.MinMax
4224
4225  policies:
4226
4227 - onap.policies.controlloop.guard.frequencylimiter.EastRegion:
4228
4229 policy_type: onap.policies.controlloop.guard.FrequencyLimiter
4230
4231 policy_type_version: 1.0.0
4232
4233 properties:
4234
4235 # Omitted for brevity, see Section 3.2
4236
4237  - onap.policies.controlloop.guard.blacklist.eastRegion:
4238
4239 policy_type: onap.policies.controlloop.guard.BlackList
4240
4241 policy_type_version: 1.0.0
4242
4243 properties:
4244
4245 # Omitted for brevity, see Section 3.2
4246
4247 - onap.policies.controlloop.guard.minmax.eastRegion:
4248
4249 policy_type: onap.policies.controlloop.guard.MinMax
4250
4251 policy_type_version: 1.0.0
4252
4253 properties:
4254
4255 # Omitted for brevity, see Section 3.2
4256
4257 instance: xacml_1
4258
4259 deployment_instance_info:
4260
4261 node_address: xacml_1_pod
4262
4263 # Other deployment instance info
4264
4265 statistics:
4266
4267 policy_download_count: 0
4268
4269 policy_download_success_count: 0
4270
4271 policy_download_fail_count: 0
4272
4273 policy_executed_count: 123
4274
4275 policy_executed_success_count: 122
4276
4277 policy_executed_fail_count: 1
4278
4279 **PDP_STATUS message from a Drools PDP running control loop policies**
4280  Expand source
4281
4282 pdp_status:
4283
4284 name: drools_2
4285
4286 version: 2.3.4
4287
4288 pdp_type: drools
4289
4290 state: safe
4291
4292 healthy: true
4293
4294  description: Drools PDP running control loop policies
4295
4296 pdp_group: onap.pdpgroup.controlloop.operational
4297
4298 pdp_subgroup: drools
4299
4300 supported_policy_types:
4301
4302 - onap.controllloop.operational.drools.vCPE
4303
4304   - onap.controllloop.operational.drools.vFW
4305
4306 policies:
4307
4308 - onap.controllloop.operational.drools.vcpe.EastRegion:
4309
4310 policy_type: onap.controllloop.operational.drools.vCPE
4311
4312 policy_type_version: 1.0.0
4313
4314 properties:
4315
4316 # Omitted for brevity, see Section 3.2
4317
4318 - onap.controllloop.operational.drools.vfw.EastRegion:
4319
4320 policy_type: onap.controllloop.operational.drools.vFW
4321
4322 policy_type_version: 1.0.0
4323
4324 properties:
4325
4326 # Omitted for brevity, see Section 3.2
4327
4328 instance: drools_2
4329
4330 deployment_instance_info:
4331
4332 node_address: drools_2_pod
4333
4334 # Other deployment instance info
4335
4336 statistics:
4337
4338 policy_download_count: 3
4339
4340 policy_download_success_count: 3
4341
4342 policy_download_fail_count: 0
4343
4344 policy_executed_count: 123
4345
4346 policy_executed_success_count: 122
4347
4348 policy_executed_fail_count: 1
4349
4350 response:
4351
4352 response_to: PDP_HEALTH_CHECK
4353
4354 response_status: SUCCESS
4355
4356 **PDP_STATUS message from an APEX PDP running control loop policies**
4357  Expand source
4358
4359 pdp_status:
4360
4361 name: apex_3
4362
4363 version: 2.2.1
4364
4365 pdp_type: apex
4366
4367 state: test
4368
4369 healthy: true
4370
4371  description: APEX PDP running control loop policies
4372
4373 pdp_group: onap.pdpgroup.controlloop.operational
4374
4375 pdp_subgroup: apex
4376
4377 supported_policy_types:
4378
4379 - onap.controllloop.operational.apex.BBS
4380
4381 - onap.controllloop.operational.apex.SampleDomain
4382
4383 policies:
4384
4385 - onap.controllloop.operational.apex.bbs.EastRegion:
4386
4387 policy_type: onap.controllloop.operational.apex.BBS
4388
4389 policy_type_version: 1.0.0
4390
4391 properties:
4392
4393 # Omitted for brevity, see Section 3.2
4394
4395 - onap.controllloop.operational.apex.sampledomain.EastRegion:
4396
4397 policy_type: onap.controllloop.operational.apex.SampleDomain
4398
4399 policy_type_version: 1.0.0
4400
4401 properties:
4402
4403 # Omitted for brevity, see Section 3.2
4404
4405 instance: apex_3
4406
4407 deployment_instance_info:node_address
4408
4409 node_address: apex_3_pod
4410
4411 # Other deployment instance info
4412
4413 statistics:
4414
4415 policy_download_count: 2
4416
4417 policy_download_success_count: 2
4418
4419 policy_download_fail_count: 0
4420
4421 policy_executed_count: 123
4422
4423 policy_executed_success_count: 122
4424
4425 policy_executed_fail_count: 1
4426
4427 response:
4428
4429 response_to: PDP_UPDATE
4430
4431 response_status: FAIL
4432
4433 response_message: policies specified in update message incompatible with
4434 running policy state
4435
4436 **PDP_STATUS message from an XACML PDP running monitoring policies**
4437  Expand source
4438
4439 pdp_status:
4440
4441   name: xacml_1
4442
4443 version: 1.2.3
4444
4445 pdp_type: xacml
4446
4447 state: active
4448
4449 healthy: true
4450
4451  description: XACML PDP running monitoring policies
4452
4453 pdp_group: onap.pdpgroup.Monitoring
4454
4455 pdp_subgroup: xacml
4456
4457 supported_policy_types:
4458
4459 - onap.monitoring.cdap.tca.hi.lo.app
4460
4461 policies:
4462
4463 - onap.scaleout.tca:message
4464
4465 policy_type: onap.policies.monitoring.cdap.tca.hi.lo.app
4466
4467 policy_type_version: 1.0.0
4468
4469 properties:
4470
4471 # Omitted for brevity, see Section 3.2
4472
4473 instance: xacml_1
4474
4475 deployment_instance_info:
4476
4477 node_address: xacml_1_pod
4478
4479 # Other deployment instance info
4480
4481 statistics:
4482
4483 policy_download_count: 0
4484
4485 policy_download_success_count: 0
4486
4487 policy_download_fail_count: 0
4488
4489 policy_executed_count: 123
4490
4491 policy_executed_success_count: 122
4492
4493 policy_executed_fail_count: 1
4494
4495 4.1.2 PDP API for PAPs
4496 ~~~~~~~~~~~~~~~~~~~~~~
4497
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.
4503
4504 The PAP can set the scope of STATE_CHANGE, and *PDP_HEALTH_CHECK*
4505 messages:
4506
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.
4509
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.
4513
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.
4516
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
4519 belongs.
4520
4521 4.1.2.1 PDP Update
4522 ^^^^^^^^^^^^^^^^^^
4523
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.
4529
4530 The following examples illustrate how the operation is used.
4531
4532 **PDP_UPDATE message to upgrade XACML PDP control loop policies to
4533 versino 1.0.1**  Expand source
4534
4535 pdp_update:
4536
4537 name: xacml_1
4538
4539 pdp_type: xacml
4540
4541 description: XACML PDP running control loop policies, Upgraded
4542
4543 pdp_group: onap.pdpgroup.controlloop.operational
4544
4545 pdp_subgroup: xacml
4546
4547 policies:
4548
4549 - onap.policies.controlloop.guard.frequencylimiter.EastRegion:
4550
4551 policy_type: onap.policies.controlloop.guard.FrequencyLimiter
4552
4553 policy_type_version: 1.0.1
4554
4555 properties:
4556
4557 # Omitted for brevity, see Section 3.2
4558
4559 - onap.policies.controlloop.guard.blackList.EastRegion:
4560
4561 policy_type: onap.policies.controlloop.guard.BlackList
4562
4563 policy_type_version: 1.0.1
4564
4565 properties:
4566
4567 # Omitted for brevity, see Section 3.2
4568
4569 - onap.policies.controlloop.guard.minmax.EastRegion:
4570
4571 policy_type: onap.policies.controlloop.guard.MinMax
4572
4573 policy_type_version: 1.0.1
4574
4575 properties:
4576
4577 # Omitted for brevity, see Section 3.2
4578
4579 **PDP_UPDATE message to a Drools PDP to add an extra control loop
4580 policy**  Expand source
4581
4582 pdp_update:
4583
4584 name: drools_2
4585
4586 pdp_type: drools
4587
4588 description: Drools PDP running control loop policies, extra policy
4589 added
4590
4591 pdp_group: onap.pdpgroup.controlloop.operational
4592
4593 pdp_subgroup: drools
4594
4595 policies:
4596
4597 - onap.controllloop.operational.drools.vcpe.EastRegion:
4598
4599 policy_type: onap.controllloop.operational.drools.vCPE
4600
4601 policy_type_version: 1.0.0
4602
4603 properties:
4604
4605 # Omitted for brevity, see Section 3.2
4606
4607 - onap.controllloop.operational.drools.vfw.EastRegion:
4608
4609 policy_type: onap.controllloop.operational.drools.vFW
4610
4611 policy_type_version: 1.0.0
4612
4613 properties:
4614
4615 # Omitted for brevity, see Section 3.2
4616
4617 - onap.controllloop.operational.drools.vfw.WestRegion:
4618
4619 policy_type: onap.controllloop.operational.drools.vFW
4620
4621 policy_type_version: 1.0.0
4622
4623 properties:
4624
4625 # Omitted for brevity, see Section 3.2
4626
4627 **PDP_UPDATE message to an APEX PDP to remove a control loop policy**
4628  Expand source
4629
4630 pdp_update:
4631
4632 name: apex_3
4633
4634 pdp_type: apex
4635
4636  description: APEX PDP updated to remove a control loop policy
4637
4638 pdp_group: onap.pdpgroup.controlloop.operational
4639
4640 pdp_subgroup: apex
4641
4642 policies:
4643
4644 - onap.controllloop.operational.apex.bbs.EastRegion:
4645
4646 policy_type: onap.controllloop.operational.apex.BBS
4647
4648 policy_type_version: 1.0.0
4649
4650 properties:
4651
4652 # Omitted for brevity, see Section 3.2
4653
4654 4.1.2.2 PDP State Change
4655 ^^^^^^^^^^^^^^^^^^^^^^^^
4656
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.
4660
4661 **Change the state of all control loop Drools PDPs to ACTIVE**  Expand
4662 source
4663
4664 pdp_state_change:
4665
4666 state: active
4667
4668 pdp_group: onap.pdpgroup.controlloop.Operational
4669
4670 pdp_subgroup: drools
4671
4672 **Change the state of all monitoring PDPs to SAFE**  Expand source
4673
4674 pdp_state_change:
4675
4676 state: safe
4677
4678 pdp_group: onap.pdpgroup.Monitoring
4679
4680 **Change the state of a single APEX PDP to TEST**  Expand source
4681
4682 pdp_state_change:
4683
4684 state: test
4685
4686 name: apex_3
4687
4688 4.1.2.3 PDP Health Check
4689 ^^^^^^^^^^^^^^^^^^^^^^^^
4690
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.
4694
4695 **Perform a health check on all control loop Drools PDPs**  Expand
4696 source
4697
4698 pdp_health_check:
4699
4700 pdp_group: onap.pdpgroup.controlloop.Operational
4701
4702 pdp_subgroup: drools
4703
4704 **perform a health check on all monitoring PDPs**  Expand source
4705
4706 pdp_health_check:
4707
4708 pdp_group: onap.pdpgroup.Monitoring
4709
4710 **Perform a health check on a single APEX PDP**  Expand source
4711
4712 pdp_health_check:
4713
4714 name: apex_3
4715
4716 4.2 Policy Type Implementations (Native Policies)
4717 -------------------------------------------------
4718
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.
4725
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>`__
4731 architecture.
4732
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.
4741
4742 The fields below are valid on API calls:
4743
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 =========== ======= ======== ========== ==========================================================================================================================
4756
4757 4.2.1 Policy Type Implementation Query
4758 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4759
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.
4762
4763 *https:{url}:{port}/policy/api/v1/native/onap.policies.controlloop.operational/impls
4764 GET*
4765
4766 **Policy Type Implementation Query Result**  Expand source
4767
4768 policy_type_impls:
4769
4770 - name: onap.policies.controlloop.operational.drools.Impl
4771
4772 version: 1.0.0
4773
4774 policy_type: onap.policies.controlloop.Operational
4775
4776 pdp_type: drools
4777
4778 description: Implementation of the drools control loop policies
4779
4780 writable: false
4781
4782 - name: onap.policies.controlloop.operational.apex.bbs.Impl
4783
4784 version: 1.0.0
4785
4786 policy_type: onap.policies.controlloop.operational.Apex
4787
4788 pdp_type: apex
4789
4790 description: Implementation of the APEX BBS control loop policy
4791
4792 writable: true
4793
4794 policy_body: "<policy body>"
4795
4796 - name: onap.policies.controlloop.operational.apex.sampledomain.Impl
4797
4798 version: 1.0.0
4799
4800 policy_type: onap.policies.controlloop.operational.Apex
4801
4802 pdp_type: apex
4803
4804 description: Implementation of the SampleDomain test APEX policy
4805
4806 writable: true
4807
4808 policy_body: "<policy body>"
4809
4810 The table below shows some more examples of GET operations
4811
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
4816                                                                                                                                                                          
4817 | *eg.*                                                                                                                                                                  
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
4821                                                                                                                                                                          
4822 | *eg.*                                                                                                                                                                  
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
4826                                                                                                                                                                          
4827 | *eg.*                                                                                                                                                                  
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 ========================================================================================================================================================================= ==========================================================================================================================================================
4831
4832 4.2.2 Policy Type Implementation Create/Update
4833 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4834
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.
4845
4846 For example, the POST operation below with the YAML body below is used
4847 to create a new APEX Policy type implementation.
4848
4849 *https:{url}:{port}/policy/api/v1/native/onap.policies.controlloop.operational.apex/impls
4850 POST*
4851
4852 **Create a new Policy Type Implementation**  Expand source
4853
4854 policy_type_impls:
4855
4856 - onap.policies.controlloop.operational.apex.bbs.Impl:
4857
4858 version: 1.0.0
4859
4860 policy_type: onap.policies.controlloop.operational.Apex
4861
4862 pdp_type: apex
4863
4864 description: Implementation of the APEX BBS control loop policy
4865
4866 policy_body: "<policy body>"
4867
4868 - onap.policies.controlloop.operational.apex.sampledomain.Impl:
4869
4870 version: 1.0.0
4871
4872 policy_type: onap.policies.controlloop.operational.Apex
4873
4874 pdp_type: apex
4875
4876 description: Implementation of the APEX SampleDomain control loop policy
4877
4878 policy_body: "<policy body>
4879
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.
4882
4883 4.2.3 Policy Type Implementation Delete
4884 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4885
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:
4888
4889 *https:{url}:{port}/api/v1/native/onap.policies.controlloop.operational.apex/impls/onap.policies.apex.bbs.impl/versions/1.0.0
4890 DELETE*
4891
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
4898   system