1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
4 .. |nbsp| unicode:: 0xA0
7 .. |nbh| unicode:: 0x2011
12 ############################
13 A1 Policy Management Service
14 ############################
17 *******************************************
18 A1 Policy Management Service - Introduction
19 *******************************************
21 The A1 Policy Management Service ("Policy Agent") is an SMO/NONRTRIC service above the NONRTRIC A1 Adaptor/Controller
24 * Unified REST & DMAAP APIs for managing A1 Policies in all Near |nbh| RT |nbsp| RICs
25 * Synchronized view of registered "services" (e.g. R-APP, GUI, etc)
26 * Synchronized view of policy instances for each "service"
27 * Synchronized view of policy instances in all Near |nbh| RT |nbsp| RICs
28 * Synchronized view of policy types in all Near |nbh| RT |nbsp| RICs
29 * Policy Query API (e.g. per Near |nbh| RT |nbsp| RIC, per "service", per policy type)
30 * An initial interface for unified Near |nbh| RT |nbsp| RIC ID to Near |nbh| RT |nbsp| RIC address mapping.
31 (Note: may also later act as adaptor to A&AI, CMDBs etc. to "find" Near |nbh| RT |nbsp| RICs - TBC)
32 * An Initial "O1 ManagedElement" mapping database & interface to find appropriate Near |nbh| RT |nbsp| RIC for RAN elements.
33 (Note: may also later act as adaptor to A&AI, RuntimeDB, other CMDBs etc. - TBC)
34 * Monitors all Near |nbh| RT |nbsp| RICs and recovers from inconsistencies (Note: e.g. Near |nbh| RT |nbsp| RIC restarts)
35 * Support for different Southbound connectors on a per Near |nbh| RT |nbsp| RIC basis. (Note: e.g. different A1
36 versions, different Near |nbh| RT |nbsp| RIC versions, different A1 adapters, different or proprietary A1
39 ***************************************
40 A1 Policy Management Service - REST NBI
41 ***************************************
43 This is the north bound API of the A1 Policy Management Service ("Policy Agent"). This API allows *services* to interact
44 with the Policy Agent using REST.
46 By registering with the Policy Agent, the Policy Agent takes responsibility for synchronizing the policies created by
47 the service in the Near |nbh| RT |nbsp| RICs. This means that if a Near |nbh| RT |nbsp| RIC restarts, the Policy Agent
48 will try to recreate all the policies residing in the Near |nbh| RT |nbsp| RIC once it is started again. If this is not
49 possible, it will remove all policies belonging to the Near |nbh| RT |nbsp| RIC.
51 The Policy Agent also keeps an updated view of the policy types available, and which Near |nbh| RT |nbsp| RICs that
52 support which types. Also, the Policy Agent can tell if a Managed Element is managed by a certain
53 Near |nbh| RT |nbsp| RIC.
55 The Policy Agent NBI has four distinct parts, described in the sections below:
59 * Near-RT RIC Repository
62 .. contents:: Operations
70 A service can register itself in the Policy Agent.
72 By providing a callback URL the service can get notifications from the Policy Agent.
74 A service can also register a "*Keep Alive Interval*", in seconds. By doing this the service promises to call the
75 Policy Agent's "*Keep Alive*" method, or else create or delete policies, more often than the "*Keep Alive Interval*"
76 measured in seconds. If the service, for some reason, is not able to do this, the Policy Agent will consider that the
77 service has died or vanished and will then delete all its policies, both in the internal repository and in the
78 Near |nbh| RT |nbsp| RICs where they were earlier created. **Note!** |nbsp| If the service does not provide a value for
79 "*Keep Alive Interval*", then the service maintains full responsibility to delete all of its policies when they are no
82 Service Management Operations
83 -----------------------------
100 **Body:** (*Required*)
101 A JSON object (ServiceRegistrationInfo): ::
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.)
118 Something went wrong with the service registration.
124 curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d "{
125 \"callbackUrl\": \"URL\",
126 \"keepAliveIntervalSeconds\": 0,
127 \"serviceName\": \"existing\"
137 curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d "{}"
142 Missing mandatory parameter 'serviceName'
150 Query service information.
153 /services?name=<service-name>
158 The name of the service.
163 Array of JSON objects (ServiceStatus). ::
166 "callbackUrl": "string", (Callback URL)
167 "keepAliveIntervalSeconds": 0, (Policy keep alive interval)
168 "serviceName": "string", (Identity of the service)
169 "timeSinceLastActivitySeconds": 0 (Time since last invocation by the service)
173 Service is not found.
179 curl -X GET "http://localhost:8081/services?name=existing"
186 "serviceName":"existing",
187 "keepAliveIntervalSeconds":0,
188 "timeSinceLastActivitySeconds":7224,
195 curl -X GET "http://localhost:8081/services?name=nonexistent"
208 /services?name=<service-name>
213 The name of the service.
227 curl -X DELETE "http://localhost:8081/services?name=existing"
236 curl -X DELETE "http://localhost:8081/services?name=nonexistent"
241 Could not find service: nonexistent
249 Heart beat from a service.
252 /services/keepalive?name=<service-name>
257 The name of the service.
265 Service is not found.
271 curl -X POST "http://localhost:8081/services/keepalive?name=existing"
280 curl -X POST "http://localhost:8081/services/keepalive?name=nonexistent"
285 Could not find service: nonexistent
287 .. _policy-management:
292 Policies are based on types. The set of available policy types is determined by the set of policy types supported by
293 Near |nbh| RT |nbsp| RICs. At startup, the Policy Agent queries all Near |nbh| RT |nbsp| RICs for their supported types
294 and stores them in its internal repository. It then checks this at regular intervals to keep the repository of types up
295 to date. Policy types cannot be created, updated or deleted using this interface since this must be done via the
296 Near |nbh| RT |nbsp| RICs.
298 Policies can be queried, created, updated, and deleted. A policy is always created in a specific
299 Near |nbh| RT |nbsp| RIC.
301 When a policy is created, the Policy Agent stores information about it in its internal repository. At regular intervals,
302 it then checks with all Near |nbh| RT |nbsp| RICs that this repository is synchronized. If, for some reason, there is an
303 inconsistency, the Policy Agent will start a synchronization job and try to reflect the status of the
304 Near |nbh| RT |nbsp| RIC. If this fails, the Policy Agent will delete all policies for the specific
305 Near |nbh| RT |nbsp| RIC in the internal repository and set its state to *UNKNOWN*. This means that no interaction with
306 the Near |nbh| RT |nbsp| RIC is possible until the Policy Agent has been able to contact it again and re-synchronize its
307 state in the repository.
312 A policy type defines a name and a JSON schema that constrains the content of a policy of that type.
320 Query policy type names.
323 /policy_types?ric=<name-of-ric>
328 The name of the Near |nbh| RT |nbsp| RIC to get types for.
333 Array of policy type names.
336 Near |nbh| RT |nbsp| RIC is not found.
342 curl -X GET "http://localhost:8081/policy_types"
348 "STD_PolicyModelUnconstrained_0.2.0",
349 "Example_QoETarget_1.0.0",
350 "ERIC_QoSNudging_0.2.0"
355 curl -X GET "http://localhost:8081/policy_types?ric=nonexistent"
360 org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent
368 Returns one policy type schema definition.
371 /policy_schema?id=<name-of-type>
376 The ID of the policy type to get the definition for.
381 Policy schema as JSON schema.
384 Policy type is not found.
390 curl -X GET "http://localhost:8081/policy_schema?id=STD_PolicyModelUnconstrained_0.2.0"
396 "$schema": "http://json-schema.org/draft-07/schema#",
397 "title": "STD_PolicyModelUnconstrained_0.2.0",
398 "description": "Standard model of a policy with unconstrained scope id combinations",
404 "ueId": {"type": "string"},
405 "groupId": {"type": "string"}
408 "additionalProperties": false
413 "gfbr": {"type": "number"},
414 "mfbr": {"type": "number"}
416 "additionalProperties": false
431 "additionalProperties": false,
432 "required": ["cellIdList"]
437 "additionalProperties": false,
438 "required": ["scope"]
443 curl -X GET "http://localhost:8081/policy_schema?id=nonexistent"
448 org.oransc.policyagent.exceptions.ServiceException: Could not find type: nonexistent
456 Returns policy type schema definitions.
459 /policy_schemas?ric=<name-of-ric>
464 The name of the Near |nbh| RT |nbsp| RIC to get the definitions for.
469 An array of policy schemas as JSON schemas.
472 Near |nbh| RT |nbsp| RIC is not found.
478 curl -X GET "http://localhost:8081/policy_schemas"
484 "$schema": "http://json-schema.org/draft-07/schema#",
485 "title": "STD_PolicyModelUnconstrained_0.2.0",
486 "description": "Standard model of a policy with unconstrained scope id combinations",
494 "additionalProperties": false,
495 "required": ["scope"]
501 "$schema": "http://json-schema.org/draft-07/schema#",
502 "title": "Example_QoETarget_1.0.0",
503 "description": "Example QoE Target policy type",
511 "additionalProperties": false,
512 "required": ["scope"]
516 curl -X GET "http://localhost:8081/policy_schemas?ric=nonexistent"
521 org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent
526 A policy is defined by its type schema.
528 Once a service has created a policy, it is the service's responsibility to maintain its life cycle. Since policies are
529 transient, they will not survive a restart of a Near |nbh| RT |nbsp| RIC. But this is handled by the Policy Agent. When
530 a Near |nbh| RT |nbsp| RIC has been restarted, the Policy Agent will try to recreate the policies in the
531 Near |nbh| RT |nbsp| RIC that are stored in its local repository. This means that the service always must delete any
532 policy it has created. There are only two exceptions, see below:
534 - The service has registered a "*Keep Alive Interval*", then its policies will be deleted if it fails to notify the
535 Policy Agent in due time.
536 - The Policy Agent completely fails to synchronize with a Near |nbh| RT |nbsp| RIC.
547 /policies?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-type>
552 The name of the Near |nbh| RT |nbsp| RIC to get policies for.
554 service: (*Optional*)
555 The name of the service to get policies for.
558 The name of the policy type to get policies for.
563 Array of JSON objects (PolicyInfo). ::
566 "id": "string", (Identity of the policy)
567 "json": "object", (The configuration of the policy)
568 "lastModified": "string", (Timestamp, last modification time)
569 "ric": "string", (Identity of the target Near |nbh| RT |nbsp| RIC)
570 "service": "string", (The name of the service owning the policy)
571 "type": "string" (Name of the policy type)
575 Near |nbh| RT |nbsp| RIC or policy type not found.
581 curl -X GET "http://localhost:8081/policies?ric=existing"
600 "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT",
602 "service": "Service 1",
603 "type": "STD_PolicyModelUnconstrained_0.2.0"
612 "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT",
614 "service": "Service 2",
615 "type": "Example_QoETarget_1.0.0"
621 curl -X GET "http://localhost:8081/policies?type=nonexistent"
626 Policy type not found
634 Returns a policy configuration.
637 /policy?id=<policy-id>
642 The ID of the policy instance.
647 JSON object containing policy information. ::
650 "id": "string", (ID of policy)
651 "json": "object", (JSON with policy data speified by the type)
652 "ownerServiceName": "string", (Name of the service that created the policy)
653 "ric": "string", (Name of the Near |nbh| RT |nbsp| RIC where the policy resides)
654 "type": "string", (Name of the policy type of the policy)
655 "lastModified" (Timestamp, last modification time)
665 curl -X GET "http://localhost:8081/policy?id=Policy 1"
680 "priorityLevel": 268.5,
685 "initialBuffering": 27.75,
691 "ownerServiceName": "Service 1",
693 "type": "STD_PolicyModelUnconstrained_0.2.0",
694 "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT"
699 curl -X GET "http://localhost:8081/policy?id=nonexistent"
709 Create/Update a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a
710 "*Keep Alive Interval*" registered.
713 /policy?id=<policy-id>&ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type>
718 The ID of the policy instance.
721 The name of the Near |nbh| RT |nbsp| RIC where the policy will be created.
723 service: (*Required*)
724 The name of the service creating the policy.
727 The name of the policy type.
729 **Body:** (*Required*)
730 A JSON object containing the data specified by the type.
741 Near |nbh| RT |nbsp| RIC or policy type is not found.
744 Near |nbh| RT |nbsp| RIC is locked.
750 curl -X PUT "http://localhost:8081/policy?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
751 -H "Content-Type: application/json"
755 \"cellId\": \"Cell 1\"
760 \"priorityLevel\": 268.5,
765 \"initialBuffering\": 27.75,
766 \"reBuffFreq\": 539.0,
767 \"stallRatio\": 343.0
778 Deletes a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a
779 "*Keep Alive Interval*" registered.
782 /policy?id=<policy-id>
787 The ID of the policy instance.
801 curl -X DELETE "http://localhost:8081/policy?id=Policy 1"
812 Query policy type IDs.
815 /policy_ids?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type>
820 The name of the Near |nbh| RT |nbsp| RIC to get policies for.
822 service: (*Optional*)
823 The name of the service to get policies for.
826 The name of the policy type to get policies for.
831 Array of policy type names.
834 RIC or policy type not found.
840 curl -X GET "http://localhost:8081/policy_ids"
853 curl -X GET "http://localhost:8081/policy_ids?ric=nonexistent"
866 Returns the status of a policy.
869 /policy_status?id=<policy-id>
874 The ID of the policy.
879 JSON object with policy status.
884 Near-RT RIC Repository
885 ======================
887 The Policy Agent keeps an updated view of the Near |nbh| RT |nbsp| RICs that are available in the system. A service can
888 find out which Near |nbh| RT |nbsp| RIC that manages a specific element in the network or which
889 Near |nbh| RT |nbsp| RICs that support a specific policy type.
900 Returns the name of a Near |nbh| RT |nbsp| RIC managing a specific Mananged Element.
903 /ric?managedElementId=<id-of-managed-element>
907 managedElementId: (*Optional*)
908 The ID of the Managed Element.
913 Name of the Near |nbh| RT |nbsp| RIC managing the Managed Element.
916 No Near |nbh| RT |nbsp| RIC manages the given Managed Element.
922 curl -X GET "http://localhost:8081/ric?managedElementId=Node 1"
931 curl -X GET "http://localhost:8081/ric?managedElementId=notmanaged"
942 Query Near |nbh| RT |nbsp| RIC information.
945 /rics?policyType=<name-of-policy-type>
949 policyType: (*Optional*)
950 The name of the policy type.
955 Array of JSON objects containing Near |nbh| RT |nbsp| RIC information. ::
959 "managedElementIds": [
970 Policy type is not found.
976 curl -X GET "http://localhost:8081/rics?policyType=STD_PolicyModelUnconstrained_0.2.0"
983 "managedElementIds": [
988 "STD_PolicyModelUnconstrained_0.2.0",
989 "Example_QoETarget_1.0.0",
990 "ERIC_QoSNudging_0.2.0"
998 "managedElementIds": [
1002 "STD_PolicyModelUnconstrained_0.2.0"
1010 curl -X GET "http://localhost:8081/rics?policyType=nonexistent"
1015 Policy type not found
1020 The status of the Policy Agent.
1031 Returns the status of the Policy Agent.
1049 curl -X GET "http://localhost:8081/status"
1058 The Policy Agent also provides the possibility to use DMaap to handle policies according to the A1 specification. The
1059 Policy Agent polls the DMaaP Message Router regularly and processes any messages targeted to it. The response is then
1060 published back to the DMaaP Message Router with the result of the call.
1065 The message to send is a JSON like the one below. The "*url*" is one of the URLs described under
1066 :ref:`policy-management`. The "*target*" must always be "*policy-agent*" for the message to be processed by the Policy
1067 Agent. The "*operation*" can be one of the following: "*GET | PUT | POST | DELETE*". ::
1071 "correlationId": "string",
1073 "timestamp": "timestamp",
1074 "apiVersion": "string",
1075 "originatorId": "string",
1076 "requestId": "string",
1077 "operation": "string",
1084 To get all policy types for a specific Near |nbh| RT |nbsp| RIC the following message should be sent to DMaaP Message
1089 "correlationId":"c09ac7d1-de62-0016-2000-e63701125557-201",
1090 "target":"policy-agent",
1091 "timestamp":"2019-05-14T11:44:51.36Z",
1093 "originatorId":"849e6c6b420",
1094 "requestId":"23343221",
1096 "url":"/policy_schemas?ric=ric_ric-simulator_1"
1102 The message the Policy Agent sends back to the DMaaP Message Router is a JSON like the one below. The "*requestId*"
1103 "*correlationId*", and "*originatorId*" are the same as in the message sent to DMaaP MR. ::
1106 "requestId": "string",
1107 "correlationId": "string",
1108 "originatorId": "string",
1110 "message": "string",
1112 "timestamp": "string",
1119 The response containing all policy types for a specific Near |nbh| RT |nbsp| RIC sent to the DMaaP Message Router from
1120 the Policy Agent: ::
1123 \"requestId\":\"23343221\",
1124 \"correlationId\":\"c09ac7d1-de62-0016-2000-e63701125557-201\",
1125 \"originatorId\":\"849e6c6b420\",
1126 \"type\":\"response\",
1129 \\\"$schema\\\":\\\"http://json-schema.org/draft-07/schema#\\\",
1130 \\\"description\\\":\\\"QoS policy type\\\",
1131 \\\"title\\\":\\\"STD_QoSNudging_0.2.0\\\",
1132 \\\"type\\\":\\\"object\\\",
1133 \\\"properties\\\":{\\\"scope\\\":{\\\"additionalProperties\\\":true,
1134 \\\"type\\\":\\\"object\\\",
1135 \\\"properties\\\":{\\\"qosId\\\":{\\\"type\\\":\\\"string\\\"},
1136 \\\"ueId\\\":{\\\"type\\\":\\\"string\\\"}},
1137 \\\"required\\\":[\\\"ueId\\\",
1139 \\\"statement\\\":{\\\"additionalProperties\\\":false,
1140 \\\"type\\\":\\\"object\\\",
1141 \\\"properties\\\":{\\\"priorityLevel\\\":{\\\"type\\\":\\\"number\\\"}},
1142 \\\"required\\\":[\\\"priorityLevel\\\"]}}
1145 \"timestamp\":\"2019-05-14T11:44:51.36Z\",
1146 \"status\":\"200 OK\"