Update Pdp policy status during registration or State change
[policy/pap.git] / postman / pap-api-collection.json
1 {
2     "info": {
3         "_postman_id": "d78b72f0-00b1-44c2-88c4-98a7a51b3932",
4         "name": "Policy Framework Administration API",
5         "description": "This collection lists all the Administration API's supported by ONAP Policy Framework. These API's are used to perform administrative operations for managing policies, groups, statistics & health information for all registered PDP engines.",
6         "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
7     },
8     "item": [
9         {
10             "name": "PAP healthcheck",
11             "protocolProfileBehavior": {
12                 "disableBodyPruning": true
13             },
14             "request": {
15                 "method": "GET",
16                 "header": [
17                     {
18                         "key": "Content-Type",
19                         "type": "text",
20                         "value": "application/json"
21                     },
22                     {
23                         "key": "Accept",
24                         "type": "text",
25                         "value": "application/json"
26                     }
27                 ],
28                 "body": {
29                     "mode": "raw",
30                     "raw": ""
31                 },
32                 "url": {
33                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/healthcheck",
34                     "host": [
35                         "{{POLICY-PAP-URL}}"
36                     ],
37                     "path": [
38                         "policy",
39                         "pap",
40                         "v1",
41                         "healthcheck"
42                     ]
43                 },
44                 "description": "This is an API to fetch current healthcheck information for the policy-pap component."
45             },
46             "response": []
47         },
48         {
49             "name": "Policy Consolidated healthcheck",
50             "protocolProfileBehavior": {
51                 "disableBodyPruning": true
52             },
53             "request": {
54                 "method": "GET",
55                 "header": [
56                     {
57                         "key": "Content-Type",
58                         "value": "application/json",
59                         "type": "text"
60                     },
61                     {
62                         "key": "Accept",
63                         "value": "application/json",
64                         "type": "text"
65                     }
66                 ],
67                 "body": {
68                     "mode": "raw",
69                     "raw": ""
70                 },
71                 "url": {
72                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/components/healthcheck",
73                     "host": [
74                         "{{POLICY-PAP-URL}}"
75                     ],
76                     "path": [
77                         "policy",
78                         "pap",
79                         "v1",
80                         "components",
81                         "healthcheck"
82                     ]
83                 },
84                 "description": "This is an API to fetch current healthcheck information for all the policy framework components."
85             },
86             "response": []
87         },
88         {
89             "name": "PdpGroup Query",
90             "protocolProfileBehavior": {
91                 "disableBodyPruning": true
92             },
93             "request": {
94                 "method": "GET",
95                 "header": [
96                     {
97                         "key": "Content-Type",
98                         "type": "text",
99                         "value": "application/json"
100                     },
101                     {
102                         "key": "Accept",
103                         "type": "text",
104                         "value": "application/json"
105                     }
106                 ],
107                 "body": {
108                     "mode": "raw",
109                     "raw": ""
110                 },
111                 "url": {
112                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps",
113                     "host": [
114                         "{{POLICY-PAP-URL}}"
115                     ],
116                     "path": [
117                         "policy",
118                         "pap",
119                         "v1",
120                         "pdps"
121                     ]
122                 },
123                 "description": "This is an API to fetch details of all PdpGroups currently available in Policy DB."
124             },
125             "response": []
126         },
127         {
128             "name": "PdpGroup State Change",
129             "request": {
130                 "method": "PUT",
131                 "header": [
132                     {
133                         "key": "Content-Type",
134                         "value": "application/json",
135                         "type": "text"
136                     },
137                     {
138                         "key": "Accept",
139                         "value": "application/json",
140                         "type": "text"
141                     }
142                 ],
143                 "url": {
144                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/groups/defaultGroup?state=ACTIVE",
145                     "host": [
146                         "{{POLICY-PAP-URL}}"
147                     ],
148                     "path": [
149                         "policy",
150                         "pap",
151                         "v1",
152                         "pdps",
153                         "groups",
154                         "defaultGroup"
155                     ],
156                     "query": [
157                         {
158                             "key": "state",
159                             "value": "ACTIVE"
160                         }
161                     ]
162                 },
163                 "description": "This is an API to change the current state of a PdpGroup (example - \"defaultGroup\") resulting in changing state of all the PDP instances registered with the PdpGroup. As of now, the allowed states are ACTIVE and PASSIVE."
164             },
165             "response": []
166         },
167         {
168             "name": "Simple Deploy Policy",
169             "request": {
170                 "method": "POST",
171                 "header": [
172                     {
173                         "key": "Content-Type",
174                         "type": "text",
175                         "value": "application/json"
176                     },
177                     {
178                         "key": "Accept",
179                         "type": "text",
180                         "value": "application/json"
181                     }
182                 ],
183                 "body": {
184                     "mode": "raw",
185                     "raw": "{\r\n  \"policies\" : [\r\n    {\r\n      \"policy-id\": \"operational.modifyconfig\",\r\n      \"policy-version\": \"1.0.0\"\r\n    }\r\n    ]\r\n}"
186                 },
187                 "url": {
188                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/policies",
189                     "host": [
190                         "{{POLICY-PAP-URL}}"
191                     ],
192                     "path": [
193                         "policy",
194                         "pap",
195                         "v1",
196                         "pdps",
197                         "policies"
198                     ]
199                 },
200                 "description": "This is an API to deploy one or more policies in all available & matching PdpGroups in Policy DB. The match is done based on supported policy types in the PdpSunGroup and the policy type referred by the given policy."
201             },
202             "response": []
203         },
204         {
205             "name": "Simple Undeploy Policy",
206             "request": {
207                 "method": "DELETE",
208                 "header": [
209                     {
210                         "key": "Accept",
211                         "value": "application/json",
212                         "type": "text"
213                     },
214                     {
215                         "key": "Content-Type",
216                         "value": "application/json",
217                         "type": "text"
218                     }
219                 ],
220                 "url": {
221                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/policies/operational.modifyconfig",
222                     "host": [
223                         "{{POLICY-PAP-URL}}"
224                     ],
225                     "path": [
226                         "policy",
227                         "pap",
228                         "v1",
229                         "pdps",
230                         "policies",
231                         "operational.modifyconfig"
232                     ]
233                 },
234                 "description": "This is an API to undeploy one or more policies from all PdpGroups in Policy DB."
235             },
236             "response": []
237         },
238         {
239             "name": "Create/Update PdpGroup",
240             "request": {
241                 "method": "POST",
242                 "header": [
243                     {
244                         "key": "Content-Type",
245                         "type": "text",
246                         "value": "application/json"
247                     },
248                     {
249                         "key": "Accept",
250                         "type": "text",
251                         "value": "application/json"
252                     }
253                 ],
254                 "body": {
255                     "mode": "raw",
256                     "raw": "{\n    \"groups\": [\n        {\n            \"name\": \"SampleGroup\",\n            \"pdpGroupState\": \"ACTIVE\",\n            \"properties\": {},\n            \"pdpSubgroups\": [\n                {\n                    \"pdpType\": \"apex\",\n                    \"desiredInstanceCount\": 2,\n                    \"properties\": {},\n                    \"supportedPolicyTypes\": [\n                        {\n                            \"name\": \"onap.policies.controlloop.operational.common.Apex\",\n                            \"version\": \"1.0.0\"\n                        }\n                    ],\n                    \"policies\": []\n                },\n                {\n                    \"pdpType\": \"xacml\",\n                    \"desiredInstanceCount\": 1,\n                    \"properties\": {},\n                    \"supportedPolicyTypes\": [\n                        {\n                            \"name\": \"onap.policies.monitoring.*\",\n                            \"version\": \"1.0.0\"\n                        }\n                    ],\n                    \"policies\": []\n                }\n            ]\n        }\n    ]\n}"
257                 },
258                 "url": {
259                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/groups/batch",
260                     "host": [
261                         "{{POLICY-PAP-URL}}"
262                     ],
263                     "path": [
264                         "policy",
265                         "pap",
266                         "v1",
267                         "pdps",
268                         "groups",
269                         "batch"
270                     ]
271                 },
272                 "description": "This is a generic API to create/update PdpGroups in Policy DB. However, the supportedPolicyTypes field of PdpSubGroup cannot be changed once created."
273             },
274             "response": []
275         },
276         {
277             "name": "PDPGroup Deploy Policy",
278             "request": {
279                 "method": "POST",
280                 "header": [
281                     {
282                         "key": "Content-Type",
283                         "type": "text",
284                         "value": "application/json"
285                     },
286                     {
287                         "key": "Accept",
288                         "type": "text",
289                         "value": "application/json"
290                     }
291                 ],
292                 "body": {
293                     "mode": "raw",
294                     "raw": "{\n    \"groups\": [\n        {\n            \"name\": \"defaultGroup\",\n            \"deploymentSubgroups\": [\n                {\n                    \"pdpType\": \"drools\",\n                    \"action\": \"POST\",\n                    \"policies\": [\n                        {\n                            \"name\": \"operational.modifyconfig\",\n                            \"version\": \"1.0.0\"\n                        }\n                    ]\n                }\n            ]\n        }\n    ]\n}"
295                 },
296                 "url": {
297                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/deployments/batch",
298                     "host": [
299                         "{{POLICY-PAP-URL}}"
300                     ],
301                     "path": [
302                         "policy",
303                         "pap",
304                         "v1",
305                         "pdps",
306                         "deployments",
307                         "batch"
308                     ]
309                 },
310                 "description": "This is an API to deploy one or more policies to the specified PdpGroup, resulting in deployment of policies to all registered PDP instances of that specified PdpGroup."
311             },
312             "response": []
313         },
314         {
315             "name": "PDPGroup Undeploy Policy",
316             "request": {
317                 "method": "POST",
318                 "header": [
319                     {
320                         "key": "Content-Type",
321                         "type": "text",
322                         "value": "application/json"
323                     },
324                     {
325                         "key": "Accept",
326                         "type": "text",
327                         "value": "application/json"
328                     }
329                 ],
330                 "body": {
331                     "mode": "raw",
332                     "raw": "{\n    \"groups\": [\n        {\n            \"name\": \"defaultGroup\",\n            \"deploymentSubgroups\": [\n                {\n                    \"pdpType\": \"drools\",\n                    \"action\": \"DELETE\",\n                    \"policies\": [\n                        {\n                            \"name\": \"operational.modifyconfig\",\n                            \"version\": \"1.0.0\"\n                        }\n                    ]\n                }\n            ]\n        }\n    ]\n}"
333                 },
334                 "url": {
335                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/deployments/batch",
336                     "host": [
337                         "{{POLICY-PAP-URL}}"
338                     ],
339                     "path": [
340                         "policy",
341                         "pap",
342                         "v1",
343                         "pdps",
344                         "deployments",
345                         "batch"
346                     ]
347                 },
348                 "description": "This is an API to undeploy one or more policies from the specified PdpGroup, resulting in removal of policies from all registered PDP instances of that specified PdpGroup."
349             },
350             "response": []
351         },
352         {
353             "name": "Fetch All Policy Status",
354             "protocolProfileBehavior": {
355                 "disableBodyPruning": true
356             },
357             "request": {
358                 "method": "GET",
359                 "header": [
360                     {
361                         "key": "Content-Type",
362                         "type": "text",
363                         "value": "application/json"
364                     },
365                     {
366                         "key": "Accept",
367                         "type": "text",
368                         "value": "application/json"
369                     }
370                 ],
371                 "body": {
372                     "mode": "raw",
373                     "raw": ""
374                 },
375                 "url": {
376                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/policies/status",
377                     "host": [
378                         "{{POLICY-PAP-URL}}"
379                     ],
380                     "path": [
381                         "policy",
382                         "pap",
383                         "v1",
384                         "policies",
385                         "status"
386                     ]
387                 },
388                 "description": "This is a generic API to fetch status of all policies in the registered PDP instances."
389             },
390             "response": []
391         },
392         {
393             "name": "Fetch All Policy Status in a Group",
394             "protocolProfileBehavior": {
395                 "disableBodyPruning": true
396             },
397             "request": {
398                 "method": "GET",
399                 "header": [
400                     {
401                         "key": "Content-Type",
402                         "type": "text",
403                         "value": "application/json"
404                     },
405                     {
406                         "key": "Accept",
407                         "type": "text",
408                         "value": "application/json"
409                     }
410                 ],
411                 "body": {
412                     "mode": "raw",
413                     "raw": ""
414                 },
415                 "url": {
416                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/policies/status/defaultGroup",
417                     "host": [
418                         "{{POLICY-PAP-URL}}"
419                     ],
420                     "path": [
421                         "policy",
422                         "pap",
423                         "v1",
424                         "policies",
425                         "status",
426                         "defaultGroup"
427                     ]
428                 },
429                 "description": "This is a generic API to fetch status of all policies in the registered PDP instances in a PDP Group."
430             },
431             "response": []
432         },
433         {
434             "name": "Fetch Policy Status in a Group",
435             "protocolProfileBehavior": {
436                 "disableBodyPruning": true
437             },
438             "request": {
439                 "method": "GET",
440                 "header": [
441                     {
442                         "key": "Content-Type",
443                         "type": "text",
444                         "value": "application/json"
445                     },
446                     {
447                         "key": "Accept",
448                         "type": "text",
449                         "value": "application/json"
450                     }
451                 ],
452                 "body": {
453                     "mode": "raw",
454                     "raw": ""
455                 },
456                 "url": {
457                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/policies/status/defaultGroup/operational.modifyconfig",
458                     "host": [
459                         "{{POLICY-PAP-URL}}"
460                     ],
461                     "path": [
462                         "policy",
463                         "pap",
464                         "v1",
465                         "policies",
466                         "status",
467                         "defaultGroup",
468                         "operational.modifyconfig"
469                     ]
470                 },
471                 "description": "This is a generic API to fetch status of all versions of a policy in the registered PDP instances in a PDP Group."
472             },
473             "response": []
474         },
475         {
476             "name": "Fetch All Policy deployment Status",
477             "protocolProfileBehavior": {
478                 "disableBodyPruning": true
479             },
480             "request": {
481                 "method": "GET",
482                 "header": [
483                     {
484                         "key": "Content-Type",
485                         "type": "text",
486                         "value": "application/json"
487                     },
488                     {
489                         "key": "Accept",
490                         "type": "text",
491                         "value": "application/json"
492                     }
493                 ],
494                 "body": {
495                     "mode": "raw",
496                     "raw": ""
497                 },
498                 "url": {
499                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/policies/deployed",
500                     "host": [
501                         "{{POLICY-PAP-URL}}"
502                     ],
503                     "path": [
504                         "policy",
505                         "pap",
506                         "v1",
507                         "policies",
508                         "deployed"
509                     ]
510                 },
511                 "description": "This is a generic API to fetch status of all deployed policies in the registered PDP instances."
512             },
513             "response": []
514         },
515         {
516             "name": "Fetch Policy deployment Status",
517             "protocolProfileBehavior": {
518                 "disableBodyPruning": true
519             },
520             "request": {
521                 "method": "GET",
522                 "header": [
523                     {
524                         "key": "Content-Type",
525                         "type": "text",
526                         "value": "application/json"
527                     },
528                     {
529                         "key": "Accept",
530                         "type": "text",
531                         "value": "application/json"
532                     }
533                 ],
534                 "body": {
535                     "mode": "raw",
536                     "raw": ""
537                 },
538                 "url": {
539                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/policies/deployed/operational.modifyconfig",
540                     "host": [
541                         "{{POLICY-PAP-URL}}"
542                     ],
543                     "path": [
544                         "policy",
545                         "pap",
546                         "v1",
547                         "policies",
548                         "deployed",
549                         "operational.modifyconfig"
550                     ]
551                 },
552                 "description": "This is an API to fetch status of a specific deployed policy in the registered PDP instances."
553             },
554             "response": []
555         },
556         {
557             "name": "Fetch All PDPs Statistics",
558             "protocolProfileBehavior": {
559                 "disableBodyPruning": true
560             },
561             "request": {
562                 "method": "GET",
563                 "header": [
564                     {
565                         "key": "Content-Type",
566                         "value": "application/json",
567                         "type": "text"
568                     },
569                     {
570                         "key": "Accept",
571                         "value": "application/json",
572                         "type": "text"
573                     }
574                 ],
575                 "body": {
576                     "mode": "raw",
577                     "raw": ""
578                 },
579                 "url": {
580                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/statistics",
581                     "host": [
582                         "{{POLICY-PAP-URL}}"
583                     ],
584                     "path": [
585                         "policy",
586                         "pap",
587                         "v1",
588                         "pdps",
589                         "statistics"
590                     ]
591                 },
592                 "description": "This is an API to fetch current statistics information for the all registered PDP instances."
593             },
594             "response": []
595         },
596         {
597             "name": "Fetch PdpGroup Statistics",
598             "protocolProfileBehavior": {
599                 "disableBodyPruning": true
600             },
601             "request": {
602                 "method": "GET",
603                 "header": [
604                     {
605                         "key": "Content-Type",
606                         "type": "text",
607                         "value": "application/json"
608                     },
609                     {
610                         "key": "Accept",
611                         "type": "text",
612                         "value": "application/json"
613                     }
614                 ],
615                 "body": {
616                     "mode": "raw",
617                     "raw": ""
618                 },
619                 "url": {
620                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/statistics/defaultGroup",
621                     "host": [
622                         "{{POLICY-PAP-URL}}"
623                     ],
624                     "path": [
625                         "policy",
626                         "pap",
627                         "v1",
628                         "pdps",
629                         "statistics",
630                         "defaultGroup"
631                     ]
632                 },
633                 "description": "This is an API to fetch current statistics information for the all registered PDP instances of the specified PdpGroup (example - \"defaultGroup\")."
634             },
635             "response": []
636         },
637         {
638             "name": "Fetch PdpSubGroup Statistics",
639             "protocolProfileBehavior": {
640                 "disableBodyPruning": true
641             },
642             "request": {
643                 "method": "GET",
644                 "header": [
645                     {
646                         "key": "Content-Type",
647                         "type": "text",
648                         "value": "application/json"
649                     },
650                     {
651                         "key": "Accept",
652                         "type": "text",
653                         "value": "application/json"
654                     }
655                 ],
656                 "body": {
657                     "mode": "raw",
658                     "raw": ""
659                 },
660                 "url": {
661                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/statistics/defaultGroup/apex",
662                     "host": [
663                         "{{POLICY-PAP-URL}}"
664                     ],
665                     "path": [
666                         "policy",
667                         "pap",
668                         "v1",
669                         "pdps",
670                         "statistics",
671                         "defaultGroup",
672                         "apex"
673                     ]
674                 },
675                 "description": "This is an API to fetch current statistics information for the all registered PDP instances of the specified PdpGroup (example - \"defaultGroup\") & PdpSubgroup (example - \"apex\")."
676             },
677             "response": []
678         },
679         {
680             "name": "Fetch PDP Statistics",
681             "protocolProfileBehavior": {
682                 "disableBodyPruning": true
683             },
684             "request": {
685                 "method": "GET",
686                 "header": [
687                     {
688                         "key": "Content-Type",
689                         "type": "text",
690                         "value": "application/json"
691                     },
692                     {
693                         "key": "Accept",
694                         "type": "text",
695                         "value": "application/json"
696                     }
697                 ],
698                 "body": {
699                     "mode": "raw",
700                     "raw": ""
701                 },
702                 "url": {
703                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/statistics/defaultGroup/apex/dev-policy-apex-pdp-0",
704                     "host": [
705                         "{{POLICY-PAP-URL}}"
706                     ],
707                     "path": [
708                         "policy",
709                         "pap",
710                         "v1",
711                         "pdps",
712                         "statistics",
713                         "defaultGroup",
714                         "apex",
715                         "dev-policy-apex-pdp-0"
716                     ]
717                 },
718                 "description": "This is an API to fetch current statistics information for the specified PDP instance (example - \"dev-policy-apex-pdp-0\") of the specified PdpGroup (example - \"defaultGroup\") & PdpSubgroup (example - \"apex\")."
719             },
720             "response": []
721         },
722         {
723             "name": "Delete PdpGroup",
724             "request": {
725                 "method": "DELETE",
726                 "header": [
727                     {
728                         "key": "Accept",
729                         "type": "text",
730                         "value": "application/json"
731                     },
732                     {
733                         "key": "Content-Type",
734                         "type": "text",
735                         "value": "application/json"
736                     }
737                 ],
738                 "url": {
739                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/groups/SampleGroup",
740                     "host": [
741                         "{{POLICY-PAP-URL}}"
742                     ],
743                     "path": [
744                         "policy",
745                         "pap",
746                         "v1",
747                         "pdps",
748                         "groups",
749                         "SampleGroup"
750                     ]
751                 },
752                 "description": "This is an API to delete a specific PdpGroup (example - \"SampleGroup\") currently available in Policy DB, resulting in removing all the PDP instances registered with the group."
753             },
754             "response": []
755         }
756     ],
757     "auth": {
758         "type": "basic",
759         "basic": [
760             {
761                 "key": "password",
762                 "value": "{{PASSWORD}}",
763                 "type": "string"
764             },
765             {
766                 "key": "username",
767                 "value": "{{USER}}",
768                 "type": "string"
769             }
770         ]
771     },
772     "event": [
773         {
774             "listen": "prerequest",
775             "script": {
776                 "type": "text/javascript",
777                 "exec": [
778                     ""
779                 ]
780             }
781         },
782         {
783             "listen": "test",
784             "script": {
785                 "type": "text/javascript",
786                 "exec": [
787                     ""
788                 ]
789             }
790         }
791     ],
792     "variable": [
793         {
794             "key": "USER",
795             "value": "healthcheck",
796             "type": "string"
797         },
798         {
799             "key": "PASSWORD",
800             "value": "zb!XztG34",
801             "type": "string"
802         }
803     ]
804 }