blob: ce94b3d3382312ddb3aa56bb0aebaf6ab57b1ae7 [file] [log] [blame]
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
elinuxhenrik0a4c38b2020-04-14 10:59:36 +02003.. Copyright (C) 2020 Nordix
elinuxhenrike0fab9a2020-03-31 17:59:49 +02004
5.. |nbsp| unicode:: 0xA0
6 :trim:
7
8.. |nbh| unicode:: 0x2011
9 :trim:
10
11.. _policy-agent-api:
12
elinuxhenrikd64e33d2020-04-22 18:05:07 +020013################################
14A1 Policy Management Service API
15################################
elinuxhenrike0fab9a2020-03-31 17:59:49 +020016
17
18*******************************************
19A1 Policy Management Service - Introduction
20*******************************************
21
22The A1 Policy Management Service ("Policy Agent") is an SMO/NONRTRIC service above the NONRTRIC A1 Adaptor/Controller
23that provides:
24
25* Unified REST & DMAAP APIs for managing A1 Policies in all Near |nbh| RT |nbsp| RICs
26* Synchronized view of registered "services" (e.g. R-APP, GUI, etc)
27* Synchronized view of policy instances for each "service"
28* Synchronized view of policy instances in all Near |nbh| RT |nbsp| RICs
29* Synchronized view of policy types in all Near |nbh| RT |nbsp| RICs
30* Policy Query API (e.g. per Near |nbh| RT |nbsp| RIC, per "service", per policy type)
31* An initial interface for unified Near |nbh| RT |nbsp| RIC ID to Near |nbh| RT |nbsp| RIC address mapping.
32 (Note: may also later act as adaptor to A&AI, CMDBs etc. to "find" Near |nbh| RT |nbsp| RICs - TBC)
33* An Initial "O1 ManagedElement" mapping database & interface to find appropriate Near |nbh| RT |nbsp| RIC for RAN elements.
34 (Note: may also later act as adaptor to A&AI, RuntimeDB, other CMDBs etc. - TBC)
35* Monitors all Near |nbh| RT |nbsp| RICs and recovers from inconsistencies (Note: e.g. Near |nbh| RT |nbsp| RIC restarts)
36* Support for different Southbound connectors on a per Near |nbh| RT |nbsp| RIC basis. (Note: e.g. different A1
37 versions, different Near |nbh| RT |nbsp| RIC versions, different A1 adapters, different or proprietary A1
38 controllers/EMSs)
39
40***************************************
41A1 Policy Management Service - REST NBI
42***************************************
43
44This is the north bound API of the A1 Policy Management Service ("Policy Agent"). This API allows *services* to interact
45with the Policy Agent using REST.
46
47By registering with the Policy Agent, the Policy Agent takes responsibility for synchronizing the policies created by
48the service in the Near |nbh| RT |nbsp| RICs. This means that if a Near |nbh| RT |nbsp| RIC restarts, the Policy Agent
49will try to recreate all the policies residing in the Near |nbh| RT |nbsp| RIC once it is started again. If this is not
50possible, it will remove all policies belonging to the Near |nbh| RT |nbsp| RIC.
51
52The Policy Agent also keeps an updated view of the policy types available, and which Near |nbh| RT |nbsp| RICs that
53support which types. Also, the Policy Agent can tell if a Managed Element is managed by a certain
54Near |nbh| RT |nbsp| RIC.
55
elinuxhenrikd64e33d2020-04-22 18:05:07 +020056The Policy Agent NBI has five distinct parts, described in the sections below:
elinuxhenrike0fab9a2020-03-31 17:59:49 +020057
58* Service Management
elinuxhenrikd64e33d2020-04-22 18:05:07 +020059* Policy Types
elinuxhenrike0fab9a2020-03-31 17:59:49 +020060* Policy Management
61* Near-RT RIC Repository
62* Health Check
63
elinuxhenrikd64e33d2020-04-22 18:05:07 +020064******************
elinuxhenrike0fab9a2020-03-31 17:59:49 +020065Service Management
elinuxhenrikd64e33d2020-04-22 18:05:07 +020066******************
elinuxhenrike0fab9a2020-03-31 17:59:49 +020067
68A service can register itself in the Policy Agent.
69
70By providing a callback URL the service can get notifications from the Policy Agent.
71
72A service can also register a "*Keep Alive Interval*", in seconds. By doing this the service promises to call the
73Policy Agent's "*Keep Alive*" method, or else create or delete policies, more often than the "*Keep Alive Interval*"
74measured in seconds. If the service, for some reason, is not able to do this, the Policy Agent will consider that the
75service has died or vanished and will then delete all its policies, both in the internal repository and in the
76Near |nbh| RT |nbsp| RICs where they were earlier created. **Note!** |nbsp| If the service does not provide a value for
77"*Keep Alive Interval*", then the service maintains full responsibility to delete all of its policies when they are no
78longer needed.
79
elinuxhenrike0fab9a2020-03-31 17:59:49 +020080/service
81~~~~~~~~
82
83PUT
84+++
85
elinuxhenrikfea065a2020-04-20 16:46:26 +020086Register a service.
elinuxhenrike0fab9a2020-03-31 17:59:49 +020087
elinuxhenrikd64e33d2020-04-22 18:05:07 +020088Definition
89""""""""""
90
elinuxhenrikfea065a2020-04-20 16:46:26 +020091**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +020092
93/service
elinuxhenrike0fab9a2020-03-31 17:59:49 +020094
elinuxhenrikfea065a2020-04-20 16:46:26 +020095**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +020096
97None.
elinuxhenrike0fab9a2020-03-31 17:59:49 +020098
elinuxhenrikfea065a2020-04-20 16:46:26 +020099**Body:** (*Required*)
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200100
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200101A JSON object (ServiceRegistrationInfo): ::
102
103 {
104 "callbackUrl": "string", (An empty string means the service will never get any callbacks.)
105 "keepAliveIntervalSeconds": 0, (0 means the service will always be considered alive.)
106 "serviceName": "string" (Required, must be unique.)
107 }
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200108
elinuxhenrikfea065a2020-04-20 16:46:26 +0200109**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200110
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200111200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200112
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200113Service updated.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200114
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200115201:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200116
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200117Service created.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200118
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200119400:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200120
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200121The ServiceRegistrationInfo is not accepted.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200122
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200123Examples
124""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200125
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200126**Call**: ::
127
128 curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d '{
129 "callbackUrl": "URL",
130 "keepAliveIntervalSeconds": 0,
131 "serviceName": "existing"
132 }'
133
134**Result**:
135
136201: ::
137
138 OK
139
140**Call**: ::
141
142 curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d "{}"
143
144**Result**:
145
146400: ::
147
148 Missing mandatory parameter 'serviceName'
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200149
150/services
151~~~~~~~~~
152
153GET
154+++
155
elinuxhenrikfea065a2020-04-20 16:46:26 +0200156Query service information.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200157
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200158Definition
159""""""""""
160
elinuxhenrikfea065a2020-04-20 16:46:26 +0200161**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200162
163/services?name=<service-name>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200164
elinuxhenrikfea065a2020-04-20 16:46:26 +0200165**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200166
167name: (*Optional*)
168
169The name of the service.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200170
elinuxhenrikfea065a2020-04-20 16:46:26 +0200171**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200172
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200173200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200174
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200175Array of JSON objects (ServiceStatus). ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200176
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200177 {
178 "callbackUrl": "string", (Callback URL)
179 "keepAliveIntervalSeconds": 0, (Policy keep alive interval)
180 "serviceName": "string", (Identity of the service)
181 "timeSinceLastActivitySeconds": 0 (Time since last invocation by the service)
182 }
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200183
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200184404:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200185
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200186Service is not found.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200187
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200188Examples
189""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200190
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200191**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200192
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200193 curl -X GET "http://localhost:8081/services?name=existing"
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200194
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200195**Result**:
196
197200: ::
198
199 [
200 {
201 "serviceName":"existing",
202 "keepAliveIntervalSeconds":0,
203 "timeSinceLastActivitySeconds":7224,
204 "callbackUrl":"URL"
205 }
206 ]
207
208**Call**: ::
209
210 curl -X GET "http://localhost:8081/services?name=nonexistent"
211
212Result:
213
214404: ::
215
216 Service not found
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200217
218DELETE
219++++++
220
elinuxhenrikfea065a2020-04-20 16:46:26 +0200221Delete a service.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200222
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200223Definition
224""""""""""
225
elinuxhenrikfea065a2020-04-20 16:46:26 +0200226**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200227
228/services?name=<service-name>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200229
elinuxhenrikfea065a2020-04-20 16:46:26 +0200230**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200231
232name: (*Required*)
233
234The name of the service.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200235
elinuxhenrikfea065a2020-04-20 16:46:26 +0200236**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200237
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200238204:
239 OK
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200240
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200241404:
242 Service not found.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200243
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200244Examples
245""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200246
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200247**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200248
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200249 curl -X DELETE "http://localhost:8081/services?name=existing"
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200250
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200251**Result**:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200252
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200253204: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200254
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200255 OK
256
257**Call**: ::
258
259 curl -X DELETE "http://localhost:8081/services?name=nonexistent"
260
261Result:
262
263404: ::
264
265 Could not find service: nonexistent
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200266
267/services/keepalive
268~~~~~~~~~~~~~~~~~~~
269
elinuxhenrik3d0aa332020-04-08 08:15:59 +0200270PUT
271+++
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200272
elinuxhenrikfea065a2020-04-20 16:46:26 +0200273Heart beat from a service.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200274
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200275Definition
276""""""""""
277
elinuxhenrikfea065a2020-04-20 16:46:26 +0200278**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200279
280/services/keepalive?name=<service-name>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200281
elinuxhenrikfea065a2020-04-20 16:46:26 +0200282**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200283
284name: (*Required*)
285
286The name of the service.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200287
elinuxhenrikfea065a2020-04-20 16:46:26 +0200288**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200289
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200290200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200291
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200292OK
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200293
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200294404:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200295
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200296Service is not found.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200297
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200298Examples
299""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200300
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200301**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200302
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200303 curl -X PUT "http://localhost:8081/services/keepalive?name=existing"
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200304
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200305**Result**:
306
307200: ::
308
309 OK
310
311**Call**: ::
312
313 curl -X PUT "http://localhost:8081/services/keepalive?name=nonexistent"
314
315**Result**:
316
317404: ::
318
319 Could not find service: nonexistent
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200320
321.. _policy-management:
322
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200323************
324Policy Types
325************
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200326
327Policies are based on types. The set of available policy types is determined by the set of policy types supported by
328Near |nbh| RT |nbsp| RICs. At startup, the Policy Agent queries all Near |nbh| RT |nbsp| RICs for their supported types
329and stores them in its internal repository. It then checks this at regular intervals to keep the repository of types up
330to date. Policy types cannot be created, updated or deleted using this interface since this must be done via the
331Near |nbh| RT |nbsp| RICs.
332
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200333A policy type defines a name and a JSON schema that constrains the content of a policy of that type.
334
335/policy_types
336~~~~~~~~~~~~~
337
338GET
339+++
340
elinuxhenrikfea065a2020-04-20 16:46:26 +0200341Query policy type names.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200342
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200343Definition
344""""""""""
345
elinuxhenrikfea065a2020-04-20 16:46:26 +0200346**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200347
348/policy_types?ric=<name-of-ric>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200349
elinuxhenrikfea065a2020-04-20 16:46:26 +0200350**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200351
352ric: (*Optional*)
353
354The name of the Near |nbh| RT |nbsp| RIC to get types for.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200355
elinuxhenrikfea065a2020-04-20 16:46:26 +0200356**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200357
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200358200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200359
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200360 Array of policy type names.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200361
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200362404:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200363
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200364 Near |nbh| RT |nbsp| RIC is not found.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200365
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200366Examples
367""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200368
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200369**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200370
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200371 curl -X GET "http://localhost:8081/policy_types"
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200372
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200373**Result**:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200374
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200375200: ::
376
377 [
378 "STD_PolicyModelUnconstrained_0.2.0",
379 "Example_QoETarget_1.0.0",
380 "ERIC_QoSNudging_0.2.0"
381 ]
382
383**Call**: ::
384
385 curl -X GET "http://localhost:8081/policy_types?ric=nonexistent"
386
387**Result**:
388
389404: ::
390
391 org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200392
393/policy_schema
394~~~~~~~~~~~~~~
395
396GET
397+++
398
elinuxhenrikfea065a2020-04-20 16:46:26 +0200399Returns one policy type schema definition.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200400
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200401Definition
402""""""""""
403
elinuxhenrikfea065a2020-04-20 16:46:26 +0200404**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200405
406/policy_schema?id=<name-of-type>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200407
elinuxhenrikfea065a2020-04-20 16:46:26 +0200408**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200409
410id: (*Required*)
411
412The ID of the policy type to get the definition for.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200413
elinuxhenrikfea065a2020-04-20 16:46:26 +0200414**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200415
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200416200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200417
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200418Policy schema as JSON schema.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200419
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200420404:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200421
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200422Policy type is not found.
423
424Examples
425""""""""
426
427**Call**: ::
428
429 curl -X GET "http://localhost:8081/policy_schema?id=STD_PolicyModelUnconstrained_0.2.0"
430
431**Result**:
432
433200: ::
434
435 {
436 "$schema": "http://json-schema.org/draft-07/schema#",
437 "title": "STD_PolicyModelUnconstrained_0.2.0",
438 "description": "Standard model of a policy with unconstrained scope id combinations",
439 "type": "object",
440 "properties": {
441 "scope": {
elinuxhenrikfea065a2020-04-20 16:46:26 +0200442 "type": "object",
443 "properties": {
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200444 "ueId": {"type": "string"},
445 "groupId": {"type": "string"}
elinuxhenrikfea065a2020-04-20 16:46:26 +0200446 },
447 "minProperties": 1,
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200448 "additionalProperties": false
449 },
450 "qosObjectives": {
451 "type": "object",
452 "properties": {
453 "gfbr": {"type": "number"},
454 "mfbr": {"type": "number"}
455 },
456 "additionalProperties": false
457 },
458 "resources": {
459 "type": "array",
460 "items": {
461 "type": "object",
462 "properties": {
463 "cellIdList": {
464 "type": "array",
465 "minItems": 1,
466 "uniqueItems": true,
467 "items": {
468 "type": "string"
469 }
470 },
471 "additionalProperties": false,
472 "required": ["cellIdList"]
473 }
elinuxhenrikfea065a2020-04-20 16:46:26 +0200474 }
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200475 },
476 "minProperties": 1,
477 "additionalProperties": false,
478 "required": ["scope"]
479 }
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200480
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200481**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200482
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200483 curl -X GET "http://localhost:8081/policy_schema?id=nonexistent"
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200484
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200485**Result**:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200486
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200487404: ::
488
489 org.oransc.policyagent.exceptions.ServiceException: Could not find type: nonexistent
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200490
491/policy_schemas
492~~~~~~~~~~~~~~~
493
494GET
495+++
496
elinuxhenrikfea065a2020-04-20 16:46:26 +0200497Returns policy type schema definitions.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200498
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200499Definition
500""""""""""
501
elinuxhenrikfea065a2020-04-20 16:46:26 +0200502**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200503
504/policy_schemas?ric=<name-of-ric>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200505
elinuxhenrikfea065a2020-04-20 16:46:26 +0200506**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200507
508ric: (*Optional*)
509
510The name of the Near |nbh| RT |nbsp| RIC to get the definitions for.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200511
elinuxhenrikfea065a2020-04-20 16:46:26 +0200512**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200513
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200514200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200515
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200516An array of policy schemas as JSON schemas.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200517
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200518404:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200519
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200520Near |nbh| RT |nbsp| RIC is not found.
521
522Examples
523""""""""
524
525**Call**: ::
526
527 curl -X GET "http://localhost:8081/policy_schemas"
528
529**Result**:
530
531200: ::
532
533 [
534 {
535 "$schema": "http://json-schema.org/draft-07/schema#",
536 "title": "STD_PolicyModelUnconstrained_0.2.0",
537 "description": "Standard model of a policy with unconstrained scope id combinations",
538 "type": "object",
539 "properties": {
540 "scope": {
541 "type": "object",
elinuxhenrikfea065a2020-04-20 16:46:26 +0200542 .
543 .
544 .
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200545 }
elinuxhenrikfea065a2020-04-20 16:46:26 +0200546 "additionalProperties": false,
547 "required": ["scope"]
548 },
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200549 .
550 .
551 .
elinuxhenrikfea065a2020-04-20 16:46:26 +0200552 {
553 "$schema": "http://json-schema.org/draft-07/schema#",
554 "title": "Example_QoETarget_1.0.0",
555 "description": "Example QoE Target policy type",
556 "type": "object",
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200557 "properties": {
558 "scope": {
559 "type": "object",
560 .
561 .
562 .
563 }
564 "additionalProperties": false,
565 "required": ["scope"]
566 }
567 }
568 }
569 ]
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200570
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200571**Call**: ::
elinuxhenrik53e46042020-04-21 15:14:04 +0200572
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200573 curl -X GET "http://localhost:8081/policy_schemas?ric=nonexistent"
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200574
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200575**Result**:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200576
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200577404: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200578
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200579 org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent
580
581*****************
582Policy Management
583*****************
584
585Policies can be queried, created, updated, and deleted. A policy is always created in a specific
586Near |nbh| RT |nbsp| RIC.
587
588When a policy is created, the Policy Agent stores information about it in its internal repository. At regular intervals,
589it then checks with all Near |nbh| RT |nbsp| RICs that this repository is synchronized. If, for some reason, there is an
590inconsistency, the Policy Agent will start a synchronization job and try to reflect the status of the
591Near |nbh| RT |nbsp| RIC. If this fails, the Policy Agent will delete all policies for the specific
592Near |nbh| RT |nbsp| RIC in the internal repository and set its state to *UNKNOWN*. This means that no interaction with
593the Near |nbh| RT |nbsp| RIC is possible until the Policy Agent has been able to contact it again and re-synchronize its
594state in the repository.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200595
596A policy is defined by its type schema.
597
598Once a service has created a policy, it is the service's responsibility to maintain its life cycle. Since policies are
599transient, they will not survive a restart of a Near |nbh| RT |nbsp| RIC. But this is handled by the Policy Agent. When
600a Near |nbh| RT |nbsp| RIC has been restarted, the Policy Agent will try to recreate the policies in the
601Near |nbh| RT |nbsp| RIC that are stored in its local repository. This means that the service always must delete any
602policy it has created. There are only two exceptions, see below:
603
604- The service has registered a "*Keep Alive Interval*", then its policies will be deleted if it fails to notify the
605 Policy Agent in due time.
606- The Policy Agent completely fails to synchronize with a Near |nbh| RT |nbsp| RIC.
607
608/policies
609~~~~~~~~~
610
611GET
612+++
613
elinuxhenrikfea065a2020-04-20 16:46:26 +0200614Query policies.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200615
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200616Definition
617""""""""""
618
elinuxhenrikfea065a2020-04-20 16:46:26 +0200619**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200620
621/policies?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-type>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200622
elinuxhenrikfea065a2020-04-20 16:46:26 +0200623**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200624
625ric: (*Optional*)
626
627The name of the Near |nbh| RT |nbsp| RIC to get policies for.
628
629service: (*Optional*)
630
631The name of the service to get policies for.
632
633type: (*Optional*)
634
635The name of the policy type to get policies for.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200636
elinuxhenrikfea065a2020-04-20 16:46:26 +0200637**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200638
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200639200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200640
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200641Array of JSON objects (PolicyInfo). ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200642
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200643 {
644 "id": "string", (Identity of the policy)
645 "json": "object", (The configuration of the policy)
646 "lastModified": "string", (Timestamp, last modification time)
647 "ric": "string", (Identity of the target Near |nbh| RT |nbsp| RIC)
648 "service": "string", (The name of the service owning the policy)
649 "type": "string" (Name of the policy type)
650 }
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200651
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200652404:
653 Near |nbh| RT |nbsp| RIC or policy type not found.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200654
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200655Examples
656""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200657
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200658**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200659
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200660 curl -X GET "http://localhost:8081/policies?ric=existing"
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200661
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200662**Result**:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200663
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200664200: ::
665
666 [
667 {
668 "id": "Policy 1",
669 "json": {
670 "scope": {
671 "ueId": "UE 1",
672 "groupId": "Group 1"
673 },
674 "qosObjectives": {
675 "gfbr": 1,
676 "mfbr": 2
677 },
678 "cellId": "Cell 1"
679 },
680 "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT",
681 "ric": "existing",
682 "service": "Service 1",
683 "type": "STD_PolicyModelUnconstrained_0.2.0"
684 },
685 {
686 "id": "Policy 2",
687 "json": {
688 .
689 .
690 .
691 },
692 "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT",
693 "ric": "existing",
694 "service": "Service 2",
695 "type": "Example_QoETarget_1.0.0"
696 }
697 ]
698
699**Call**: ::
700
701 curl -X GET "http://localhost:8081/policies?type=nonexistent"
702
703**Result**:
704
705404: ::
706
707 Policy type not found
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200708
709/policy
710~~~~~~~
711
712GET
713+++
714
elinuxhenrikfea065a2020-04-20 16:46:26 +0200715Returns a policy configuration.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200716
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200717Definition
718""""""""""
719
elinuxhenrikfea065a2020-04-20 16:46:26 +0200720**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200721
722/policy?id=<policy-id>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200723
elinuxhenrikfea065a2020-04-20 16:46:26 +0200724**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200725
726id: (*Required*)
727
728The ID of the policy instance.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200729
elinuxhenrikfea065a2020-04-20 16:46:26 +0200730**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200731
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200732200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200733
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200734JSON object containing policy information. ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200735
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200736 {
737 "id": "string", (ID of policy)
738 "json": "object", (JSON with policy data speified by the type)
739 "ownerServiceName": "string", (Name of the service that created the policy)
740 "ric": "string", (Name of the Near |nbh| RT |nbsp| RIC where the policy resides)
741 "type": "string", (Name of the policy type of the policy)
742 "lastModified" (Timestamp, last modification time)
743 }
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200744
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200745404:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200746
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200747Policy is not found.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200748
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200749Examples
750""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200751
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200752**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200753
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200754 curl -X GET "http://localhost:8081/policy?id=Policy 1"
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200755
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200756**Result**:
757
758200: ::
759
760 {
761 "id": "Policy 1",
762 "json", {
763 "scope": {
764 "ueId": "UE1 ",
765 "cellId": "Cell 1"
766 },
767 "qosObjectives": {
768 "gfbr": 319.5,
769 "mfbr": 782.75,
770 "priorityLevel": 268.5,
771 "pdb": 44.0
772 },
773 "qoeObjectives": {
774 "qoeScore": 329.0,
775 "initialBuffering": 27.75,
776 "reBuffFreq": 539.0,
777 "stallRatio": 343.0
778 },
779 "resources": []
780 },
781 "ownerServiceName": "Service 1",
782 "ric": "ric1",
783 "type": "STD_PolicyModelUnconstrained_0.2.0",
784 "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT"
785 }
786
787**Call**: ::
788
789 curl -X GET "http://localhost:8081/policy?id=nonexistent"
790
791**Result**:
792
793404: ::
794
795 Policy is not found
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200796
797PUT
798+++
799
elinuxhenrikfea065a2020-04-20 16:46:26 +0200800Create/Update a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a
801"*Keep Alive Interval*" registered.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200802
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200803Definition
804""""""""""
805
elinuxhenrikfea065a2020-04-20 16:46:26 +0200806**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200807
808/policy?id=<policy-id>&ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200809
elinuxhenrikfea065a2020-04-20 16:46:26 +0200810**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200811
812id: (*Required*)
813
814The ID of the policy instance.
815
816ric: (*Required*)
817
818The name of the Near |nbh| RT |nbsp| RIC where the policy will be created.
819
820service: (*Required*)
821
822The name of the service creating the policy.
823
824type: (*Optional*)
825
826The name of the policy type.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200827
elinuxhenrikfea065a2020-04-20 16:46:26 +0200828**Body:** (*Required*)
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200829
830A JSON object containing the data specified by the type.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200831
elinuxhenrikfea065a2020-04-20 16:46:26 +0200832**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200833
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200834200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200835
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200836Policy updated.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200837
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200838201:
839
840Policy created.
841
842404:
843
844Near |nbh| RT |nbsp| RIC or policy type is not found.
845
846423:
847
848Near |nbh| RT |nbsp| RIC is not operational.
849
850Examples
851""""""""
852
853**Call**: ::
854
855 curl -X PUT "http://localhost:8081/policy?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
856 -H "Content-Type: application/json"
857 -d '{
858 "scope": {
859 "ueId": "UE 1",
860 "cellId": "Cell 1"
861 },
862 "qosObjectives": {
863 "gfbr": 319.5,
864 "mfbr": 782.75,
865 "priorityLevel": 268.5,
866 "pdb": 44.0
867 },
868 "qoeObjectives": {
869 "qoeScore": 329.0,
870 "initialBuffering": 27.75,
871 "reBuffFreq": 539.0,
872 "stallRatio": 343.0
873 },
874 "resources": []
875 }'
876
877**Result**:
878
879200
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200880
881DELETE
882++++++
883
elinuxhenrikfea065a2020-04-20 16:46:26 +0200884Deletes a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a
885"*Keep Alive Interval*" registered.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200886
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200887Definition
888""""""""""
889
elinuxhenrikfea065a2020-04-20 16:46:26 +0200890**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200891
892/policy?id=<policy-id>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200893
elinuxhenrikfea065a2020-04-20 16:46:26 +0200894**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200895
896id: (*Required*)
897
898The ID of the policy instance.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200899
elinuxhenrikfea065a2020-04-20 16:46:26 +0200900**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200901
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200902204:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200903
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200904Policy deleted.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200905
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200906404:
907
908Policy is not found.
909
910423:
911
912Near |nbh| RT |nbsp| RIC is not operational.
913
914Examples
915""""""""
916
917**Call**: ::
918
919 curl -X DELETE "http://localhost:8081/policy?id=Policy 1"
920
921**Result**:
922
923204
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200924
925/policy_ids
926~~~~~~~~~~~
927
928GET
929+++
930
elinuxhenrikfea065a2020-04-20 16:46:26 +0200931Query policy type IDs.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200932
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200933Definition
934""""""""""
935
elinuxhenrikfea065a2020-04-20 16:46:26 +0200936**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200937
938/policy_ids?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type>
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200939
elinuxhenrikfea065a2020-04-20 16:46:26 +0200940**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200941
942ric: (*Optional*)
943
944The name of the Near |nbh| RT |nbsp| RIC to get policies for.
945
946service: (*Optional*)
947
948The name of the service to get policies for.
949
950type: (*Optional*)
951
952The name of the policy type to get policies for.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200953
elinuxhenrikfea065a2020-04-20 16:46:26 +0200954**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200955
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200956200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200957
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200958Array of policy type names.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200959
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200960404:
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200961
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200962RIC or policy type not found.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200963
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200964Examples
965""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200966
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200967**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200968
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200969 curl -X GET "http://localhost:8081/policy_ids"
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200970
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200971**Result**:
972
973200: ::
974
975 [
976 "Policy 1",
977 "Policy 2",
978 "Policy 3"
979 ]
980
981**Call**: ::
982
983 curl -X GET "http://localhost:8081/policy_ids?ric=nonexistent"
984
985**Result**:
986
987404: ::
988
989 Ric not found
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200990
991/policy_status
992~~~~~~~~~~~~~~
993
994GET
995+++
996
elinuxhenrikfea065a2020-04-20 16:46:26 +0200997Returns the status of a policy.
elinuxhenrike0fab9a2020-03-31 17:59:49 +0200998
elinuxhenrikd64e33d2020-04-22 18:05:07 +0200999Definition
1000""""""""""
1001
elinuxhenrikfea065a2020-04-20 16:46:26 +02001002**URL path:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001003
1004/policy_status?id=<policy-id>
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001005
elinuxhenrikfea065a2020-04-20 16:46:26 +02001006**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001007
1008id: (*Required*)
1009
1010The ID of the policy.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001011
elinuxhenrikfea065a2020-04-20 16:46:26 +02001012**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001013
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001014200:
1015
1016JSON object with policy status.
1017
1018404:
1019
1020Policy not found.
1021
1022**********************
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001023Near-RT RIC Repository
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001024**********************
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001025
1026The Policy Agent keeps an updated view of the Near |nbh| RT |nbsp| RICs that are available in the system. A service can
1027find out which Near |nbh| RT |nbsp| RIC that manages a specific element in the network or which
1028Near |nbh| RT |nbsp| RICs that support a specific policy type.
1029
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001030/ric
1031~~~~
1032
1033GET
1034+++
1035
elinuxhenrikfea065a2020-04-20 16:46:26 +02001036Returns the name of a Near |nbh| RT |nbsp| RIC managing a specific Mananged Element.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001037
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001038Definition
1039""""""""""
1040
1041**URL path:**
1042
1043/ric?managedElementId=<id-of-managed-element>
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001044
elinuxhenrikfea065a2020-04-20 16:46:26 +02001045**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001046
1047managedElementId: (*Required*)
1048
1049The ID of the Managed Element.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001050
elinuxhenrikfea065a2020-04-20 16:46:26 +02001051**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001052
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001053200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001054
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001055Name of the Near |nbh| RT |nbsp| RIC managing the Managed Element.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001056
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001057404:
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001058
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001059No Near |nbh| RT |nbsp| RIC manages the given Managed Element.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001060
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001061Examples
1062""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001063
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001064**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001065
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001066 curl -X GET "http://localhost:8081/ric?managedElementId=Node 1"
1067
1068**Result**:
1069
1070200: ::
1071
1072 Ric 1
1073
1074**Call**: ::
1075
1076 curl -X GET "http://localhost:8081/ric?managedElementId=notmanaged"
1077
1078**Result**:
1079
1080404
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001081
1082/rics
1083~~~~~
1084
1085GET
1086+++
1087
elinuxhenrikfea065a2020-04-20 16:46:26 +02001088Query Near |nbh| RT |nbsp| RIC information.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001089
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001090Definition
1091""""""""""
1092
1093**URL path:**
1094
1095/rics?policyType=<name-of-policy-type>
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001096
elinuxhenrikfea065a2020-04-20 16:46:26 +02001097**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001098
1099policyType: (*Optional*)
1100
1101The name of the policy type.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001102
elinuxhenrikfea065a2020-04-20 16:46:26 +02001103**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001104
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001105200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001106
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001107Array of JSON objects containing Near |nbh| RT |nbsp| RIC information. ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001108
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001109 [
1110 {
1111 "managedElementIds": [
1112 "string"
1113 ],
1114 "policyTypes": [
1115 "string"
1116 ],
1117 "ricName": "string",
1118 "state": "string"
1119 }
1120 ]
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001121
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001122404:
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001123
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001124Policy type is not found.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001125
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001126Examples
1127""""""""
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001128
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001129**Call**: ::
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001130
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001131 curl -X GET "http://localhost:8081/rics?policyType=STD_PolicyModelUnconstrained_0.2.0"
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001132
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001133**Result**:
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001134
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001135200: ::
1136
1137 [
1138 {
1139 "managedElementIds": [
1140 "ME 1",
1141 "ME 2"
1142 ],
1143 "policyTypes": [
1144 "STD_PolicyModelUnconstrained_0.2.0",
1145 "Example_QoETarget_1.0.0",
1146 "ERIC_QoSNudging_0.2.0"
1147 ],
1148 "ricName": "Ric 1",
1149 "state": "AVAILABLE"
1150 },
1151 .
1152 .
1153 .
1154 {
1155 "managedElementIds": [
1156 "ME 3"
1157 ],
1158 "policyTypes": [
1159 "STD_PolicyModelUnconstrained_0.2.0"
1160 ],
1161 "ricName": "Ric X",
1162 "state": "UNAVAILABLE"
1163 }
1164 ]
1165
1166**Call**: ::
1167
1168 curl -X GET "http://localhost:8081/rics?policyType=nonexistent"
1169
1170**Result**:
1171
1172404: ::
1173
1174 Policy type not found
1175
1176************
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001177Health Check
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001178************
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001179
1180The status of the Policy Agent.
1181
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001182/status
1183~~~~~~~
1184
1185GET
1186+++
1187
elinuxhenrikfea065a2020-04-20 16:46:26 +02001188Returns the status of the Policy Agent.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001189
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001190Definition
1191""""""""""
1192
1193**URL path:**
1194
1195/status
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001196
elinuxhenrikfea065a2020-04-20 16:46:26 +02001197**Parameters:**
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001198
1199None.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001200
elinuxhenrikfea065a2020-04-20 16:46:26 +02001201**Responses:**
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001202
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001203200:
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001204
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001205Service is living.
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001206
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001207Examples
1208""""""""
1209
1210**Call**: ::
1211
1212 curl -X GET "http://localhost:8081/status"
1213
1214**Result**:
1215
1216200
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001217
1218****************
1219A1 through DMaaP
1220****************
1221
1222The Policy Agent also provides the possibility to use DMaap to handle policies according to the A1 specification. The
1223Policy Agent polls the DMaaP Message Router regularly and processes any messages targeted to it. The response is then
1224published back to the DMaaP Message Router with the result of the call.
1225
1226Send Message
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001227~~~~~~~~~~~~
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001228
1229The message to send is a JSON like the one below. The "*url*" is one of the URLs described under
1230:ref:`policy-management`. The "*target*" must always be "*policy-agent*" for the message to be processed by the Policy
1231Agent. The "*operation*" can be one of the following: "*GET | PUT | POST | DELETE*". ::
1232
1233 {
1234 "type": "string",
1235 "correlationId": "string",
1236 "target": "string",
1237 "timestamp": "timestamp",
1238 "apiVersion": "string",
1239 "originatorId": "string",
1240 "requestId": "string",
1241 "operation": "string",
1242 "url": "string"
1243 }
1244
1245Example
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001246+++++++
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001247
1248To get all policy types for a specific Near |nbh| RT |nbsp| RIC the following message should be sent to DMaaP Message
1249Router: ::
1250
1251 {
1252 "type":"request",
1253 "correlationId":"c09ac7d1-de62-0016-2000-e63701125557-201",
1254 "target":"policy-agent",
1255 "timestamp":"2019-05-14T11:44:51.36Z",
1256 "apiVersion":"1.0",
1257 "originatorId":"849e6c6b420",
1258 "requestId":"23343221",
1259 "operation":"GET",
1260 "url":"/policy_schemas?ric=ric_ric-simulator_1"
1261 }
1262
1263Receive Message
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001264~~~~~~~~~~~~~~~
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001265
1266The message the Policy Agent sends back to the DMaaP Message Router is a JSON like the one below. The "*requestId*"
1267"*correlationId*", and "*originatorId*" are the same as in the message sent to DMaaP MR. ::
1268
1269 {
1270 "requestId": "string",
1271 "correlationId": "string",
1272 "originatorId": "string",
1273 "type": "string",
1274 "message": "string",
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001275 "type": "string",
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001276 "timestamp": "string",
1277 "status": "string"
1278 }
1279
1280Example
elinuxhenrikd64e33d2020-04-22 18:05:07 +02001281+++++++
elinuxhenrike0fab9a2020-03-31 17:59:49 +02001282
1283The response containing all policy types for a specific Near |nbh| RT |nbsp| RIC sent to the DMaaP Message Router from
1284the Policy Agent: ::
1285
1286 {
1287 \"requestId\":\"23343221\",
1288 \"correlationId\":\"c09ac7d1-de62-0016-2000-e63701125557-201\",
1289 \"originatorId\":\"849e6c6b420\",
1290 \"type\":\"response\",
1291 \"message\":\"[
1292 {
1293 \\\"$schema\\\":\\\"http://json-schema.org/draft-07/schema#\\\",
1294 \\\"description\\\":\\\"QoS policy type\\\",
1295 \\\"title\\\":\\\"STD_QoSNudging_0.2.0\\\",
1296 \\\"type\\\":\\\"object\\\",
1297 \\\"properties\\\":{\\\"scope\\\":{\\\"additionalProperties\\\":true,
1298 \\\"type\\\":\\\"object\\\",
1299 \\\"properties\\\":{\\\"qosId\\\":{\\\"type\\\":\\\"string\\\"},
1300 \\\"ueId\\\":{\\\"type\\\":\\\"string\\\"}},
1301 \\\"required\\\":[\\\"ueId\\\",
1302 \\\"qosId\\\"]},
1303 \\\"statement\\\":{\\\"additionalProperties\\\":false,
1304 \\\"type\\\":\\\"object\\\",
1305 \\\"properties\\\":{\\\"priorityLevel\\\":{\\\"type\\\":\\\"number\\\"}},
1306 \\\"required\\\":[\\\"priorityLevel\\\"]}}
1307 }
1308 ]\",
1309 \"timestamp\":\"2019-05-14T11:44:51.36Z\",
1310 \"status\":\"200 OK\"
1311 }