Create postman collection for pap api's
[policy/pap.git] / postman / pap-api-collection.json
1 {
2     "info": {
3         "_postman_id": "05831254-6fad-419f-b10e-ff21cbbd365a",
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 Policy deployment 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/deployed/operational.modifyconfig",
377                     "host": [
378                         "{{POLICY-PAP-URL}}"
379                     ],
380                     "path": [
381                         "policy",
382                         "pap",
383                         "v1",
384                         "policies",
385                         "deployed",
386                         "operational.modifyconfig"
387                     ]
388                 },
389                 "description": "This is an API to fetch status of a specific deployed policy in the registered PDP instances."
390             },
391             "response": []
392         },
393         {
394             "name": "Fetch All Policy deployment Status",
395             "protocolProfileBehavior": {
396                 "disableBodyPruning": true
397             },
398             "request": {
399                 "method": "GET",
400                 "header": [
401                     {
402                         "key": "Content-Type",
403                         "type": "text",
404                         "value": "application/json"
405                     },
406                     {
407                         "key": "Accept",
408                         "type": "text",
409                         "value": "application/json"
410                     }
411                 ],
412                 "body": {
413                     "mode": "raw",
414                     "raw": ""
415                 },
416                 "url": {
417                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/policies/deployed",
418                     "host": [
419                         "{{POLICY-PAP-URL}}"
420                     ],
421                     "path": [
422                         "policy",
423                         "pap",
424                         "v1",
425                         "policies",
426                         "deployed"
427                     ]
428                 },
429                 "description": "This is a generic API to fetch status of all deployed policies in the registered PDP instances."
430             },
431             "response": []
432         },
433         {
434             "name": "Fetch All PDPs Statistics",
435             "protocolProfileBehavior": {
436                 "disableBodyPruning": true
437             },
438             "request": {
439                 "method": "GET",
440                 "header": [
441                     {
442                         "key": "Content-Type",
443                         "value": "application/json",
444                         "type": "text"
445                     },
446                     {
447                         "key": "Accept",
448                         "value": "application/json",
449                         "type": "text"
450                     }
451                 ],
452                 "body": {
453                     "mode": "raw",
454                     "raw": ""
455                 },
456                 "url": {
457                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/statistics",
458                     "host": [
459                         "{{POLICY-PAP-URL}}"
460                     ],
461                     "path": [
462                         "policy",
463                         "pap",
464                         "v1",
465                         "pdps",
466                         "statistics"
467                     ]
468                 },
469                 "description": "This is an API to fetch current statistics information for the all registered PDP instances."
470             },
471             "response": []
472         },
473         {
474             "name": "Fetch PdpGroup Statistics",
475             "protocolProfileBehavior": {
476                 "disableBodyPruning": true
477             },
478             "request": {
479                 "method": "GET",
480                 "header": [
481                     {
482                         "key": "Content-Type",
483                         "type": "text",
484                         "value": "application/json"
485                     },
486                     {
487                         "key": "Accept",
488                         "type": "text",
489                         "value": "application/json"
490                     }
491                 ],
492                 "body": {
493                     "mode": "raw",
494                     "raw": ""
495                 },
496                 "url": {
497                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/statistics/defaultGroup",
498                     "host": [
499                         "{{POLICY-PAP-URL}}"
500                     ],
501                     "path": [
502                         "policy",
503                         "pap",
504                         "v1",
505                         "pdps",
506                         "statistics",
507                         "defaultGroup"
508                     ]
509                 },
510                 "description": "This is an API to fetch current statistics information for the all registered PDP instances of the specified PdpGroup (example - \"defaultGroup\")."
511             },
512             "response": []
513         },
514         {
515             "name": "Fetch PdpSubGroup Statistics",
516             "protocolProfileBehavior": {
517                 "disableBodyPruning": true
518             },
519             "request": {
520                 "method": "GET",
521                 "header": [
522                     {
523                         "key": "Content-Type",
524                         "type": "text",
525                         "value": "application/json"
526                     },
527                     {
528                         "key": "Accept",
529                         "type": "text",
530                         "value": "application/json"
531                     }
532                 ],
533                 "body": {
534                     "mode": "raw",
535                     "raw": ""
536                 },
537                 "url": {
538                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/statistics/defaultGroup/apex",
539                     "host": [
540                         "{{POLICY-PAP-URL}}"
541                     ],
542                     "path": [
543                         "policy",
544                         "pap",
545                         "v1",
546                         "pdps",
547                         "statistics",
548                         "defaultGroup",
549                         "apex"
550                     ]
551                 },
552                 "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\")."
553             },
554             "response": []
555         },
556         {
557             "name": "Fetch PDP Statistics",
558             "protocolProfileBehavior": {
559                 "disableBodyPruning": true
560             },
561             "request": {
562                 "method": "GET",
563                 "header": [
564                     {
565                         "key": "Content-Type",
566                         "type": "text",
567                         "value": "application/json"
568                     },
569                     {
570                         "key": "Accept",
571                         "type": "text",
572                         "value": "application/json"
573                     }
574                 ],
575                 "body": {
576                     "mode": "raw",
577                     "raw": ""
578                 },
579                 "url": {
580                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/statistics/defaultGroup/apex/dev-policy-apex-pdp-0",
581                     "host": [
582                         "{{POLICY-PAP-URL}}"
583                     ],
584                     "path": [
585                         "policy",
586                         "pap",
587                         "v1",
588                         "pdps",
589                         "statistics",
590                         "defaultGroup",
591                         "apex",
592                         "dev-policy-apex-pdp-0"
593                     ]
594                 },
595                 "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\")."
596             },
597             "response": []
598         },
599         {
600             "name": "Delete PdpGroup",
601             "request": {
602                 "method": "DELETE",
603                 "header": [
604                     {
605                         "key": "Accept",
606                         "type": "text",
607                         "value": "application/json"
608                     },
609                     {
610                         "key": "Content-Type",
611                         "type": "text",
612                         "value": "application/json"
613                     }
614                 ],
615                 "url": {
616                     "raw": "{{POLICY-PAP-URL}}/policy/pap/v1/pdps/groups/SampleGroup",
617                     "host": [
618                         "{{POLICY-PAP-URL}}"
619                     ],
620                     "path": [
621                         "policy",
622                         "pap",
623                         "v1",
624                         "pdps",
625                         "groups",
626                         "SampleGroup"
627                     ]
628                 },
629                 "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."
630             },
631             "response": []
632         }
633     ],
634     "auth": {
635         "type": "basic",
636         "basic": [
637             {
638                 "key": "password",
639                 "value": "{{PASSWORD}}",
640                 "type": "string"
641             },
642             {
643                 "key": "username",
644                 "value": "{{USER}}",
645                 "type": "string"
646             }
647         ]
648     },
649     "event": [
650         {
651             "listen": "prerequest",
652             "script": {
653                 "id": "d6987a6d-a224-4288-a7bd-4c1c209a2637",
654                 "type": "text/javascript",
655                 "exec": [
656                     ""
657                 ]
658             }
659         },
660         {
661             "listen": "test",
662             "script": {
663                 "id": "731a9aab-e8f2-4dc6-941c-ac7e142c5177",
664                 "type": "text/javascript",
665                 "exec": [
666                     ""
667                 ]
668             }
669         }
670     ],
671     "variable": [
672         {
673             "id": "bc82ca5c-f667-4118-9da1-e78a9b532b91",
674             "key": "USER",
675             "value": "healthcheck",
676             "type": "string"
677         },
678         {
679             "id": "1c2733ff-2507-49e8-ba07-b0f85ea97914",
680             "key": "PASSWORD",
681             "value": "zb!XztG34",
682             "type": "string"
683         }
684     ],
685     "protocolProfileBehavior": {}
686 }