Add postman collection for decision api
[policy/xacml-pdp.git] / postman / decision-api-collection.json
1 {
2     "info": {
3         "_postman_id": "32ef71dd-9d51-45ba-95ca-4ef8f7e2a7a2",
4         "name": "Policy Framework Decision API",
5         "description": "This collection lists all the Decision API's supported by XACML PDP engine in ONAP Policy Framework. These API's are used to perform various decisions based on configured xacml policies. For example - guard, optimization, naming etc.",
6         "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
7     },
8     "item": [
9         {
10             "name": "Xacml Decision - Naming",
11             "request": {
12                 "method": "POST",
13                 "header": [
14                     {
15                         "key": "Content-Type",
16                         "type": "text",
17                         "value": "application/json"
18                     },
19                     {
20                         "key": "Accept",
21                         "type": "text",
22                         "value": "application/json"
23                     }
24                 ],
25                 "body": {
26                     "mode": "raw",
27                     "raw": "{\n  \"ONAPName\": \"SDNC\",\n  \"ONAPComponent\": \"SNDC-component\",\n  \"ONAPInstance\": \"SDNC-component-instance\",\n  \"requestId\": \"unique-request-sdnc-1\",\n  \"action\": \"naming\",\n  \"resource\": {\n      \"policy-type\": [\"onap.policies.Naming\"]\n  }\n}"
28                 },
29                 "url": {
30                     "raw": "{{POLICY-XACML-URL}}/policy/pdpx/v1/decision",
31                     "host": [
32                         "{{POLICY-XACML-URL}}"
33                     ],
34                     "path": [
35                         "policy",
36                         "pdpx",
37                         "v1",
38                         "decision"
39                     ]
40                 },
41                 "description": "This is an API to fetch decision using the naming policy deployed in xacml pdp engine."
42             },
43             "response": []
44         },
45         {
46             "name": "Xacml Decision - Monitoring  (Using policy-id)",
47             "request": {
48                 "method": "POST",
49                 "header": [
50                     {
51                         "key": "Content-Type",
52                         "type": "text",
53                         "value": "application/json"
54                     },
55                     {
56                         "key": "Accept",
57                         "type": "text",
58                         "value": "application/json"
59                     }
60                 ],
61                 "body": {
62                     "mode": "raw",
63                     "raw": "{\n  \"ONAPName\": \"DCAE\",\n  \"ONAPComponent\": \"PolicyHandler\",\n  \"ONAPInstance\": \"622431a4-9dea-4eae-b443-3b2164639c64\",\n  \"action\": \"configure\",\n  \"resource\": {\n      \"policy-id\": \"onap.restart.tca\"\n  }\n}"
64                 },
65                 "url": {
66                     "raw": "{{POLICY-XACML-URL}}/policy/pdpx/v1/decision",
67                     "host": [
68                         "{{POLICY-XACML-URL}}"
69                     ],
70                     "path": [
71                         "policy",
72                         "pdpx",
73                         "v1",
74                         "decision"
75                     ]
76                 },
77                 "description": "This is an API to fetch decision using the monitoring policy deployed in xacml pdp engine."
78             },
79             "response": []
80         },
81         {
82             "name": "Xacml Decision - Monitoring (Using policy-type)",
83             "request": {
84                 "method": "POST",
85                 "header": [
86                     {
87                         "key": "Content-Type",
88                         "type": "text",
89                         "value": "application/json"
90                     },
91                     {
92                         "key": "Accept",
93                         "type": "text",
94                         "value": "application/json"
95                     }
96                 ],
97                 "body": {
98                     "mode": "raw",
99                     "raw": "{\n  \"ONAPName\": \"DCAE\",\n  \"ONAPComponent\": \"PolicyHandler\",\n  \"ONAPInstance\": \"622431a4-9dea-4eae-b443-3b2164639c64\",\n  \"action\": \"configure\",\n  \"resource\": {\n      \"policy-type\": \"onap.policies.monitoring.cdap.tca.hi.lo.app\"\n  }\n}"
100                 },
101                 "url": {
102                     "raw": "{{POLICY-XACML-URL}}/policy/pdpx/v1/decision",
103                     "host": [
104                         "{{POLICY-XACML-URL}}"
105                     ],
106                     "path": [
107                         "policy",
108                         "pdpx",
109                         "v1",
110                         "decision"
111                     ]
112                 },
113                 "description": "This is an API to fetch decision using the monitoring policy deployed in xacml pdp engine."
114             },
115             "response": []
116         },
117         {
118             "name": "Xacml Decision - Optimization",
119             "request": {
120                 "method": "POST",
121                 "header": [
122                     {
123                         "key": "Content-Type",
124                         "type": "text",
125                         "value": "application/json"
126                     },
127                     {
128                         "key": "Accept",
129                         "type": "text",
130                         "value": "application/json"
131                     }
132                 ],
133                 "body": {
134                     "mode": "raw",
135                     "raw": "{\n  \"ONAPName\": \"OOF\",\n  \"ONAPComponent\": \"OOF-component\",\n  \"ONAPInstance\": \"OOF-component-instance\",\n  \"action\": \"optimize\",\n  \"resource\": {\n      \"scope\": [\"\"],\n      \"services\": [\"\"],\n      \"resources\": [\"\"],\n      \"geography\": [\"\"]\n  }\n}"
136                 },
137                 "url": {
138                     "raw": "{{POLICY-XACML-URL}}/policy/pdpx/v1/decision",
139                     "host": [
140                         "{{POLICY-XACML-URL}}"
141                     ],
142                     "path": [
143                         "policy",
144                         "pdpx",
145                         "v1",
146                         "decision"
147                     ]
148                 },
149                 "description": "This is an API to fetch decision using the optimization policy deployed in xacml pdp engine."
150             },
151             "response": []
152         },
153         {
154             "name": "Xacml Decision - Guard",
155             "request": {
156                 "method": "POST",
157                 "header": [
158                     {
159                         "key": "Content-Type",
160                         "type": "text",
161                         "value": "application/json"
162                     },
163                     {
164                         "key": "Accept",
165                         "type": "text",
166                         "value": "application/json"
167                     }
168                 ],
169                 "body": {
170                     "mode": "raw",
171                     "raw": "{\n  \"ONAPName\": \"Drools\",\n  \"ONAPComponent\": \"Drools-frankfurt-controller\",\n  \"ONAPInstance\": \"drools-frankfurt-controller-instance1\",\n  \"requestId\": \"unique-request-drools-1\",\n  \"action\": \"guard\",\n  \"resource\": {\n        \"guard\": {\n          \"actor\": \"SO\",\n          \"operation\": \"VF Module Create\",\n          \"clname\": \"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\",\n          \"target\": \"e6130d03-56f1-4b0a-9a1d-e1b2ebc30e0e\",\n          \"vfCount\": \"1\"\n        }\n  }\n}"
172                 },
173                 "url": {
174                     "raw": "{{POLICY-XACML-URL}}/policy/pdpx/v1/decision",
175                     "host": [
176                         "{{POLICY-XACML-URL}}"
177                     ],
178                     "path": [
179                         "policy",
180                         "pdpx",
181                         "v1",
182                         "decision"
183                     ]
184                 },
185                 "description": "This is an API to fetch decision using the guard policy deployed in xacml pdp engine."
186             },
187             "response": []
188         }
189     ],
190     "auth": {
191         "type": "basic",
192         "basic": [
193             {
194                 "key": "password",
195                 "value": "{{PASSWORD}}",
196                 "type": "string"
197             },
198             {
199                 "key": "username",
200                 "value": "{{USER}}",
201                 "type": "string"
202             }
203         ]
204     },
205     "event": [
206         {
207             "listen": "prerequest",
208             "script": {
209                 "id": "14faaa23-7872-4b28-8090-4b1ddade86db",
210                 "type": "text/javascript",
211                 "exec": [
212                     ""
213                 ]
214             }
215         },
216         {
217             "listen": "test",
218             "script": {
219                 "id": "6355f726-a7f2-4a28-8027-b2d8a4f01b96",
220                 "type": "text/javascript",
221                 "exec": [
222                     ""
223                 ]
224             }
225         }
226     ],
227     "variable": [
228         {
229             "id": "ada01974-e2a7-4d4c-be68-96f36cf0961d",
230             "key": "USER",
231             "value": "healthcheck",
232             "type": "string"
233         },
234         {
235             "id": "e63c4f34-938a-4dc1-85f1-44209758b886",
236             "key": "PASSWORD",
237             "value": "zb!XztG34",
238             "type": "string"
239         }
240     ],
241     "protocolProfileBehavior": {}
242 }