One The A1 A1 Policy Management Service can be executed with a single docker command to start policy agent is like this::
Code Block | ||
---|---|---|
| ||
docker run -d -p 8081:8081 -p 8344: |
...
8433 -v "application_ |
...
configuration.json:/opt/app/policy-agent/application_configuration.json" |
...
nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent |
...
- The key point here is that Korea team must compose an “application_configuration.json” file, this is the config file for policy-agent to start properly.
...
|
If not using default network, should also add --network=<network-name> in the command.
To execute the Policy Management Service you will need an “application_configuration.json” file to configure the service.
This configuration file is then mounted into the correct place in the docker container using the -v parameter above (-v "application_configuration.json:/opt/app/policy-agent/application_configuration.json")
Code Block | ||||
---|---|---|---|---|
|
...
{ |
...
"config": |
...
{ "//description": "Application configuration", |
...
"controller": |
...
{
...
[ { "name": "a1-controller", |
...
"baseUrl": "http://a1-controller:8181", |
...
"userName": "admin", |
...
"password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" |
...
}
],
...
} ], "ric": |
...
{
...
[ { "name": "ric1", |
...
"baseUrl": "http://a1-sim-OSC:8085/", |
...
"controller": "a1-controller", |
...
"managedElementIds": |
...
[ "kista_1", |
...
"kista_2" |
...
]
},
{
...
] }, { "name":"ric2", |
...
"baseUrl":"http://a1-sim-STD:8085/", |
...
"controller": "a1-controller", |
...
"managedElementIds":[ |
...
"kista_ |
...
3", |
...
"kista_ |
...
]
}
]
}
}
4"
]
}
]
}
} |
Some sample CURL commands :
- For more information about the A1 Policy Management Service REST APIs see https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric/en/latest/policy-agent-api.html
1. Register a sample service "service1" in the Policy Management Service:
Code Block | ||||
---|---|---|---|---|
| ||||
curl -k -X PUT -sw |
If they are not using default network, should also append [--network=<network-name>] in the comand.
Add some stub/dummy data for demo/test purpose:
1.create service1 to policy agent:
...
%{http_code} -H accept:application/json -H Content-Type:application/json http://localhost:8081/service --data '{"callbackUrl": "http://callback-receiver:8090/callbacks/1","keepAliveIntervalSeconds": "3600","serviceName": "service1"}' |
2. create policy 2001 to ric1 with type1 and service1 via policy agent:
...
Create a new sample A1 Policy "2001" of type "1" for the service "service1" in one of the near-RT-RICs ("ric1") configured in the config file above:
(This assumes that the near-RT-RIC "ric1" uses a version of the A1 protocol that supports Policy Types, and the near-RT-RIC supports Policy Type "1", and the data passed for the Policy object complies with the schema for that Policy Type.)
Code Block | ||||
---|---|---|---|---|
| ||||
curl -k -X PUT -sw %{http_code} -H accept:application/json -H Content-Type:application/json "http://localhost:8081/policy?id=2001&ric=ric1&service=service1&type=1" --data '{"scope": {"ueId": "ue3100","qosId": "qos3100"},"qosObjective": {"priorityLevel": 3101}}' |
here ric1 is your OSC version near-rt-ric, and make sure service1 and type=1 exists in your ric.
Policy type cannot be created via policy agent, you have to create policy type in ric/gNB first.
3. create policy 2100 to ric2 with service1 via policy agent, no type:
3. Create a new sample A1 Policy "3100" of no type for the service "service1" in the other near-RT-RICs ("ric2") configured in the config file above:
(This assumes that the near-RT-RIC "ric2" uses a version of the A1 protocol that does not support Policy Types but the data passed for the Policy object can be interpreted by the near-RT-RIC)
Code Block | ||||
---|---|---|---|---|
| ||||
curl -k -X PUT -sw |
...
%{http_code} -H accept:application/json -H Content-Type:application/json "http://localhost:8081/policy?id= |
...
3100&ric=ric2&service=service1" --data '{"scope": {"ueId": "ue3100","qosId": "qos3100"},"qosObjective": {"priorityLevel": 3100}}' |
...
4. Get policy agent status:
...
status for the A1 Policy Management Service:
Code Block | ||||
---|---|---|---|---|
| ||||
curl -k -X PUT -sw %{http_code} -H accept:application/json -H Content-Type:application/json "http://localhost:8081/ |
...
policy?id=3100&ric=ric2&service=service1" --data '{"scope": {"ueId": "ue3100","qosId": "qos3100"},"qosObjective": {"priorityLevel": 3100}}' |