This page describes how to get the New-Delhi release version of A1-Policy functions up and running using Docker.
...
All components run as docker containers and communicate via a private docker network. Details of the architecture can be found from "New Delhi" Release page.
Note: Version numbers used in this page may not be the most recent ... you should verify the latest version numbers for released pre-built components in the docker image repository (https://nexus3.onap.org)
...
Copy the default configuration file oran/a1-policy-management/config/application_configuration.json (newdelhi) to the current directory, then replace/amend the configuration with the sample demo configuration below.
(Note the configuration below is just a sample, and should be updated to match particular deployments.
The deployment below assumes 4 near-RT-RICs exist - addressable at the URLs given.
See the step "Run OSC Near-RT-RIC/A1 Simulator Docker Containers" below)The
controller
URL(
hostname, port),username
andpassword
values to access the A1 Controller (SDNC + A1 Adapter) must match the values configured for the SDNC-A1-Controller. (See the step "Run A1 Controller" further below). The port number for http here is 8181.
(Note the configuration below is just a sample, and should be updated to match particular deployments.
The deployment below assumes an A1 Controller function (SDNC) exists - addressable at the url given, using the authentication credentials given.)Any defined
ric
host names values (in thename
andbaseUrl
parameters for eachric
entry) must match the given docker container names in near-RT-RIC simulator startup.
Here the port is always port the simulator's internal port 8085, for http or 8185 for https.Note: The A1 Policy Management service can entirely by-pass the A1-Controller (SDNC + A1 Adapter) if desired - it is optional to access the near-RT-RIC through an A1-Controller/SDNC.
info(See 'Alternative' below)
Sample application configuration
Code Block |
---|
Sample application configuration
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
|
...
There is no functional gain in accessing the near-RT-RIC through an A1-Controller.
To bypass the A1-Controller (SDNC + A1 Adapter), where the A1-Policy Management Service connects directly to the A1 Interface:
- In the configuration the "
controller
" property is optional in the "ric
" objects - If all configured
ric
s bypass the A1-Controller (do not have "controller
" values) then the "controller
" object at the top of the configuration can be omitted. - If all configured
ric
s bypass the A1-Controller there is no need to start an A1-Controller.
| |||
{ "description": "Application configuration", "config": { "controller": [ { "name": "controller1", "baseUrl": "http://sdnc_controller:8181", "userName": "admin", "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" } ], "ric": [ { "name": "ric1", "baseUrl": "http://ric1:8085/", "managedElementIds": [ ] }, { "name": "ric2", "baseUrl": "http://ric2:8085/", "managedElementIds": [ "kista_3", "kista_4" ] }, { "name": "ric3", "baseUrl": "http://ric3:8085/", "controller": "controller1", "managedElementIds": [ "kista_5", "kista_6" ] }, { "name": "ric4", "baseUrl": "http://ric4:8085/", "controller": "controller1", "managedElementIds": [ "kista_7", "kista_8", "kista_9", "kista_10", "kista_11" ] } ] } } | |||
Info | |||
---|---|---|---|
title | Alternative: Bypass the A1-Controller - connect direct from A1-Policy Management Service} |
Info | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||
There is no functional gain in accessing the near-RT-RIC through an A1-Controller. To bypass the A1-Controller (SDNC + A1 Adapter), where the A1-Policy Management Service connects directly to the A1 Interface:
|
...
Component | Release image and version tag | Staging images and version tag | Manual snapshot (only available if manually built) and version tag |
---|---|---|---|
A1 Policy Management Service | nexus3.onap.org:10002/onap/ccsdk-oran-a1policymanagementservice:1.7.12 | nexus3.onap.org:10004/onap/ccsdk-oran-a1policymanagementservice:1.7.23-STAGING-latest | onap/ccsdk-oran-a1policymanagementservice:1.7.23-SNAPSHOT |
SDNC image | nexus3.onap.org:10002/onap/sdnc-image:2.6.1 | nexus3.onap.org:10004/onap/sdnc-image:2.8.0-STAGING-latest | onap/sdnc-image:2.8.0-SNAPSHOT |
...
Run A1 Policy Management Service docker container using the command below, after the A1-Controller and simulators have been fully started.
The configuration file (application_configuration.json described above) must be mounted as avolume
into the container, so absolute path and name of the file must be substituted in the following command:Code Block language bash title Docker: Run the A1 Policy Management Service docker run -p 8081:8081 --network=nonrtric-docker-net --name=a1policymanagmentservice --volume **<Absolute path to application_configuration.json created above>**:/opt/app/policy-agent/data/application_configuration.json nexus3.onap.org:10002/onap/ccsdk-oran-a1policymanagementservice:1.7.12
Note: Version numbers used in this page may not be the most recent ... you should verify the latest version numbers for released pre-built components in the docker image repository (https://nexus3.onap.org)
Note: Make sure to give the full/absolute path to the configuration file. Docker will need this full path to find the file to mount it as a volume. Otherwise Docker will instead create an empty directory as the volume inside the container.This command starts the A1 Policy Management Service, using the configuration specified above, with its REST endpoint available at ports
8081
Other docker containers using the same docker network ("nonrtric-docker-net
") can address this container by name, and directly access its REST endpoints. i.e.:a1policymanagmentservice
:8081
- Ports
8081
is also exposed outside the network , mapped to a local port on the host. i.e.:
Port8081
ina1policymanagmentservice
container →localhost:8081
- It may be useful to set the logging level to
TRACE
level, where you can verify the A1-Controller, A1-Simualtors and A1 Policy Management Service is fully up and running.Code Block language bash title Optional: Enable TRACE level logging in A1 Policy Management Service collapse true curl -i -X POST "http://localhost:8081/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice" -H "Content-Type:application/json" -d {\"configuredLevel\":\"trace\"} curl -i -X GET "http://localhost:8081/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice"
Once the Policy Management Service is up and running, it establishes connections to all configured near-RT-RICs (
ric1
,ric2
,ric3
,ric4
) via the A1 Controller.If the
a1policymanagmentservice
container is configured to log atTRACE
level, the following logs entries should appear indicating that connection to the configured near-RT-RICs has been established successfully (via A1 Controller if enabled).
...
A1-Policy Management Service - Check “
rics
”
https://docs.onap.org/projects/onap-ccsdk-oran/en/latest/offeredapis/pms-api.html#operationdocs.onap.org: (newdelhi): API: operation/getRicsCode Block curl localhost:8081/a1-policy/v2/rics
A1-Policy Management Service Service - Get A1-Policy Types
https://docs.onap.org/projects/onap-ccsdk-oran/en/latest/offeredapis/pms-api.html#operation/: (newdelhi): API: operation/getPolicyTypesCode Block curl localhost:8081/a1-policy/v2/policy-types
A1-Policy Management Service Service - Get A1-Policy Type details
https://docs.onap.org/projects/onap-ccsdk-oran/en/latest/offeredapis/pms-api.html#operation/: (newdelhi): API: operation/getPolicyTypeCode Block curl localhost:8081/a1-policy/v2/policy-types/1 # For A1 Policy Type 1 described above curl localhost:8081/a1-policy/v2/policy-types/STD_QOS2_0.1.0 # For A1 Policy Type “STD_QOS2_0.1.0” described above
...
Sample A1-Policy Instance data that corresponds to A1-Policy Type “
STD_QOS2_0.1.0
” is shown below. This can be used to create a new A1-Policy instance on "ric3
" or "ric4
".Code Block language js title Instance#1: policy_data payload: Type: "STD_QOS2_0.1.0" collapse true { "scope": { "ueId": "ue5000", "qosId": "qos5000" }, "qosObjectives": { "priorityLevel": 5000 } }
The payload to create a new A1-Policy Instance (
policy_id:"aa8feaa88d"
) of type “STD_QOS2_0.1.0
” on "ric3
" is shown belowCode Block language js title Instance#1: instance_1.json1.json (policy_id:aa8feaa88d) collapse true { "ric_id": "ric3", "policy_id": "aa8feaa88d", "service_id": "myapp", "policytype_id": "STD_QOS2_0.1.0", "policy_data": { "scope": { "ueId": "ue5000", "qosId": "qos5000" }, "qosObjectives": { "priorityLevel": 5000 } } }
https://docs.onap.org/projects/onap-ccsdk-oran/en/latest/offeredapis/pms-api.html#tag/A1-Policy-Management/: (newdelhi): API: operation/putPolicy
Code Block language bash curl -X PUT -v "http://localhost:8081/a1-p/policies" -H "accept: application/json" -H "Content-Type: application/json" --data-binary @instance_1.json curl "http://localhost:8081/a1-p/policies" Result: {"policy_ids":["aa8feaa88d"]} curl "localhost:8081/a1-policy/v2/policies/aa8feaa88d944d919ef0e83f2172a5000" Result: {"ric_id":"ric3","policy_id":"aa8feaa88d","service_id":"controlpanel","policy_data":{"scope":{"ueId":"ue5000","qosId":"qos5000"},"qosObjectives":"priorityLevel":5000}},"status_notification_uri":null, "policytype_id":"STD_QOS2_0.1.0","transient":false}
Sample A1-Policy Instance data that corresponds to A1-Policy Type
1
is shown below. This can be used to create a new A1-Policy instance on "ric1
" or "ric2
".Code Block language js title Instance#2: policy_data payload: Type: 1 collapse true { "scope": { "ueId": "ue6000", "qosId": "qos6000" }, "qosObjectives": { "priorityLevel": 6000 } }
The payload to create a new A1-Policy Instance (
policy_id:"172a5100"
) of type “STD_QOS2_0.1.0
” on "ric2
" is shown belowCode Block language js title Instance#2: instance_2.json (policy_id:"172a5100") collapse true { "ric_id": "ric2", "policy_id": "172a5100", "service_id": "myapp", "policytype_id": "1", "policy_data": { "scope": { "ueId": "ue6000", "qosId": "qos6000" }, "qosObjectives": { "priorityLevel": 6000 } } }
https://docs.onap.org/projects/onap-ccsdk-oran/en/latest/offeredapis/pms-api.html#tag/A1-Policy-Management/: (newdelhi): API: operation/putPolicy
Code Block language bash curl -X PUT -v "http://localhost:8081/a1-p/policies" -H "accept: application/json" -H "Content-Type: application/json" --data-binary @instance_2.json curl "http://localhost:8081/a1-p/policies" Result: {"policy_ids":["172a5000", "aa8feaa88d"]} curl "localhost:8081/a1-policy/v2/policies/172a5000" Result: {"ric_id":"ric2","policy_id":"172a5000","service_id":"myapp","policy_data":{"scope":{"ueId":"ue6000","qosId":"qos6000"},"qosObjectives":"priorityLevel":6000}},"status_notification_uri":null,"policytype_id":"1","transient":false}
...