Adding ONAP PMS as a submodule.
[nonrtric.git] / docs / sdnc-a1-controller-api.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright (C) 2020 Nordix
4
5 .. |nbsp| unicode:: 0xA0
6    :trim:
7
8 .. |nbh| unicode:: 0x2011
9    :trim:
10
11 .. _sdnc-a1-controller-api:
12
13
14 ######################
15 SDNC A1 Controller API
16 ######################
17
18 The A1 of a Near |nbh| RT |nbsp| RIC can be used through the SDNC A1 Controller.
19
20 The OSC A1 Controller supports using multiple versions of A1 API southbound. By passing the full URL for each southbound
21 A1 operation the problem of version-specific URL formats is avoided.
22
23 Since different versions of A1 operations may use different data formats for data payloads for similar REST requests and
24 responses the data formatting requirements are flexible, so version-specific encoding/decoding is handled by the service
25 that requests the A1 operation.
26
27 Get Policy Type
28 ~~~~~~~~~~~~~~~
29
30 POST
31 ++++
32
33 Gets a policy type.
34
35 Definition
36 """"""""""
37
38 **URL path:**
39
40 /restconf/operations/A1-ADAPTER-API:getA1PolicyType
41
42 **Parameters:**
43
44 None.
45
46 **Body:** (*Required*)
47
48 A JSON object. ::
49
50   {
51     "input": {
52       "near-rt-ric-url": "<url-to-near-rt-ric-to-get-type>"
53     }
54   }
55
56 **Responses:**
57
58 200:
59
60 A JSON object where the body tag contains the JSON object of the policy type. ::
61
62   {
63     "output": {
64       "http-status": "integer",
65       "body": "{
66         <policy-type>
67       }"
68     }
69   }
70
71 Examples
72 """"""""
73
74 Get a policy type from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. The STD 1.1.3 version does not
75 support types, so this function is not available for that version.
76
77 **Call**: ::
78
79     curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1PolicyType"
80     -H "Content-Type: application/json" -d '{
81       "input": {
82         "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11"
83       }
84     }'
85
86 **Result**:
87
88 200: ::
89
90   {
91     "output": {
92       "http-status": 200,
93       "body": "{
94         \"$schema\": \"http://json-schema.org/draft-07/schema#\",
95         \"title\": \"Example_QoETarget_1.0.0\",
96         \"description\": \"Example QoE Target policy type\",
97         \"type\": \"object\",
98         \"properties\": {
99           \"scope\": {
100             \"type\": \"object\",
101             \"properties\": {
102               \"ueId\": {
103                 \"type\": \"string\"
104               },
105               \"sliceId\": {
106                 \"type\": \"string\"
107               },
108               \"qosId\": {
109                 \"type\": \"string\"
110               },
111               \"cellId\": {
112                 \"type\": \"string\"
113               }
114             },
115             \"additionalProperties\": false,
116             \"required\": [
117               \"ueId\",
118               \"sliceId\"
119             ]
120           },
121           \"statement\": {
122             \"type\": \"object\",
123             \"properties\": {
124               \"qoeScore\": {
125                 \"type\": \"number\"
126               },
127               \"initialBuffering\": {
128                 \"type\": \"number\"
129               },
130               \"reBuffFreq\": {
131                 \"type\": \"number\"
132               },
133               \"stallRatio\": {
134                 \"type\": \"number\"
135               }
136             },
137             \"minProperties\": 1,
138             \"additionalProperties\": false
139           }
140         }
141       }"
142     }
143   }
144
145 Put Policy
146 ~~~~~~~~~~
147
148 POST
149 ++++
150
151 Creates or updates a policy instance.
152
153 Definition
154 """"""""""
155
156 **URL path:**
157
158 /restconf/operations/A1-ADAPTER-API:putA1Policy
159
160 **Parameters:**
161
162 None.
163
164 **Body:** (*Required*)
165
166 A JSON object where the body tag contains the JSON object of the policy. ::
167
168   {
169     "input": {
170       "near-rt-ric-url": "<url-to-near-rt-ric-to-put-policy>",
171       "body": "<policy-as-json-string>"
172     }
173   }
174
175 **Responses:**
176
177 200:
178
179 A JSON object with the response. ::
180
181   {
182     "output": {
183       "http-status": "integer"
184     }
185   }
186
187 Examples
188 """"""""
189
190 **Call**:
191
192 Create a policy in a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. ::
193
194     curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:putA1Policy"
195     -H "Content-Type: application/json" -d '{
196       "input": {
197         "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11/policies/5000",
198         "body": "{
199           "blocking_rate":20,
200           "enforce":true,
201           "trigger_threshold":10,
202           "window_length":10
203         }"
204       }
205     }'
206
207 Create a policy in a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. ::
208
209     curl -X POST http://localhost:8282/restconf/operations/A1-ADAPTER-API:putA1Policy
210     -H Content-Type:application/json -d '{
211       "input": {
212         "near-rt-ric-url": "http://ricsim_g2_1:8085/A1-P/v1/policies/5000",
213         "body": "{
214           "scope": {
215             "ueId": "ue5000",
216             "qosId": "qos5000"
217           },
218           "qosObjective": {
219             "priorityLevel": 5000
220           }
221         }"
222       }
223     }'
224
225 **Result**:
226
227 The result is the same irrespective of which API that is used.
228
229 200: ::
230
231   {
232     "output": {
233       "http-status": 200
234     }
235   }
236
237 Get Policy
238 ~~~~~~~~~~
239
240 POST
241 ++++
242
243 Gets a policy instance.
244
245 Definition
246 """"""""""
247
248 **URL path:**
249
250 /restconf/operations/A1-ADAPTER-API:getA1Policy
251
252 **Parameters:**
253
254 None.
255
256 **Body:** (*Required*)
257
258 A JSON object. ::
259
260   {
261     "input": {
262       "near-rt-ric-url": "<url-to-near-rt-ric-to-get-policy>"
263     }
264   }
265
266 **Responses:**
267
268 200:
269   A JSON object where the body tag contains the JSON object of the policy. ::
270
271     {
272       "output": {
273         "http-status": "integer",
274         "body": "{
275           <result>
276         }"
277       }
278     }
279
280 Examples
281 """"""""
282
283 **Call**:
284
285 Get **all** policy IDs from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. ::
286
287     curl -X POST http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1Policy
288     -H Content-Type:application/json -d '{
289       "input": {
290         "near-rt-ric-url":"http://ricsim_g1_1:8085/a1-p/policytypes/11/policies"
291       }
292     }'
293
294 Get **all** policy IDs from a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. ::
295
296     curl -X POST http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1Policy
297     -H Content-Type:application/json -d '{
298       "input": {
299         "near-rt-ric-url":"http://ricsim_g2_1:8085/A1-P/v1/policies"
300       }
301     }'
302
303 **Result**:
304
305 The result is the same irrespective of which API that is used.
306
307 200: ::
308
309   {
310     "output": {
311       "http-status":200,
312       "body":"[
313         \"5000\",
314           .
315           .
316           .
317         \"6000\"
318       ]"
319     }
320   }
321
322 **Call**:
323
324 Get **a specific** policy from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. ::
325
326     curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1Policy"
327     -H "Content-Type: application/json" -d '{
328       "input": {
329         "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11/policies/5000"
330       }
331     }'
332
333 Get **a specific** policy from a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. ::
334
335     curl -X POST http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1Policy
336     -H Content-Type:application/json -d '{
337       "input": {
338         "near-rt-ric-url":"http://ricsim_g2_1:8085/A1-P/v1/policies/5000"
339       }
340     }'
341
342 **Result**:
343
344 The result is the same irrespective of which API that is used.
345
346 200: ::
347
348   {
349     "output": {
350       "http-status": 200,
351       "body": "{
352         \"blocking_rate\": 20,
353         \"enforce\": true,
354         \"trigger_threshold\": 10,
355         \"window_length\": 10
356       }"
357     }
358   }
359
360 Delete Policy
361 ~~~~~~~~~~~~~
362
363 POST
364 ++++
365
366 Deletes a policy instance.
367
368 Definition
369 """"""""""
370
371 **URL path:**
372
373 /restconf/operations/A1-ADAPTER-API:deleteA1Policy
374
375 **Parameters:**
376
377 None.
378
379 **Body:** (*Required*)
380
381 A JSON object. ::
382
383   {
384     "input": {
385       "near-rt-ric-url": "<url-to-near-rt-ric-to-delete-policy>"
386     }
387   }
388
389 **Responses:**
390
391 200:
392
393 A JSON object with the response. ::
394
395   {
396     "output": {
397       "http-status": "integer"
398     }
399   }
400
401 Examples
402 """"""""
403
404 **Call**:
405
406 Delete a policy from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. ::
407
408     curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:deleteA1Policy"
409     -H "Content-Type: application/json" -d '{
410       "input": {
411         "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11/policies/5000"
412       }
413     }'
414
415 Delete a policy from a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. ::
416
417     curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:deleteA1Policy"
418     -H "Content-Type: application/json" -d '{
419       "input": {
420         "near-rt-ric-url": "http://ricsim_g2_1:8085/A1-P/v1/policies/5000"
421       }
422     }'
423
424 **Result**:
425
426 The result is the same irrespective of which API that is used.
427
428 200: ::
429
430   {
431     "output": {
432       "http-status": 202
433     }
434   }
435
436 Get Policy Status
437 ~~~~~~~~~~~~~~~~~
438
439 POST
440 ++++
441
442 Get the status of a policy instance.
443
444 Definition
445 """"""""""
446
447 **URL path:**
448
449 /restconf/operations/A1-ADAPTER-API:getA1PolicyStatus
450
451 **Parameters:**
452
453 None.
454
455 **Body:** (*Required*)
456
457 A JSON object. ::
458
459   {
460     "input": {
461       "near-rt-ric-url": "<url-to-near-rt-ric-to-get-policy-status>"
462     }
463   }
464
465 **Responses:**
466
467 200:
468
469 A JSON object where the body tag contains the JSON object with the policy status according to the API version used. ::
470
471   {
472     "output": {
473       "http-status": "integer",
474       "body": "{
475         <policy-status-object>
476       }"
477     }
478   }
479
480 Examples
481 """"""""
482
483 **Call**:
484
485 Get the policy status for a specific policy from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. ::
486
487     curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1PolicyStatus"
488     -H "Content-Type: application/json" -d '{
489       "input": {
490         "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11/policies/5000/status"
491       }
492     }'
493
494 **Result**:
495
496 200: ::
497
498   {
499     "output": {
500       "http-status": 200,
501       "body": "{
502         \"instance_status\": \"IN EFFECT\",
503         \"has_been_deleted\": \"true\",
504         \"created_at\": \"Wed, 01 Apr 2020 07:45:45 GMT\"
505       }"
506     }
507   }
508
509 **Call**:
510
511 Get the policy status for a specific policy from a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. ::
512
513     curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1PolicyStatus"
514     -H "Content-Type: application/json" -d '{
515       "input": {
516         "near-rt-ric-url": "http://ricsim_g2_1:8085/A1-P/v1/policies/5000/status"
517       }
518     }'
519
520 **Result**:
521
522 200: ::
523
524   {
525     "output": {
526       "http-status": 200,
527       "body": "{
528         \"enforceStatus\": \"UNDEFINED\"
529       }"
530     }
531   }