Documentation: Legacy APIs
[policy/engine.git] / docs / platform / offeredapis.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 .. _legacyapis-label:
5
6 Legacy Offered APIs  
7 ===================
8
9 .. warning:: These Legacy APIs are scheduled to be deprecated after the Frankfurt release!
10
11 .. contents:: 
12     :depth: 2
13
14 The Policy subsystem of ONAP maintains, distributes, and operates on the set of rules that underlie ONAP’s control, orchestration, and management functions. Policy provides a centralized environment for the creation and management of easily-updatable conditional rules. It enables users to validate policies and rules, identify and resolve overlaps and conflicts, and derive additional policies where needed.  The following operations are supported by the policy API:
15
16 * Create policies on the PAP 
17 * Update policies on the PAP
18 * Delete policies on the PAP or PDP
19 * Push policies from the PAP to the PDP
20 * List policies on the PDP
21 * Get config data of policies on the PDP
22 * Create Dictionary Items
23 * Update Dictionary Items
24 * Retrieve Dictionary Items
25 * Import Micro Services Models
26 * Retrieve Metrics for policy counts from PDP and PAP
27
28
29 POLICY Engine Services
30 ^^^^^^^^^^^^^^^^^^^^^^
31
32 .. image:: PolicyEngineApiList.png
33
34 POLICY API Details
35 ^^^^^^^^^^^^^^^^^^
36
37 .. swaggerv2doc:: api-docs.json
38
39 Examples
40 ^^^^^^^^
41
42 **SAMPLE JAVA CLIENT CODE**
43
44     .. code-block:: java
45        :caption: Get Config Example
46        :linenos:
47
48         package org.onap.policyEngine;
49           
50         import java.util.Collection;
51           
52         import org.onap.policy.api.ConfigRequestParameters;
53         import org.onap.policy.api.PolicyConfig;
54         import org.onap.policy.api.PolicyEngine;
55           
56         public class GetConfigSample {
57           
58             public static void main(String[] args) throws Exception {
59                 PolicyEngine pe = new PolicyEngine("config.properties");
60                 ConfigRequestParameters configRequestParams = new ConfigRequestParameters();
61                 configRequestParams.setPolicyName(".*");
62                 Collection<PolicyConfig> configs = pe.getConfig(configRequestParams);
63                 for (PolicyConfig config: configs){
64                     System.out.println(config.getPolicyConfigMessage());
65                     System.out.println(config.getPolicyConfigStatus());
66                 }
67             }
68         }
69
70
71     .. code-block:: java
72        :caption: Create Config FIrewall Policy Example
73        :linenos:
74
75         package org.onap.policyEngine;
76           
77         import java.io.File;
78         import java.io.FileInputStream;
79         import java.io.FileNotFoundException;
80         import java.io.IOException;
81         import java.io.InputStream;
82         import java.io.StringReader;
83         import java.nio.file.Path;
84         import java.nio.file.Paths;
85         import java.text.SimpleDateFormat;
86         import java.util.Date;
87         import java.util.UUID;
88           
89         import javax.json.Json;
90         import javax.json.JsonObject;
91         import javax.json.JsonReader;
92           
93         import org.onap.policy.api.PolicyChangeResponse;
94         import org.onap.policy.api.PolicyConfigType;
95         import org.onap.policy.api.PolicyEngine;
96         import org.onap.policy.api.PolicyParameters;
97         import org.onap.policy.api.PolicyType;
98           
99         public class ConfigFirewallPolicyClient {
100             static Boolean isEdit = false;
101             public static void main(String[] args) {
102                 try{    
103                     PolicyEngine policyEngine = new PolicyEngine("config.properties");
104                     PolicyParameters policyParameters = new PolicyParameters();
105                     // Set Policy Type
106                     policyParameters.setPolicyConfigType(PolicyConfigType.Firewall); //required
107                     policyParameters.setPolicyName("MikeAPItesting.testConfigFirewallPolicy1607_1"); //required
108                     //policyParameters.setPolicyScope("MikeAPItesting");
109                     //Directory will be created where the Policies are saved... this displays a subscope on the GUI
110                     policyParameters.setRequestID(UUID.randomUUID());
111                       
112                     // Set Safe Policy value for Risk Type
113                     SimpleDateFormat dateformat3 = new SimpleDateFormat("dd/MM/yyyy");
114                     Date date = dateformat3.parse("15/10/2016");
115                     policyParameters.setTtlDate(date);
116                     // Set Safe Policy value for Guard
117                     policyParameters.setGuard(true);
118                     // Set Safe Policy value for Risk Level
119                     policyParameters.setRiskLevel("5");
120                     // Set Safe Policy value for Risk Type
121                     policyParameters.setRiskType("PROD");
122                     File jsonFile = null;
123                     String jsonRuleList = null;
124                     Path file = Paths.get("C:\\policyAPI\\firewallRulesJSON\\Config_FW_Sample.json");
125                     jsonFile = file.toFile();
126                       
127                     //buildJSON(jsonFile, jsonRuleList);
128                     policyParameters.setConfigBody(buildJSON(jsonFile, jsonRuleList).toString());       
129                     policyParameters.setConfigBodyType(PolicyType.JSON);
130                     // API method to create Policy or update policy
131                     PolicyChangeResponse response = null;
132                     if (!isEdit) {
133                         response = policyEngine.createPolicy(policyParameters);
134                     } else {
135                         response = policyEngine.updatePolicy(policyParameters);
136                     }
137                       
138                     if(response.getResponseCode()==200){
139                         System.out.println(response.getResponseMessage());
140                         System.out.println("Policy Created Successfully!");
141                     }else{
142                         System.out.println("Error! " + response.getResponseMessage());
143                     }
144                 } catch (Exception e) {
145                     System.err.println(e.getMessage());
146                 }
147                   
148         }
149               
150             private static JsonObject buildJSON(File jsonInput, String jsonString) throws FileNotFoundException {
151                 JsonObject json = null;
152                 JsonReader jsonReader = null;
153                 if (jsonString != null && jsonInput == null) {
154                     StringReader in = null;
155                     in = new StringReader(jsonString);
156                     jsonReader = Json.createReader(in);
157                     json = jsonReader.readObject();
158                     in.close();
159                 } else {
160                     InputStream in = null;
161                     in = new FileInputStream(jsonInput); 
162                     jsonReader = Json.createReader(in);
163                     json = jsonReader.readObject();
164                     try {
165                         in.close();
166                     } catch (IOException e) {
167                         System.err.println("Exception Occured while closing input stream"+e);
168                     }
169                 }
170                 jsonReader.close();
171                 return json;
172             }
173           
174         }
175
176     .. code-block:: java
177        :caption: Sample JSON file - Config_FW_Sample.json
178        :linenos:
179
180         {
181               "serviceTypeId": "/v0/firewall/pan",
182               "configName": "AFTTFwPolicy1Config",
183               "deploymentOption": {
184                     "deployNow": false
185               },
186               "securityZoneId": "cloudsite:dev1a",
187               "serviceGroups": [{
188                     "name": "SSH",
189                     "description": "Ssh service entry in service list",
190                     "type": "SERVICE",
191                     "transportProtocol": "tcp",
192                     "appProtocol": null,
193                     "ports": "22"
194               }],
195               "addressGroups": [{
196                     "name": "CiscoVCE",
197                     "description": "Destination CiscoCVE",
198                     "members": [{
199                           "type": "SUBNET",
200                           "value": "12.63.31.61/12"
201                     }]
202               }, {
203                     "name": "HOHOServers",
204                     "description": "Source HOHOServers for first testing",
205                     "members": [{
206                           "type": "SUBNET",
207                           "value": "12.60.32.11/23"
208                     }]
209               }],
210               "firewallRuleList": [{
211                     "position": "1",
212                     "ruleName": "FWRuleHOHOServerToCiscoVCE",
213                     "fromZones": ["UntrustedZoneCiscoCVEName"],
214                     "toZones": ["TrustedZoneHOHOName"],
215                     "negateSource": false,
216                     "negateDestination": false,
217                     "sourceList": [{
218                           "type": "REFERENCE",
219                           "name": "HOHOServers"
220                     }],
221                     "destinationList": [{
222                           "type": "REFERENCE",
223                           "name": "CiscoVCE"
224                     }],
225                     "sourceServices": [],
226                     "destServices": [{
227                           "type": "REFERENCE",
228                           "name": "SSH"
229                     }],
230                     "action": "accept",
231                     "description": "FW rule for HOHO source to CiscoVCE destination",
232                     "enabled": true,
233                     "log": true
234               }]
235         }
236
237     .. code-block:: java
238        :caption: Delete Policy Example
239        :linenos:
240
241         package org.onap.policyEngine;
242           
243         import org.onap.policy.api.DeletePolicyCondition;
244         import org.onap.policy.api.DeletePolicyParameters;
245         import org.onap.policy.api.PolicyChangeResponse;
246         import org.onap.policy.api.PolicyEngine;
247           
248         public class DeletePolicyClient {
249           
250             public static void main(String[] args) {
251                 try {
252           
253                     PolicyEngine policyEngine = new PolicyEngine("config.properties");
254                     DeletePolicyParameters policyParameters = new DeletePolicyParameters();         
255                                   
256                     //Parameter arguments
257                     policyParameters.setPolicyName("MikeConsole.Config_testDeleteAPI6.1.xml");
258                     policyParameters.setPolicyComponent("PDP");
259                     policyParameters.setPdpGroup("default");
260                     policyParameters.setDeleteCondition(DeletePolicyCondition.ALL);
261                     policyParameters.setRequestID(null);
262                       
263                     // API method to Push Policy to PDP
264                     PolicyChangeResponse response = null;
265                     response = policyEngine.deletePolicy(policyParameters);
266           
267                     if(response.getResponseCode()==200){
268                         System.out.println(response.getResponseMessage());
269                         System.out.println("Policy Deleted Successfully!");
270                     }else{
271                         System.out.println("Error! " + response.getResponseMessage());
272                     }
273           
274                 } catch (Exception e) {
275                     System.err.println(e.getMessage());     
276                       
277                 }
278             }
279         }
280
281
282     .. code-block:: java
283        :caption: Push Policy Example
284        :linenos:
285
286         package org.onap.policyEngine;
287           
288         import org.onap.policy.api.PolicyChangeResponse;
289         import org.onap.policy.api.PolicyEngine;
290         import org.onap.policy.api.PushPolicyParameters;
291           
292         public class PushPoliciesToPDP {
293             public static void main(String[] args) {
294                 try {
295           
296                     PolicyEngine policyEngine = new PolicyEngine("config.properties");
297                     PushPolicyParameters policyParameters = new PushPolicyParameters();         
298                                   
299                     //Parameter arguments
300                     policyParameters.setPolicyName("Mike.testCase1");
301                     policyParameters.setPolicyType("Base");
302                     //policyParameters.setPolicyScope("MikeAPItesting");
303                     policyParameters.setPdpGroup("default");            
304                     policyParameters.setRequestID(null);
305                       
306                     // API method to Push Policy to PDP
307                     PolicyChangeResponse response = null;
308                     response = policyEngine.pushPolicy(policyParameters);
309           
310                     if(response.getResponseCode()==204){
311                         System.out.println(response.getResponseMessage());
312                         System.out.println("Policy Pushed Successfully!");
313                     }else{
314                         System.out.println("Error! " + response.getResponseMessage());
315                     }
316           
317                 } catch (Exception e) {
318                     System.err.println(e.getMessage());     
319                       
320                 }
321             }
322         }
323
324
325     .. code-block:: java
326        :caption: Decision Policy Example
327        :linenos:
328
329         package org.onap.policyEngine;
330           
331         import java.util.Arrays;
332         import java.util.HashMap;
333         import java.util.LinkedList;
334         import java.util.List;
335         import java.util.Map;
336         import java.util.UUID;
337           
338         import org.onap.policy.api.AttributeType;
339         import org.onap.policy.api.PolicyChangeResponse;
340         import org.onap.policy.api.PolicyClass;
341         import org.onap.policy.api.PolicyEngine;
342         import org.onap.policy.api.PolicyParameters;
343           
344         public class DecisionPolicyClient {
345             static Boolean isEdit = true;
346             public static void main(String[] args) {
347                 try {
348                     PolicyEngine policyEngine = new PolicyEngine("config.properties");
349                     PolicyParameters policyParameters = new PolicyParameters();
350                     // Set Policy Type
351                     policyParameters.setPolicyClass(PolicyClass.Decision); //required
352                     policyParameters.setPolicyName("MikeAPItests.testDecisionAPI"); //required
353                     policyParameters.setOnapName("java"); //required
354                     policyParameters.setPolicyDescription("This is a sample Decision policy UPDATE example with Settings");  //optional
355                     //policyParameters.setPolicyScope("MikeAPItests");
356          //Directory will be created where the Policies are saved... this 
357         displays a a subscope on the GUI
358                       
359                     //Set the Component Attributes... These are Optional
360                     Map<String, String> configAttributes = new HashMap<>(); 
361                     configAttributes.put("Template", "UpdateTemplate");
362                     configAttributes.put("controller", "default"); 
363                     configAttributes.put("SamPoll", "30");
364                     configAttributes.put("value", "abcd"); 
365                       
366                     Map<AttributeType, Map<String,String>> attributes = new HashMap<>();
367                     attributes.put(AttributeType.MATCHING, configAttributes);
368                       
369                     //Set the settings... These are Optional
370                     Map<String, String> settingsMap = new HashMap<>();
371                     settingsMap.put("server", "5");
372                       
373                     attributes.put(AttributeType.SETTINGS, settingsMap);
374                     policyParameters.setAttributes(attributes);
375           
376                       
377                     List<String> dynamicRuleAlgorithmLabels = new LinkedList<>();
378                     List<String> dynamicRuleAlgorithmFunctions = new LinkedList<>();
379                     List<String> dynamicRuleAlgorithmField1 = new LinkedList<>();
380                     List<String> dynamicRuleAlgorithmField2 = new LinkedList<>();
381                       
382                     //Example of a complex Rule algorithm using the settings in the Field1
383                     /* label    field1      function                field2
384                      * *****************************************************
385                      * A1       S_server    integer-equal               90
386                      * A2       cap         string-contains             ca
387                      * A3       cobal       integer-equal               90  
388                      * A4       A2          and                         A3
389                      * A5       Config      integer-greater-than        45
390                      * A6       A4  `       or                          A5
391                      * A7       A1          and                         A6
392                      */
393                     dynamicRuleAlgorithmLabels = Arrays.asList("A1","A2","A3","A4","A5","A6","A7");
394                     dynamicRuleAlgorithmField1 = Arrays.asList("S_server","cap","cobal","A2","Config","A4","A1");
395                     dynamicRuleAlgorithmFunctions = Arrays.asList("integer-equal","string-contains","integer-equal","and","integer-greater-than","or","and");
396                     dynamicRuleAlgorithmField2 = Arrays.asList("90","ca","90","A3","45","A5","A6");
397                               
398                     policyParameters.setDynamicRuleAlgorithmLabels(dynamicRuleAlgorithmLabels);
399                     policyParameters.setDynamicRuleAlgorithmField1(dynamicRuleAlgorithmField1);
400                     policyParameters.setDynamicRuleAlgorithmFunctions(dynamicRuleAlgorithmFunctions);
401                     policyParameters.setDynamicRuleAlgorithmField2(dynamicRuleAlgorithmField2);
402                       
403                     policyParameters.setRequestID(UUID.randomUUID());
404                       
405                     // API method to create Policy or update policy
406                     PolicyChangeResponse response = null;
407                     if (!isEdit) {
408                         response = policyEngine.createPolicy(policyParameters);
409                     } else {
410                         response = policyEngine.updatePolicy(policyParameters);
411                     }
412                       
413                     if(response.getResponseCode()==200){
414                         System.out.println(response.getResponseMessage());
415                         System.out.println("Policy Created Successfully!");
416                     }else{
417                         System.out.println("Error! " + response.getResponseMessage());
418                     }
419                 } catch (Exception e) {
420                     System.err.println(e.getMessage());
421                 }
422             }
423         }
424         
425         
426     .. code-block:: java
427        :caption: ListPolicy Example
428        :linenos:
429        
430        package org.onap.policyengine;
431
432        import java.util.Collection;
433        import org.onap.policy.api.ConfigNameRequest;
434        import org.onap.policy.api.PolicyEngine;
435
436        /**
437         * List Policy Client Code
438         * policyName : ".*" returns list of policy names from PAP.
439         * policyName : "scope + "_" + "policyType" + "_" + policyName" + ".*" returns the matching policy from pap (active version)
440         *
441         */
442         public class ListPolicyClient {
443           public static void main(String[] args) throws Exception {
444              PolicyEngine pe = new PolicyEngine("config.properties");
445              ConfigNameRequest listPolicyParams = new ConfigNameRequest();
446              listPolicyParams.setPolicyName(".*");
447              Collection<String> policies = pe.listPolicy(listPolicyParams);
448              for (String policy : policies) {
449                  System.out.println(policy);
450              }
451           }
452         }
453
454
455     .. code-block:: java
456        :caption: List Config Policy Example
457        :linenos:
458
459         package org.onap.policyEngine;
460           
461         import java.util.Collection;
462         import java.util.HashMap;
463         import java.util.Map;
464         import java.util.UUID;
465           
466         import org.onap.policy.api.ConfigRequestParameters;
467         import org.onap.policy.api.PolicyConfigException;
468         import org.onap.policy.api.PolicyEngine;
469         import org.onap.policy.api.PolicyEngineException;
470         import org.onap.policy.common.logging.flexlogger.FlexLogger;
471         import org.onap.policy.common.logging.flexlogger.Logger;
472           
473         public class ListConfigPoliciesClient {
474               
475             private static final Logger LOGGER  = FlexLogger.getLogger(ListConfigPoliciesClient.class);
476               
477             public static void main(String[] args) {
478                 PolicyEngine policyEngine;
479           
480                 // List Config Policies Example 
481                 try {
482                     policyEngine = new PolicyEngine("config.properties");
483                     ConfigRequestParameters parameters = new ConfigRequestParameters();
484                       
485                     parameters.setPolicyName(".*");
486                     parameters.setOnapName(".*");
487                     parameters.setConfigName(".*");
488                       
489                     Map<String, String> configAttributes = new HashMap<>();
490                     configAttributes.put("java", "java");
491                     configAttributes.put("peach", "Tar");
492                     configAttributes.put("true", "false");
493                     configAttributes.put("small", "testPass");
494                     parameters.setConfigAttributes(configAttributes);
495                       
496                     parameters.setRequestID(UUID.randomUUID());
497                       
498                     Collection<String> response = policyEngine.listConfig(parameters);
499                     if(response!=null && !response.contains("PE300")){
500                         for(String configList : response){
501                             System.out.println(configList.toString()+"\n");
502                         }
503                     }else{
504                         System.out.println("Error! " +response);
505                     }
506           
507                 } catch (PolicyConfigException e) {
508                     LOGGER.error("Exception Occured"+e);
509                 } catch (PolicyEngineException e) {
510                     LOGGER.error("Exception Occured"+e);
511                 }
512             }
513         }
514
515
516 **JSON EXAMPLES**
517
518     .. code-block:: java
519        :caption: Create Microservice Policy
520        :linenos:
521
522         API: createPolicy  
523         OPERATION: PUT
524         REQUEST BODY:
525         {
526             "configBody": "{
527                     \"service\":\"ControllerServiceSampleSdnlServiceInstance\",
528                     \"location\":\"Edge\",
529                     \"uuid\":\"TestUUID\",
530                     \"policyName\":\"testRestCreateMicroServicesNewParams\",
531                     \"description\":\"testing Create\",
532                     \"configName\":\"TestName\",
533                     \"templateVersion\":\"1604\",
534                     \"priority\":\"4\",
535                     \"version\":\"0.1.0-SNAPSHOT\",
536                     \"policyScope\":\"resource=F5,service=vSCP,type=configuration,closedLoopControlName=vSCP_F5_Firewall_d925ed73-8231-4d02-9545-db4e101f88f8\",
537                     \"content\":{
538                             \"taskOrchestratedConfiguration\":\"test\",
539                             \"taskCustomConfiguration\":\"set\",
540                             \"configuration\":\"test\",
541                             \"cdapUrl\":\"testurl\",
542                             \"taskName\":\"test\",
543                             \"taskNameTEST\":\"TEST\",
544                             \"users\":\"[tuser]\",
545                             \"adminUsers\":\"[lji]\",
546                             \"taskConfigFilePath\":\"test\",
547                             \"managerPortNumber\":\"999\",
548                             \"taskType\":\"test\",
549                             \"taskCommandFilePath\":\"tset\",
550                             \"contailIp\":\"test\",
551                             \"consoleUsers\":\"[odu-e2e]\",
552                             \"taskStatusFilePath\":\"test\"
553                     }
554             }",
555             "policyConfigType": "MicroService",
556             "policyName": "MikeAPITesting.testRestCreateMicroServicesNewParams",
557             "ecompName": "SDNC"
558         }
559
560
561     .. code-block:: java
562        :caption: Update Microservice Policy
563        :linenos:
564
565         API: updatePolicy  
566         OPERATION: PUT
567         REQUEST BODY:
568         {
569             "configBody": "{
570                     \"service\":\"ControllerServiceSampleSdnlServiceInstance\",
571                     \"location\":\"Edge\",
572                     \"uuid\":\"TestUUID\",
573                     \"policyName\":\"testRestCreateMicroServicesNewParams\",
574                     \"description\":\"testing Update\",
575                     \"configName\":\"TestName\",
576                     \"templateVersion\":\"1604\",
577                     \"priority\":\"4\",
578                     \"version\":\"0.1.0-SNAPSHOT\",
579                     \"policyScope\":\"resource=F5,service=vSCP,type=configuration,closedLoopControlName=vSCP_F5_Firewall_d925ed73-8231-4d02-9545-db4e101f88f8\",
580                     \"content\":{
581                             \"taskOrchestratedConfiguration\":\"test\",
582                             \"taskCustomConfiguration\":\"set\",
583                             \"configuration\":\"test\",
584                             \"cdapUrl\":\"testurl\",
585                             \"taskName\":\"test\",
586                             \"taskNameTEST\":\"TEST\",
587                             \"users\":\"[tuser]\",
588                             \"adminUsers\":\"[lji]\",
589                             \"taskConfigFilePath\":\"test\",
590                             \"managerPortNumber\":\"999\",
591                             \"taskType\":\"test\",
592                             \"taskCommandFilePath\":\"tset\",
593                             \"contailIp\":\"test\",
594                             \"consoleUsers\":\"[odu-e2e]\",
595                             \"taskStatusFilePath\":\"test\"
596                     }
597             }",
598             "policyConfigType": "MicroService",
599             "policyName": "MikeAPITesting.testRestUpdateMicroServicesNewParams",
600             "ecompName": "SDNC"
601         }
602
603
604 **CURL EXAMPLES**
605
606     .. code-block:: bash
607        :caption: Push Policy
608
609         echo "pushPolicy : PUT : com.vLoadBalancer"
610         echo "pushPolicy : PUT : com.vLoadBalancer"
611         curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: XYZ' --header 'Authorization: Basic XYZ' --header 'Environment: TEST' -d '{
612           "pdpGroup": "default",
613           "policyName": "com.vLoadBalancer",
614           "policyType": "MicroService"
615         }' 'http://pdp:8081/pdp/api/pushPolicy'
616
617
618     .. code-block:: bash
619        :caption: Delete Policy
620
621         echo "deletePolicy : DELETE : com.vFirewall"
622         curl -v --silent -X DELETE --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: XYZ' --header 'Authorization: Basic XYZ' --header 'Environment: TEST' -d '{
623           "pdpGroup": "default",
624           "policyComponent": "PDP",
625           "policyName": "com.vFirewall",
626           "policyType": "MicroService"
627         }' 'http://pdp:8081/pdp/api/deletePolicy'
628
629
630     .. code-block:: bash
631        :caption: Get Config 
632
633         echo "Get all Config Policy example"
634         curl -i -v -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: XYZ' -H 'Authorization: Basic XYZ -H 'Environment: TEST' -X POST -d '{
635         "policyName": ".*"
636         }' http://${PDP_IP}:8081/pdp/api/getConfig
637
638
639 **ADDITIONAL EXAMPLES**
640
641     .. code-block:: bash
642        :caption: Deleting a Policy from PAP
643
644         // Deleting from PAP will remove the policy from the PolicyEntity & PolicyVersion tables (UI-Editor tab).
645         // This means that the policy is no longer be available in Policy System.
646          
647         // PayLoad:
648         {    "policyName": "com.testpolicy",    //scope.policyName   
649              "policyType": "Base",              //policy type   
650              "policyComponent": "PAP",          //component name   
651              "deleteCondition": "ALL"           //versions (ALL or CURRENT)
652         }
653
654
655     .. code-block:: bash
656        :caption: Deleting a Policy from PDP
657
658         // Deleting from PDP will delete the policy from the PDP Group.  The policy is still available in Policy System. 
659         // When the policy is needed again, the policy should be pushed to the PDP.
660          
661         // PayLoad:
662         {    "policyName": "com.testpolicy",   //scope.policyName   
663              "policyType": "Base",             //policy type   
664              "policyComponent": "PDP",         //component name   
665              "pdpGroup": "Default"             //group name
666         }
667
668
669 End of Document
670